Loading services/core/java/com/android/server/am/ActivityManagerService.java +21 −10 Original line number Diff line number Diff line Loading @@ -952,10 +952,13 @@ public final class ActivityManagerService extends ActivityManagerNative */ private boolean mWentToSleep = false; static final int LOCK_SCREEN_HIDDEN = 0; static final int LOCK_SCREEN_LEAVING = 1; static final int LOCK_SCREEN_SHOWN = 2; /** * State of external call telling us if the lock screen is shown. */ private boolean mLockScreenShown = false; int mLockScreenShown = LOCK_SCREEN_HIDDEN; /** * Set if we are shutting down the system, similar to sleeping. Loading Loading @@ -6118,9 +6121,8 @@ public final class ActivityManagerService extends ActivityManagerNative synchronized (this) { if (DEBUG_LOCKSCREEN) logLockScreen(""); mWindowManager.keyguardWaitingForActivityDrawn(); if (mLockScreenShown) { mLockScreenShown = false; comeOutOfSleepIfNeededLocked(); if (mLockScreenShown == LOCK_SCREEN_SHOWN) { mLockScreenShown = LOCK_SCREEN_LEAVING; } } } finally { Loading Loading @@ -9957,14 +9959,23 @@ public final class ActivityManagerService extends ActivityManagerNative Binder.restoreCallingIdentity(origId); } private String lockScreenShownToString() { switch (mLockScreenShown) { case LOCK_SCREEN_HIDDEN: return "LOCK_SCREEN_HIDDEN"; case LOCK_SCREEN_LEAVING: return "LOCK_SCREEN_LEAVING"; case LOCK_SCREEN_SHOWN: return "LOCK_SCREEN_SHOWN"; default: return "Unknown=" + mLockScreenShown; } } void logLockScreen(String msg) { if (DEBUG_LOCKSCREEN) Slog.d(TAG, Debug.getCallers(2) + ":" + msg + " mLockScreenShown=" + mLockScreenShown + " mWentToSleep=" + " mLockScreenShown=" + lockScreenShownToString() + " mWentToSleep=" + mWentToSleep + " mSleeping=" + mSleeping); } private void comeOutOfSleepIfNeededLocked() { if ((!mWentToSleep && !mLockScreenShown) || mRunningVoice) { void comeOutOfSleepIfNeededLocked() { if ((!mWentToSleep && mLockScreenShown == LOCK_SCREEN_HIDDEN) || mRunningVoice) { if (mSleeping) { mSleeping = false; mStackSupervisor.comeOutOfSleepIfNeededLocked(); Loading Loading @@ -10001,7 +10012,7 @@ public final class ActivityManagerService extends ActivityManagerNative long ident = Binder.clearCallingIdentity(); try { if (DEBUG_LOCKSCREEN) logLockScreen(" shown=" + shown); mLockScreenShown = shown; mLockScreenShown = shown ? LOCK_SCREEN_SHOWN : LOCK_SCREEN_HIDDEN; comeOutOfSleepIfNeededLocked(); } finally { Binder.restoreCallingIdentity(ident); Loading Loading @@ -12767,9 +12778,9 @@ public final class ActivityManagerService extends ActivityManagerNative } } if (dumpPackage == null) { if (mSleeping || mWentToSleep || mLockScreenShown) { if (mSleeping || mWentToSleep || mLockScreenShown != LOCK_SCREEN_HIDDEN) { pw.println(" mSleeping=" + mSleeping + " mWentToSleep=" + mWentToSleep + " mLockScreenShown " + mLockScreenShown); + " mLockScreenShown " + lockScreenShownToString()); } if (mShuttingDown || mRunningVoice) { pw.print(" mShuttingDown=" + mShuttingDown + " mRunningVoice=" + mRunningVoice); services/core/java/com/android/server/am/ActivityStack.java +7 −6 Original line number Diff line number Diff line Loading @@ -241,9 +241,6 @@ final class ActivityStack { /** Run all ActivityStacks through this */ final ActivityStackSupervisor mStackSupervisor; /** Used to keep resumeTopActivityLocked() from being entered recursively */ private boolean inResumeTopActivity; static final int PAUSE_TIMEOUT_MSG = ActivityManagerService.FIRST_ACTIVITY_STACK_MSG + 1; static final int DESTROY_TIMEOUT_MSG = ActivityManagerService.FIRST_ACTIVITY_STACK_MSG + 2; static final int LAUNCH_TICK_MSG = ActivityManagerService.FIRST_ACTIVITY_STACK_MSG + 3; Loading Loading @@ -1468,7 +1465,7 @@ final class ActivityStack { } final boolean resumeTopActivityLocked(ActivityRecord prev, Bundle options) { if (inResumeTopActivity) { if (mStackSupervisor.inResumeTopActivity) { // Don't even start recursing. return false; } Loading @@ -1476,10 +1473,14 @@ final class ActivityStack { boolean result = false; try { // Protect against recursion. inResumeTopActivity = true; mStackSupervisor.inResumeTopActivity = true; if (mService.mLockScreenShown == ActivityManagerService.LOCK_SCREEN_LEAVING) { mService.mLockScreenShown = ActivityManagerService.LOCK_SCREEN_HIDDEN; mService.comeOutOfSleepIfNeededLocked(); } result = resumeTopActivityInnerLocked(prev, options); } finally { inResumeTopActivity = false; mStackSupervisor.inResumeTopActivity = false; } return result; } Loading services/core/java/com/android/server/am/ActivityStackSupervisor.java +3 −0 Original line number Diff line number Diff line Loading @@ -274,6 +274,9 @@ public final class ActivityStackSupervisor implements DisplayListener { final ArrayList<PendingActivityLaunch> mPendingActivityLaunches = new ArrayList<PendingActivityLaunch>(); /** Used to keep resumeTopActivityLocked() from being entered recursively */ boolean inResumeTopActivity; /** * Description of a request to start a new activity, which has been held * due to app switches being disabled. Loading services/core/java/com/android/server/wm/WindowAnimator.java +14 −12 Original line number Diff line number Diff line Loading @@ -272,6 +272,7 @@ public class WindowAnimator { if (winAnimator.mSurfaceControl != null) { final boolean wasAnimating = winAnimator.mWasAnimating; final boolean nowAnimating = winAnimator.stepAnimationLocked(mCurrentTime); mAnimating |= nowAnimating; if (WindowManagerService.DEBUG_WALLPAPER) { Slog.v(TAG, win + ": wasAnimating=" + wasAnimating + Loading Loading @@ -423,7 +424,8 @@ public class WindowAnimator { if (mKeyguardGoingAwayDisableWindowAnimations) { if (DEBUG_KEYGUARD) Slog.d(TAG, "updateWindowsLocked: skipping anim for windows"); } else { if (DEBUG_KEYGUARD) Slog.d(TAG, "updateWindowsLocked: created anim for windows"); if (DEBUG_KEYGUARD) Slog.d(TAG, "updateWindowsLocked: created anim for windows=" + unForceHiding); mPostKeyguardExitAnimation = mPolicy.createForceHideEnterAnimation( wallpaperInUnForceHiding, mKeyguardGoingAwayToNotificationShade); } Loading @@ -434,6 +436,17 @@ public class WindowAnimator { winAnimator.keyguardGoingAwayAnimation = true; } } // Wallpaper is going away in un-force-hide motion, animate it as well. if (!wallpaperInUnForceHiding && wallpaper != null && !mKeyguardGoingAwayDisableWindowAnimations) { if (DEBUG_KEYGUARD) Slog.d(TAG, "updateWindowsLocked: wallpaper animating away"); Animation a = mPolicy.createForceHideWallpaperExitAnimation( mKeyguardGoingAwayToNotificationShade); if (a != null) { wallpaper.mWinAnimator.setAnimation(a); } } } if (mPostKeyguardExitAnimation != null) { Loading @@ -448,17 +461,6 @@ public class WindowAnimator { mPostKeyguardExitAnimation = null; } } // Wallpaper is going away in un-force-hide motion, animate it as well. if (!wallpaperInUnForceHiding && wallpaper != null && !mKeyguardGoingAwayDisableWindowAnimations) { if (DEBUG_KEYGUARD) Slog.d(TAG, "updateWindowsLocked: wallpaper animating away"); Animation a = mPolicy.createForceHideWallpaperExitAnimation( mKeyguardGoingAwayToNotificationShade); if (a != null) { wallpaper.mWinAnimator.setAnimation(a); } } } private void updateWallpaperLocked(int displayId) { Loading services/core/java/com/android/server/wm/WindowStateAnimator.java +7 −4 Original line number Diff line number Diff line Loading @@ -486,8 +486,9 @@ class WindowStateAnimator { } boolean finishDrawingLocked() { if (DEBUG_STARTING_WINDOW && mWin.mAttrs.type == WindowManager.LayoutParams.TYPE_APPLICATION_STARTING) { final boolean startingWindow = mWin.mAttrs.type == WindowManager.LayoutParams.TYPE_APPLICATION_STARTING; if (DEBUG_STARTING_WINDOW && startingWindow) { Slog.v(TAG, "Finishing drawing window " + mWin + ": mDrawState=" + drawStateToString()); } Loading @@ -495,11 +496,13 @@ class WindowStateAnimator { if (DEBUG_SURFACE_TRACE || DEBUG_ANIM || SHOW_TRANSACTIONS || DEBUG_ORIENTATION) Slog.v(TAG, "finishDrawingLocked: mDrawState=COMMIT_DRAW_PENDING " + this + " in " + mSurfaceControl); if (DEBUG_STARTING_WINDOW && mWin.mAttrs.type == WindowManager.LayoutParams.TYPE_APPLICATION_STARTING) { if (DEBUG_STARTING_WINDOW && startingWindow) { Slog.v(TAG, "Draw state now committed in " + mWin); } mDrawState = COMMIT_DRAW_PENDING; if (startingWindow) { mService.notifyActivityDrawnForKeyguard(); } return true; } return false; Loading Loading
services/core/java/com/android/server/am/ActivityManagerService.java +21 −10 Original line number Diff line number Diff line Loading @@ -952,10 +952,13 @@ public final class ActivityManagerService extends ActivityManagerNative */ private boolean mWentToSleep = false; static final int LOCK_SCREEN_HIDDEN = 0; static final int LOCK_SCREEN_LEAVING = 1; static final int LOCK_SCREEN_SHOWN = 2; /** * State of external call telling us if the lock screen is shown. */ private boolean mLockScreenShown = false; int mLockScreenShown = LOCK_SCREEN_HIDDEN; /** * Set if we are shutting down the system, similar to sleeping. Loading Loading @@ -6118,9 +6121,8 @@ public final class ActivityManagerService extends ActivityManagerNative synchronized (this) { if (DEBUG_LOCKSCREEN) logLockScreen(""); mWindowManager.keyguardWaitingForActivityDrawn(); if (mLockScreenShown) { mLockScreenShown = false; comeOutOfSleepIfNeededLocked(); if (mLockScreenShown == LOCK_SCREEN_SHOWN) { mLockScreenShown = LOCK_SCREEN_LEAVING; } } } finally { Loading Loading @@ -9957,14 +9959,23 @@ public final class ActivityManagerService extends ActivityManagerNative Binder.restoreCallingIdentity(origId); } private String lockScreenShownToString() { switch (mLockScreenShown) { case LOCK_SCREEN_HIDDEN: return "LOCK_SCREEN_HIDDEN"; case LOCK_SCREEN_LEAVING: return "LOCK_SCREEN_LEAVING"; case LOCK_SCREEN_SHOWN: return "LOCK_SCREEN_SHOWN"; default: return "Unknown=" + mLockScreenShown; } } void logLockScreen(String msg) { if (DEBUG_LOCKSCREEN) Slog.d(TAG, Debug.getCallers(2) + ":" + msg + " mLockScreenShown=" + mLockScreenShown + " mWentToSleep=" + " mLockScreenShown=" + lockScreenShownToString() + " mWentToSleep=" + mWentToSleep + " mSleeping=" + mSleeping); } private void comeOutOfSleepIfNeededLocked() { if ((!mWentToSleep && !mLockScreenShown) || mRunningVoice) { void comeOutOfSleepIfNeededLocked() { if ((!mWentToSleep && mLockScreenShown == LOCK_SCREEN_HIDDEN) || mRunningVoice) { if (mSleeping) { mSleeping = false; mStackSupervisor.comeOutOfSleepIfNeededLocked(); Loading Loading @@ -10001,7 +10012,7 @@ public final class ActivityManagerService extends ActivityManagerNative long ident = Binder.clearCallingIdentity(); try { if (DEBUG_LOCKSCREEN) logLockScreen(" shown=" + shown); mLockScreenShown = shown; mLockScreenShown = shown ? LOCK_SCREEN_SHOWN : LOCK_SCREEN_HIDDEN; comeOutOfSleepIfNeededLocked(); } finally { Binder.restoreCallingIdentity(ident); Loading Loading @@ -12767,9 +12778,9 @@ public final class ActivityManagerService extends ActivityManagerNative } } if (dumpPackage == null) { if (mSleeping || mWentToSleep || mLockScreenShown) { if (mSleeping || mWentToSleep || mLockScreenShown != LOCK_SCREEN_HIDDEN) { pw.println(" mSleeping=" + mSleeping + " mWentToSleep=" + mWentToSleep + " mLockScreenShown " + mLockScreenShown); + " mLockScreenShown " + lockScreenShownToString()); } if (mShuttingDown || mRunningVoice) { pw.print(" mShuttingDown=" + mShuttingDown + " mRunningVoice=" + mRunningVoice);
services/core/java/com/android/server/am/ActivityStack.java +7 −6 Original line number Diff line number Diff line Loading @@ -241,9 +241,6 @@ final class ActivityStack { /** Run all ActivityStacks through this */ final ActivityStackSupervisor mStackSupervisor; /** Used to keep resumeTopActivityLocked() from being entered recursively */ private boolean inResumeTopActivity; static final int PAUSE_TIMEOUT_MSG = ActivityManagerService.FIRST_ACTIVITY_STACK_MSG + 1; static final int DESTROY_TIMEOUT_MSG = ActivityManagerService.FIRST_ACTIVITY_STACK_MSG + 2; static final int LAUNCH_TICK_MSG = ActivityManagerService.FIRST_ACTIVITY_STACK_MSG + 3; Loading Loading @@ -1468,7 +1465,7 @@ final class ActivityStack { } final boolean resumeTopActivityLocked(ActivityRecord prev, Bundle options) { if (inResumeTopActivity) { if (mStackSupervisor.inResumeTopActivity) { // Don't even start recursing. return false; } Loading @@ -1476,10 +1473,14 @@ final class ActivityStack { boolean result = false; try { // Protect against recursion. inResumeTopActivity = true; mStackSupervisor.inResumeTopActivity = true; if (mService.mLockScreenShown == ActivityManagerService.LOCK_SCREEN_LEAVING) { mService.mLockScreenShown = ActivityManagerService.LOCK_SCREEN_HIDDEN; mService.comeOutOfSleepIfNeededLocked(); } result = resumeTopActivityInnerLocked(prev, options); } finally { inResumeTopActivity = false; mStackSupervisor.inResumeTopActivity = false; } return result; } Loading
services/core/java/com/android/server/am/ActivityStackSupervisor.java +3 −0 Original line number Diff line number Diff line Loading @@ -274,6 +274,9 @@ public final class ActivityStackSupervisor implements DisplayListener { final ArrayList<PendingActivityLaunch> mPendingActivityLaunches = new ArrayList<PendingActivityLaunch>(); /** Used to keep resumeTopActivityLocked() from being entered recursively */ boolean inResumeTopActivity; /** * Description of a request to start a new activity, which has been held * due to app switches being disabled. Loading
services/core/java/com/android/server/wm/WindowAnimator.java +14 −12 Original line number Diff line number Diff line Loading @@ -272,6 +272,7 @@ public class WindowAnimator { if (winAnimator.mSurfaceControl != null) { final boolean wasAnimating = winAnimator.mWasAnimating; final boolean nowAnimating = winAnimator.stepAnimationLocked(mCurrentTime); mAnimating |= nowAnimating; if (WindowManagerService.DEBUG_WALLPAPER) { Slog.v(TAG, win + ": wasAnimating=" + wasAnimating + Loading Loading @@ -423,7 +424,8 @@ public class WindowAnimator { if (mKeyguardGoingAwayDisableWindowAnimations) { if (DEBUG_KEYGUARD) Slog.d(TAG, "updateWindowsLocked: skipping anim for windows"); } else { if (DEBUG_KEYGUARD) Slog.d(TAG, "updateWindowsLocked: created anim for windows"); if (DEBUG_KEYGUARD) Slog.d(TAG, "updateWindowsLocked: created anim for windows=" + unForceHiding); mPostKeyguardExitAnimation = mPolicy.createForceHideEnterAnimation( wallpaperInUnForceHiding, mKeyguardGoingAwayToNotificationShade); } Loading @@ -434,6 +436,17 @@ public class WindowAnimator { winAnimator.keyguardGoingAwayAnimation = true; } } // Wallpaper is going away in un-force-hide motion, animate it as well. if (!wallpaperInUnForceHiding && wallpaper != null && !mKeyguardGoingAwayDisableWindowAnimations) { if (DEBUG_KEYGUARD) Slog.d(TAG, "updateWindowsLocked: wallpaper animating away"); Animation a = mPolicy.createForceHideWallpaperExitAnimation( mKeyguardGoingAwayToNotificationShade); if (a != null) { wallpaper.mWinAnimator.setAnimation(a); } } } if (mPostKeyguardExitAnimation != null) { Loading @@ -448,17 +461,6 @@ public class WindowAnimator { mPostKeyguardExitAnimation = null; } } // Wallpaper is going away in un-force-hide motion, animate it as well. if (!wallpaperInUnForceHiding && wallpaper != null && !mKeyguardGoingAwayDisableWindowAnimations) { if (DEBUG_KEYGUARD) Slog.d(TAG, "updateWindowsLocked: wallpaper animating away"); Animation a = mPolicy.createForceHideWallpaperExitAnimation( mKeyguardGoingAwayToNotificationShade); if (a != null) { wallpaper.mWinAnimator.setAnimation(a); } } } private void updateWallpaperLocked(int displayId) { Loading
services/core/java/com/android/server/wm/WindowStateAnimator.java +7 −4 Original line number Diff line number Diff line Loading @@ -486,8 +486,9 @@ class WindowStateAnimator { } boolean finishDrawingLocked() { if (DEBUG_STARTING_WINDOW && mWin.mAttrs.type == WindowManager.LayoutParams.TYPE_APPLICATION_STARTING) { final boolean startingWindow = mWin.mAttrs.type == WindowManager.LayoutParams.TYPE_APPLICATION_STARTING; if (DEBUG_STARTING_WINDOW && startingWindow) { Slog.v(TAG, "Finishing drawing window " + mWin + ": mDrawState=" + drawStateToString()); } Loading @@ -495,11 +496,13 @@ class WindowStateAnimator { if (DEBUG_SURFACE_TRACE || DEBUG_ANIM || SHOW_TRANSACTIONS || DEBUG_ORIENTATION) Slog.v(TAG, "finishDrawingLocked: mDrawState=COMMIT_DRAW_PENDING " + this + " in " + mSurfaceControl); if (DEBUG_STARTING_WINDOW && mWin.mAttrs.type == WindowManager.LayoutParams.TYPE_APPLICATION_STARTING) { if (DEBUG_STARTING_WINDOW && startingWindow) { Slog.v(TAG, "Draw state now committed in " + mWin); } mDrawState = COMMIT_DRAW_PENDING; if (startingWindow) { mService.notifyActivityDrawnForKeyguard(); } return true; } return false; Loading