use of com.android.internal.app.NightDisplayController in project platform_frameworks_base by android.
the class NightDisplayService method setUp.
private void setUp() {
Slog.d(TAG, "setUp: currentUser=" + mCurrentUser);
// Create a new controller for the current user and start listening for changes.
mController = new NightDisplayController(getContext(), mCurrentUser);
mController.setListener(this);
// Initialize the current auto mode.
onAutoModeChanged(mController.getAutoMode());
// Force the initialization current activated state.
if (mIsActivated == null) {
onActivated(mController.isActivated());
}
}
use of com.android.internal.app.NightDisplayController in project android_frameworks_base by ResurrectionRemix.
the class NightDisplayService method setUp.
private void setUp() {
Slog.d(TAG, "setUp: currentUser=" + mCurrentUser);
// Create a new controller for the current user and start listening for changes.
mController = new NightDisplayController(getContext(), mCurrentUser);
mController.setListener(this);
// Initialize the current auto mode.
onAutoModeChanged(mController.getAutoMode());
// Force the initialization current activated state.
if (mIsActivated == null) {
onActivated(mController.isActivated());
}
}
use of com.android.internal.app.NightDisplayController in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class NightDisplaySettings method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final Context context = getContext();
mController = new NightDisplayController(context);
mTimeFormatter = android.text.format.DateFormat.getTimeFormat(context);
mTimeFormatter.setTimeZone(TimeZone.getTimeZone("UTC"));
mNightBrightValue = (DropDownPreference) findPreference(QS_NIGHT_BRIGHTNESS_VALUE);
int nightBrightValue = Settings.Secure.getInt(getContentResolver(), Settings.Secure.QS_NIGHT_BRIGHTNESS_VALUE, 0);
mNightBrightValue.setValue(Integer.toString(nightBrightValue));
mNightBrightValue.setSummary(mNightBrightValue.getEntry());
mNightBrightValue.setOnPreferenceChangeListener(this);
}
use of com.android.internal.app.NightDisplayController in project android_frameworks_base by DirtyUnicorns.
the class NightDisplayService method setUp.
private void setUp() {
Slog.d(TAG, "setUp: currentUser=" + mCurrentUser);
// Create a new controller for the current user and start listening for changes.
mController = new NightDisplayController(getContext(), mCurrentUser);
mController.setListener(this);
// Initialize the current auto mode.
onAutoModeChanged(mController.getAutoMode());
// Force the initialization current activated state.
if (mIsActivated == null) {
onActivated(mController.isActivated());
}
}
use of com.android.internal.app.NightDisplayController in project android_frameworks_base by crdroidandroid.
the class NightDisplayTile method handleUserSwitch.
@Override
protected void handleUserSwitch(int newUserId) {
// Stop listening to the old controller.
if (mIsListening) {
mController.setListener(null);
}
// Make a new controller for the new user.
mController = new NightDisplayController(mContext, newUserId);
if (mIsListening) {
mController.setListener(this);
}
super.handleUserSwitch(newUserId);
}
Aggregations