Loading services/core/java/com/android/server/dreams/DreamManagerService.java +7 −5 Original line number Original line Diff line number Diff line Loading @@ -124,8 +124,10 @@ public final class DreamManagerService extends SystemService { final boolean activityAllowed = activityType == ACTIVITY_TYPE_HOME final boolean activityAllowed = activityType == ACTIVITY_TYPE_HOME || activityType == ACTIVITY_TYPE_DREAM || activityType == ACTIVITY_TYPE_DREAM || activityType == ACTIVITY_TYPE_ASSISTANT; || activityType == ACTIVITY_TYPE_ASSISTANT; if (mCurrentDreamToken != null && !mCurrentDreamIsWaking && !activityAllowed) { if (mCurrentDreamToken != null && !mCurrentDreamIsWaking stopDreamInternal(false, "activity starting: " + activityInfo.name); && !mCurrentDreamIsDozing && !activityAllowed) { requestAwakenInternal( "stopping dream due to activity start: " + activityInfo.name); } } } } }; }; Loading Loading @@ -229,13 +231,13 @@ public final class DreamManagerService extends SystemService { mPowerManager.nap(time); mPowerManager.nap(time); } } private void requestAwakenInternal() { private void requestAwakenInternal(String reason) { // Treat an explicit request to awaken as user activity so that the // Treat an explicit request to awaken as user activity so that the // device doesn't immediately go to sleep if the timeout expired, // device doesn't immediately go to sleep if the timeout expired, // for example when being undocked. // for example when being undocked. long time = SystemClock.uptimeMillis(); long time = SystemClock.uptimeMillis(); mPowerManager.userActivity(time, false /*noChangeLights*/); mPowerManager.userActivity(time, false /*noChangeLights*/); stopDreamInternal(false /*immediate*/, "request awaken"); stopDreamInternal(false /*immediate*/, reason); } } private void finishSelfInternal(IBinder token, boolean immediate) { private void finishSelfInternal(IBinder token, boolean immediate) { Loading Loading @@ -715,7 +717,7 @@ public final class DreamManagerService extends SystemService { final long ident = Binder.clearCallingIdentity(); final long ident = Binder.clearCallingIdentity(); try { try { requestAwakenInternal(); requestAwakenInternal("request awaken"); } finally { } finally { Binder.restoreCallingIdentity(ident); Binder.restoreCallingIdentity(ident); } } Loading Loading
services/core/java/com/android/server/dreams/DreamManagerService.java +7 −5 Original line number Original line Diff line number Diff line Loading @@ -124,8 +124,10 @@ public final class DreamManagerService extends SystemService { final boolean activityAllowed = activityType == ACTIVITY_TYPE_HOME final boolean activityAllowed = activityType == ACTIVITY_TYPE_HOME || activityType == ACTIVITY_TYPE_DREAM || activityType == ACTIVITY_TYPE_DREAM || activityType == ACTIVITY_TYPE_ASSISTANT; || activityType == ACTIVITY_TYPE_ASSISTANT; if (mCurrentDreamToken != null && !mCurrentDreamIsWaking && !activityAllowed) { if (mCurrentDreamToken != null && !mCurrentDreamIsWaking stopDreamInternal(false, "activity starting: " + activityInfo.name); && !mCurrentDreamIsDozing && !activityAllowed) { requestAwakenInternal( "stopping dream due to activity start: " + activityInfo.name); } } } } }; }; Loading Loading @@ -229,13 +231,13 @@ public final class DreamManagerService extends SystemService { mPowerManager.nap(time); mPowerManager.nap(time); } } private void requestAwakenInternal() { private void requestAwakenInternal(String reason) { // Treat an explicit request to awaken as user activity so that the // Treat an explicit request to awaken as user activity so that the // device doesn't immediately go to sleep if the timeout expired, // device doesn't immediately go to sleep if the timeout expired, // for example when being undocked. // for example when being undocked. long time = SystemClock.uptimeMillis(); long time = SystemClock.uptimeMillis(); mPowerManager.userActivity(time, false /*noChangeLights*/); mPowerManager.userActivity(time, false /*noChangeLights*/); stopDreamInternal(false /*immediate*/, "request awaken"); stopDreamInternal(false /*immediate*/, reason); } } private void finishSelfInternal(IBinder token, boolean immediate) { private void finishSelfInternal(IBinder token, boolean immediate) { Loading Loading @@ -715,7 +717,7 @@ public final class DreamManagerService extends SystemService { final long ident = Binder.clearCallingIdentity(); final long ident = Binder.clearCallingIdentity(); try { try { requestAwakenInternal(); requestAwakenInternal("request awaken"); } finally { } finally { Binder.restoreCallingIdentity(ident); Binder.restoreCallingIdentity(ident); } } Loading