Loading services/core/java/com/android/server/am/ActivityStack.java +118 −114 Original line number Diff line number Diff line Loading @@ -2246,14 +2246,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai try { // Protect against recursion. mStackSupervisor.inResumeTopActivity = true; // The contained logic must be synchronized, since we are both changing the visibility // and updating the {@link Configuration}. {@link ActivityRecord#setVisibility} will // ultimately cause the client code to schedule a layout. Since layouts retrieve the // current {@link Configuration}, we must ensure that the below code updates it before // the layout can occur. synchronized (mWindowManager.getWindowManagerLock()) { result = resumeTopActivityInnerLocked(prev, options); } } finally { mStackSupervisor.inResumeTopActivity = false; } Loading Loading @@ -2564,6 +2557,12 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai || (lastStack.mLastPausedActivity != null && !lastStack.mLastPausedActivity.fullscreen)); // The contained logic must be synchronized, since we are both changing the visibility // and updating the {@link Configuration}. {@link ActivityRecord#setVisibility} will // ultimately cause the client code to schedule a layout. Since layouts retrieve the // current {@link Configuration}, we must ensure that the below code updates it before // the layout can occur. synchronized(mWindowManager.getWindowManagerLock()) { // This activity is now becoming visible. if (!next.visible || next.stopped || lastActivityTranslucent) { next.setVisibility(true); Loading @@ -2578,7 +2577,8 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai mService.updateCpuStats(); if (DEBUG_STATES) Slog.v(TAG_STATES, "Moving to RESUMED: " + next + " (in existing)"); if (DEBUG_STATES) Slog.v(TAG_STATES, "Moving to RESUMED: " + next + " (in existing)"); setResumedActivityLocked(next, "resumeTopActivityInnerLocked"); Loading @@ -2589,20 +2589,22 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai // Have the window manager re-evaluate the orientation of // the screen based on the new activity order. boolean notUpdated = true; if (mStackSupervisor.isFocusedStack(this)) { // We have special rotation behavior when Keyguard is locked. Make sure all activity // visibilities are set correctly as well as the transition is updated if needed to // get the correct rotation behavior. // TODO: Remove this once visibilities are set correctly immediately when starting // an activity. // We have special rotation behavior when Keyguard is locked. Make sure all // activity visibilities are set correctly as well as the transition is updated // if needed to get the correct rotation behavior. // TODO: Remove this once visibilities are set correctly immediately when // starting an activity. if (mStackSupervisor.mKeyguardController.isKeyguardLocked()) { mStackSupervisor.ensureActivitiesVisibleLocked(null /* starting */, 0 /* configChanges */, false /* preserveWindows */); } final Configuration config = mWindowManager.updateOrientationFromAppTokens( mStackSupervisor.getDisplayOverrideConfiguration(mDisplayId), next.mayFreezeScreenLocked(next.app) ? next.appToken : null, mDisplayId); next.mayFreezeScreenLocked(next.app) ? next.appToken : null, mDisplayId); if (config != null) { next.frozenBeforeDestroy = true; } Loading Loading @@ -2666,7 +2668,8 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai next.app.thread.scheduleResumeActivity(next.appToken, next.app.repProcState, mService.isNextTransitionForward(), resumeAnimOptions); if (DEBUG_STATES) Slog.d(TAG_STATES, "resumeTopActivityLocked: Resumed " + next); if (DEBUG_STATES) Slog.d(TAG_STATES, "resumeTopActivityLocked: Resumed " + next); } catch (Exception e) { // Whoops, need to restart this activity! if (DEBUG_STATES) Slog.v(TAG_STATES, "Resume failed; resetting state to " Loading @@ -2687,6 +2690,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai if (DEBUG_STACK) mStackSupervisor.validateTopActivitiesLocked(); return true; } } // From this point on, if something goes wrong there is no way // to recover the activity. Loading Loading
services/core/java/com/android/server/am/ActivityStack.java +118 −114 Original line number Diff line number Diff line Loading @@ -2246,14 +2246,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai try { // Protect against recursion. mStackSupervisor.inResumeTopActivity = true; // The contained logic must be synchronized, since we are both changing the visibility // and updating the {@link Configuration}. {@link ActivityRecord#setVisibility} will // ultimately cause the client code to schedule a layout. Since layouts retrieve the // current {@link Configuration}, we must ensure that the below code updates it before // the layout can occur. synchronized (mWindowManager.getWindowManagerLock()) { result = resumeTopActivityInnerLocked(prev, options); } } finally { mStackSupervisor.inResumeTopActivity = false; } Loading Loading @@ -2564,6 +2557,12 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai || (lastStack.mLastPausedActivity != null && !lastStack.mLastPausedActivity.fullscreen)); // The contained logic must be synchronized, since we are both changing the visibility // and updating the {@link Configuration}. {@link ActivityRecord#setVisibility} will // ultimately cause the client code to schedule a layout. Since layouts retrieve the // current {@link Configuration}, we must ensure that the below code updates it before // the layout can occur. synchronized(mWindowManager.getWindowManagerLock()) { // This activity is now becoming visible. if (!next.visible || next.stopped || lastActivityTranslucent) { next.setVisibility(true); Loading @@ -2578,7 +2577,8 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai mService.updateCpuStats(); if (DEBUG_STATES) Slog.v(TAG_STATES, "Moving to RESUMED: " + next + " (in existing)"); if (DEBUG_STATES) Slog.v(TAG_STATES, "Moving to RESUMED: " + next + " (in existing)"); setResumedActivityLocked(next, "resumeTopActivityInnerLocked"); Loading @@ -2589,20 +2589,22 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai // Have the window manager re-evaluate the orientation of // the screen based on the new activity order. boolean notUpdated = true; if (mStackSupervisor.isFocusedStack(this)) { // We have special rotation behavior when Keyguard is locked. Make sure all activity // visibilities are set correctly as well as the transition is updated if needed to // get the correct rotation behavior. // TODO: Remove this once visibilities are set correctly immediately when starting // an activity. // We have special rotation behavior when Keyguard is locked. Make sure all // activity visibilities are set correctly as well as the transition is updated // if needed to get the correct rotation behavior. // TODO: Remove this once visibilities are set correctly immediately when // starting an activity. if (mStackSupervisor.mKeyguardController.isKeyguardLocked()) { mStackSupervisor.ensureActivitiesVisibleLocked(null /* starting */, 0 /* configChanges */, false /* preserveWindows */); } final Configuration config = mWindowManager.updateOrientationFromAppTokens( mStackSupervisor.getDisplayOverrideConfiguration(mDisplayId), next.mayFreezeScreenLocked(next.app) ? next.appToken : null, mDisplayId); next.mayFreezeScreenLocked(next.app) ? next.appToken : null, mDisplayId); if (config != null) { next.frozenBeforeDestroy = true; } Loading Loading @@ -2666,7 +2668,8 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai next.app.thread.scheduleResumeActivity(next.appToken, next.app.repProcState, mService.isNextTransitionForward(), resumeAnimOptions); if (DEBUG_STATES) Slog.d(TAG_STATES, "resumeTopActivityLocked: Resumed " + next); if (DEBUG_STATES) Slog.d(TAG_STATES, "resumeTopActivityLocked: Resumed " + next); } catch (Exception e) { // Whoops, need to restart this activity! if (DEBUG_STATES) Slog.v(TAG_STATES, "Resume failed; resetting state to " Loading @@ -2687,6 +2690,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai if (DEBUG_STACK) mStackSupervisor.validateTopActivitiesLocked(); return true; } } // From this point on, if something goes wrong there is no way // to recover the activity. Loading