Loading services/core/java/com/android/server/UiModeManagerService.java +4 −3 Original line number Diff line number Diff line Loading @@ -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) { Loading Loading @@ -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(); Loading Loading @@ -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); Loading services/tests/uiservicestests/src/com/android/server/UiModeManagerServiceTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -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 */} Loading Loading
services/core/java/com/android/server/UiModeManagerService.java +4 −3 Original line number Diff line number Diff line Loading @@ -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) { Loading Loading @@ -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(); Loading Loading @@ -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); Loading
services/tests/uiservicestests/src/com/android/server/UiModeManagerServiceTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -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 */} Loading