Merge "Do not stop window if preserving the window" into nyc-dev

This commit is contained in:
Chong Zhang
2016-02-26 20:52:15 +00:00
committed by Android (Google) Code Review
2 changed files with 9 additions and 8 deletions

View File

@@ -6628,9 +6628,7 @@ public class Activity extends ContextThemeWrapper
mFragments.noteStateNotSaved();
if (mToken != null && mParent == null) {
// We might have view roots that were preserved during a relaunch, we need to start them
// again. We don't need to check mStopped, the roots will check if they were actually
// stopped.
// No need to check mStopped, the roots will check if they were actually stopped.
WindowManagerGlobal.getInstance().setStoppedState(mToken, false /* stopped */);
}
@@ -6728,7 +6726,7 @@ public class Activity extends ContextThemeWrapper
onUserLeaveHint();
}
final void performStop() {
final void performStop(boolean preserveWindow) {
mDoReportFullyDrawn = false;
mFragments.doLoaderStop(mChangingConfigurations /*retain*/);
@@ -6737,7 +6735,10 @@ public class Activity extends ContextThemeWrapper
mWindow.closeAllPanels();
}
if (mToken != null && mParent == null) {
// If we're preserving the window, don't setStoppedState to true, since we
// need the window started immediately again. Stopping the window will
// destroys hardware resources and causes flicker.
if (!preserveWindow && mToken != null && mParent == null) {
WindowManagerGlobal.getInstance().setStoppedState(mToken, true);
}

View File

@@ -3747,7 +3747,7 @@ public final class ActivityThread {
if (!keepShown) {
try {
// Now we are idle.
r.activity.performStop();
r.activity.performStop(false /*preserveWindow*/);
} catch (Exception e) {
if (!mInstrumentation.onException(r.activity, e)) {
throw new RuntimeException(
@@ -3888,7 +3888,7 @@ public final class ActivityThread {
if (!r.stopped && !r.isPreHoneycomb()) {
try {
// Now we are idle.
r.activity.performStop();
r.activity.performStop(false /*preserveWindow*/);
} catch (Exception e) {
if (!mInstrumentation.onException(r.activity, e)) {
throw new RuntimeException(
@@ -4058,7 +4058,7 @@ public final class ActivityThread {
}
if (!r.stopped) {
try {
r.activity.performStop();
r.activity.performStop(r.mPreserveWindow);
} catch (SuperNotCalledException e) {
throw e;
} catch (Exception e) {