Search in sources :

Example 1 with NightDisplayController

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());
    }
}
Also used : NightDisplayController(com.android.internal.app.NightDisplayController)

Example 2 with NightDisplayController

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());
    }
}
Also used : NightDisplayController(com.android.internal.app.NightDisplayController)

Example 3 with NightDisplayController

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);
}
Also used : Context(android.content.Context) NightDisplayController(com.android.internal.app.NightDisplayController)

Example 4 with NightDisplayController

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());
    }
}
Also used : NightDisplayController(com.android.internal.app.NightDisplayController)

Example 5 with NightDisplayController

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);
}
Also used : NightDisplayController(com.android.internal.app.NightDisplayController)

Aggregations

NightDisplayController (com.android.internal.app.NightDisplayController)11 Context (android.content.Context)1