Have QS fragment keep track of some state on recreate
Test: runtest systemui
Change-Id: I1cf84a0943092fcfc5428fcfccb4a887a83b294b
Fixes: 35205198
Fixes: 36592148
(cherry picked from commit 78187249c3)
This commit is contained in:
@@ -133,14 +133,7 @@ public abstract class BaseFragmentTest {
|
||||
public void testRecreate() {
|
||||
mFragments.dispatchResume();
|
||||
processAllMessages();
|
||||
mFragments.dispatchPause();
|
||||
Parcelable p = mFragments.saveAllState();
|
||||
mFragments.dispatchDestroy();
|
||||
|
||||
mFragments = FragmentController.createController(new HostCallbacks());
|
||||
mFragments.attachHost(null);
|
||||
mFragments.restoreAllState(p, (FragmentManagerNonConfig) null);
|
||||
mFragments.dispatchResume();
|
||||
recreateFragment();
|
||||
processAllMessages();
|
||||
}
|
||||
|
||||
@@ -154,6 +147,18 @@ public abstract class BaseFragmentTest {
|
||||
processAllMessages();
|
||||
}
|
||||
|
||||
protected void recreateFragment() {
|
||||
mFragments.dispatchPause();
|
||||
Parcelable p = mFragments.saveAllState();
|
||||
mFragments.dispatchDestroy();
|
||||
|
||||
mFragments = FragmentController.createController(new HostCallbacks());
|
||||
mFragments.attachHost(null);
|
||||
mFragments.restoreAllState(p, (FragmentManagerNonConfig) null);
|
||||
mFragments.dispatchResume();
|
||||
mFragment = mFragments.getFragmentManager().findFragmentById(VIEW_ID);
|
||||
}
|
||||
|
||||
protected void attachFragmentToWindow() {
|
||||
ViewUtils.attachView(mView);
|
||||
TestableLooper.get(this).processMessages(1);
|
||||
|
||||
Reference in New Issue
Block a user