Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 04041cf1 authored by Jay Aliomer's avatar Jay Aliomer Committed by Android (Google) Code Review
Browse files

Merge "Dark theme not turning on/off when in twilight mode" into rvc-dev

parents c8d5a685 e0500885
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -165,9 +165,11 @@ final class UiModeManagerService extends SystemService {
    }

    @VisibleForTesting
    protected UiModeManagerService(Context context, boolean setupWizardComplete) {
    protected UiModeManagerService(Context context, boolean setupWizardComplete,
            TwilightManager tm) {
        this(context);
        mSetupWizardComplete = setupWizardComplete;
        mTwilightManager = tm;
    }

    private static Intent buildHomeIntent(String category) {
@@ -337,7 +339,6 @@ final class UiModeManagerService extends SystemService {
                mAlarmManager = (AlarmManager) getContext().getSystemService(Context.ALARM_SERVICE);
                mLocalPowerManager =
                        LocalServices.getService(PowerManagerInternal.class);
                mTwilightManager = getLocalService(TwilightManager.class);
                initPowerSave();
                mCarModeEnabled = mDockState == Intent.EXTRA_DOCK_STATE_CAR;
                registerVrStateListener();
@@ -380,7 +381,7 @@ final class UiModeManagerService extends SystemService {
                com.android.internal.R.bool.config_enableCarDockHomeLaunch);
        mUiModeLocked = res.getBoolean(com.android.internal.R.bool.config_lockUiMode);
        mNightModeLocked = res.getBoolean(com.android.internal.R.bool.config_lockDayNightMode);

        mTwilightManager = getLocalService(TwilightManager.class);
        final PackageManager pm = context.getPackageManager();
        mTelevision = pm.hasSystemFeature(PackageManager.FEATURE_TELEVISION)
                || pm.hasSystemFeature(PackageManager.FEATURE_LEANBACK);
+2 −1
Original line number Diff line number Diff line
@@ -146,7 +146,8 @@ public class UiModeManagerServiceTest extends UiServiceTestCase {
        addLocalService(PowerManagerInternal.class, mLocalPowerManager);
        addLocalService(TwilightManager.class, mTwilightManager);
        
        mUiManagerService = new UiModeManagerService(mContext, true);
        mUiManagerService = new UiModeManagerService(mContext, true,
                mTwilightManager);
        try {
            mUiManagerService.onBootPhase(SystemService.PHASE_SYSTEM_SERVICES_READY);
        } catch (SecurityException e) {/* ignore for permission denial */}