Carry over app token when preserving window

Otherwise the token in the window's attr will be null after relaunch.
When this attr is updated with WindowManagerGlobal, setStoppedState()
will no longer find the view from the token.

bug: 24404382
Change-Id: Ib6935b03346a84dd023e224f72896041fda9dcd5
This commit is contained in:
Chong Zhang
2015-09-29 13:54:44 -07:00
parent f05de8f3b2
commit a8be1b99ec

View File

@@ -337,6 +337,10 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
mElevation = preservedWindow.getElevation();
mLoadEleveation = false;
mForceDecorInstall = true;
// If we're preserving window, carry over the app token from the preserved
// window, as we'll be skipping the addView in handleResumeActivity(), and
// the token will not be updated as for a new window.
getAttributes().token = preservedWindow.getAttributes().token;
}
}