Loading services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java +5 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,7 @@ public class KeyguardServiceDelegate { showingAndNotOccluded = true; secure = true; deviceHasKeyguard = true; currentUser = UserHandle.USER_NULL; } boolean showing; boolean showingAndNotOccluded; Loading Loading @@ -157,6 +158,10 @@ public class KeyguardServiceDelegate { if (mKeyguardState.systemIsReady) { // If the system is ready, it means keyguard crashed and restarted. mKeyguardService.onSystemReady(); if (mKeyguardState.currentUser != UserHandle.USER_NULL) { // There has been a user switch earlier mKeyguardService.setCurrentUser(mKeyguardState.currentUser); } // This is used to hide the scrim once keyguard displays. if (mKeyguardState.interactiveState == INTERACTIVE_STATE_AWAKE) { mKeyguardService.onStartedWakingUp(); Loading services/retaildemo/java/com/android/server/retaildemo/RetailDemoModeService.java +30 −22 Original line number Diff line number Diff line Loading @@ -224,8 +224,7 @@ public class RetailDemoModeService extends SystemService { if (mDeviceDemoModeUri.equals(uri)) { mDeviceInDemoMode = UserManager.isDeviceInDemoMode(getContext()); if (mDeviceInDemoMode) { SystemProperties.set(SYSTEM_PROPERTY_RETAIL_DEMO_ENABLED, "1"); mHandler.sendEmptyMessage(MSG_START_NEW_SESSION); putDeviceInDemoMode(); } else { SystemProperties.set(SYSTEM_PROPERTY_RETAIL_DEMO_ENABLED, "0"); if (mWakeLock.isHeld()) { Loading Loading @@ -287,7 +286,6 @@ public class RetailDemoModeService extends SystemService { synchronized (mActivityLock) { mFirstUserActivityTime = mLastUserActivityTime = SystemClock.uptimeMillis(); } mPreloadAppsInstaller = new PreloadAppsInstaller(context); } private Notification createResetNotification() { Loading Loading @@ -465,6 +463,11 @@ public class RetailDemoModeService extends SystemService { return mSystemUserConfiguration; } private void putDeviceInDemoMode() { SystemProperties.set(SYSTEM_PROPERTY_RETAIL_DEMO_ENABLED, "1"); mHandler.sendEmptyMessage(MSG_START_NEW_SESSION); } @Override public void onStart() { if (DEBUG) { Loading @@ -479,26 +482,31 @@ public class RetailDemoModeService extends SystemService { @Override public void onBootPhase(int bootPhase) { if (bootPhase != PHASE_THIRD_PARTY_APPS_CAN_START) { return; } switch (bootPhase) { case PHASE_THIRD_PARTY_APPS_CAN_START: mPreloadAppsInstaller = new PreloadAppsInstaller(getContext()); mPm = (PowerManager) getContext().getSystemService(Context.POWER_SERVICE); mAmi = LocalServices.getService(ActivityManagerInternal.class); mWakeLock = mPm .newWakeLock(PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP, TAG); .newWakeLock( PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP, TAG); mNm = NotificationManager.from(getContext()); mCameraManager = (CameraManager) getContext().getSystemService(Context.CAMERA_SERVICE); mCameraManager = (CameraManager) getContext() .getSystemService(Context.CAMERA_SERVICE); mCameraIdsWithFlash = getCameraIdsWithFlash(); if (UserManager.isDeviceInDemoMode(getContext())) { mDeviceInDemoMode = true; SystemProperties.set(SYSTEM_PROPERTY_RETAIL_DEMO_ENABLED, "1"); mHandler.sendEmptyMessage(MSG_START_NEW_SESSION); } SettingsObserver settingsObserver = new SettingsObserver(mHandler); settingsObserver.register(); settingsObserver.refreshTimeoutConstants(); registerBroadcastReceiver(); break; case PHASE_BOOT_COMPLETED: if (UserManager.isDeviceInDemoMode(getContext())) { mDeviceInDemoMode = true; putDeviceInDemoMode(); } break; } } @Override Loading Loading
services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java +5 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,7 @@ public class KeyguardServiceDelegate { showingAndNotOccluded = true; secure = true; deviceHasKeyguard = true; currentUser = UserHandle.USER_NULL; } boolean showing; boolean showingAndNotOccluded; Loading Loading @@ -157,6 +158,10 @@ public class KeyguardServiceDelegate { if (mKeyguardState.systemIsReady) { // If the system is ready, it means keyguard crashed and restarted. mKeyguardService.onSystemReady(); if (mKeyguardState.currentUser != UserHandle.USER_NULL) { // There has been a user switch earlier mKeyguardService.setCurrentUser(mKeyguardState.currentUser); } // This is used to hide the scrim once keyguard displays. if (mKeyguardState.interactiveState == INTERACTIVE_STATE_AWAKE) { mKeyguardService.onStartedWakingUp(); Loading
services/retaildemo/java/com/android/server/retaildemo/RetailDemoModeService.java +30 −22 Original line number Diff line number Diff line Loading @@ -224,8 +224,7 @@ public class RetailDemoModeService extends SystemService { if (mDeviceDemoModeUri.equals(uri)) { mDeviceInDemoMode = UserManager.isDeviceInDemoMode(getContext()); if (mDeviceInDemoMode) { SystemProperties.set(SYSTEM_PROPERTY_RETAIL_DEMO_ENABLED, "1"); mHandler.sendEmptyMessage(MSG_START_NEW_SESSION); putDeviceInDemoMode(); } else { SystemProperties.set(SYSTEM_PROPERTY_RETAIL_DEMO_ENABLED, "0"); if (mWakeLock.isHeld()) { Loading Loading @@ -287,7 +286,6 @@ public class RetailDemoModeService extends SystemService { synchronized (mActivityLock) { mFirstUserActivityTime = mLastUserActivityTime = SystemClock.uptimeMillis(); } mPreloadAppsInstaller = new PreloadAppsInstaller(context); } private Notification createResetNotification() { Loading Loading @@ -465,6 +463,11 @@ public class RetailDemoModeService extends SystemService { return mSystemUserConfiguration; } private void putDeviceInDemoMode() { SystemProperties.set(SYSTEM_PROPERTY_RETAIL_DEMO_ENABLED, "1"); mHandler.sendEmptyMessage(MSG_START_NEW_SESSION); } @Override public void onStart() { if (DEBUG) { Loading @@ -479,26 +482,31 @@ public class RetailDemoModeService extends SystemService { @Override public void onBootPhase(int bootPhase) { if (bootPhase != PHASE_THIRD_PARTY_APPS_CAN_START) { return; } switch (bootPhase) { case PHASE_THIRD_PARTY_APPS_CAN_START: mPreloadAppsInstaller = new PreloadAppsInstaller(getContext()); mPm = (PowerManager) getContext().getSystemService(Context.POWER_SERVICE); mAmi = LocalServices.getService(ActivityManagerInternal.class); mWakeLock = mPm .newWakeLock(PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP, TAG); .newWakeLock( PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP, TAG); mNm = NotificationManager.from(getContext()); mCameraManager = (CameraManager) getContext().getSystemService(Context.CAMERA_SERVICE); mCameraManager = (CameraManager) getContext() .getSystemService(Context.CAMERA_SERVICE); mCameraIdsWithFlash = getCameraIdsWithFlash(); if (UserManager.isDeviceInDemoMode(getContext())) { mDeviceInDemoMode = true; SystemProperties.set(SYSTEM_PROPERTY_RETAIL_DEMO_ENABLED, "1"); mHandler.sendEmptyMessage(MSG_START_NEW_SESSION); } SettingsObserver settingsObserver = new SettingsObserver(mHandler); settingsObserver.register(); settingsObserver.refreshTimeoutConstants(); registerBroadcastReceiver(); break; case PHASE_BOOT_COMPLETED: if (UserManager.isDeviceInDemoMode(getContext())) { mDeviceInDemoMode = true; putDeviceInDemoMode(); } break; } } @Override Loading