Loading src/com/android/documentsui/BaseActivity.java +8 −8 Original line number Diff line number Diff line Loading @@ -129,7 +129,7 @@ public abstract class BaseActivity @CallSuper @Override public void onCreate(Bundle icicle) { public void onCreate(Bundle savedInstanceState) { // Record the time when onCreate is invoked for metric. mStartTime = new Date().getTime(); Loading @@ -138,7 +138,7 @@ public abstract class BaseActivity // in case Activity continueusly encounter resource not found exception getTheme().applyStyle(R.style.DocumentsDefaultTheme, false); super.onCreate(icicle); super.onCreate(savedInstanceState); final Intent intent = getIntent(); Loading @@ -149,7 +149,7 @@ public abstract class BaseActivity setContainer(); mInjector = getInjector(); mState = getState(icicle); mState = getState(savedInstanceState); mDrawer = DrawerController.create(this, mInjector.config); Metrics.logActivityLaunch(mState, intent); Loading Loading @@ -262,14 +262,14 @@ public abstract class BaseActivity ViewGroup chipGroup = findViewById(R.id.search_chip_group); mUserIdManager = DocumentsApplication.getUserIdManager(this); mSearchManager = new SearchViewManager(searchListener, queryInterceptor, chipGroup, icicle); chipGroup, savedInstanceState); // initialize the chip sets by accept mime types mSearchManager.initChipSets(mState.acceptMimes); // update the chip items by the mime types of the root mSearchManager.updateChips(getCurrentRoot().derivedMimeTypes); // parse the query content from intent when launch the // activity at the first time if (icicle == null) { if (savedInstanceState == null) { mHasQueryContentFromIntent = mSearchManager.parseQueryContentFromIntent(getIntent(), mState.action); } Loading Loading @@ -399,9 +399,9 @@ public abstract class BaseActivity super.onDestroy(); } private State getState(@Nullable Bundle icicle) { if (icicle != null) { State state = icicle.<State>getParcelable(Shared.EXTRA_STATE); private State getState(@Nullable Bundle savedInstanceState) { if (savedInstanceState != null) { State state = savedInstanceState.<State>getParcelable(Shared.EXTRA_STATE); if (DEBUG) { Log.d(mTag, "Recovered existing state object: " + state); } Loading src/com/android/documentsui/queries/SearchViewManager.java +5 −2 Original line number Diff line number Diff line Loading @@ -119,8 +119,7 @@ public class SearchViewManager implements mChipViewManager.setSearchChipViewManagerListener(this::onChipCheckedStateChanged); if (savedState != null) { String savedQuery = savedState.getString(Shared.EXTRA_QUERY); mCurrentSearch = savedQuery != null ? savedQuery : ""; mCurrentSearch = savedState.getString(Shared.EXTRA_QUERY); mChipViewManager.restoreCheckedChipItems(savedState); } else { mCurrentSearch = null; Loading Loading @@ -416,6 +415,10 @@ public class SearchViewManager implements * @param state Bundle to save state too */ public void onSaveInstanceState(Bundle state) { if (mSearchView.hasFocus() && mCurrentSearch == null) { // Restore focus even if no text was input before screen rotation. mCurrentSearch = ""; } state.putString(Shared.EXTRA_QUERY, mCurrentSearch); mChipViewManager.onSaveInstanceState(state); } Loading Loading
src/com/android/documentsui/BaseActivity.java +8 −8 Original line number Diff line number Diff line Loading @@ -129,7 +129,7 @@ public abstract class BaseActivity @CallSuper @Override public void onCreate(Bundle icicle) { public void onCreate(Bundle savedInstanceState) { // Record the time when onCreate is invoked for metric. mStartTime = new Date().getTime(); Loading @@ -138,7 +138,7 @@ public abstract class BaseActivity // in case Activity continueusly encounter resource not found exception getTheme().applyStyle(R.style.DocumentsDefaultTheme, false); super.onCreate(icicle); super.onCreate(savedInstanceState); final Intent intent = getIntent(); Loading @@ -149,7 +149,7 @@ public abstract class BaseActivity setContainer(); mInjector = getInjector(); mState = getState(icicle); mState = getState(savedInstanceState); mDrawer = DrawerController.create(this, mInjector.config); Metrics.logActivityLaunch(mState, intent); Loading Loading @@ -262,14 +262,14 @@ public abstract class BaseActivity ViewGroup chipGroup = findViewById(R.id.search_chip_group); mUserIdManager = DocumentsApplication.getUserIdManager(this); mSearchManager = new SearchViewManager(searchListener, queryInterceptor, chipGroup, icicle); chipGroup, savedInstanceState); // initialize the chip sets by accept mime types mSearchManager.initChipSets(mState.acceptMimes); // update the chip items by the mime types of the root mSearchManager.updateChips(getCurrentRoot().derivedMimeTypes); // parse the query content from intent when launch the // activity at the first time if (icicle == null) { if (savedInstanceState == null) { mHasQueryContentFromIntent = mSearchManager.parseQueryContentFromIntent(getIntent(), mState.action); } Loading Loading @@ -399,9 +399,9 @@ public abstract class BaseActivity super.onDestroy(); } private State getState(@Nullable Bundle icicle) { if (icicle != null) { State state = icicle.<State>getParcelable(Shared.EXTRA_STATE); private State getState(@Nullable Bundle savedInstanceState) { if (savedInstanceState != null) { State state = savedInstanceState.<State>getParcelable(Shared.EXTRA_STATE); if (DEBUG) { Log.d(mTag, "Recovered existing state object: " + state); } Loading
src/com/android/documentsui/queries/SearchViewManager.java +5 −2 Original line number Diff line number Diff line Loading @@ -119,8 +119,7 @@ public class SearchViewManager implements mChipViewManager.setSearchChipViewManagerListener(this::onChipCheckedStateChanged); if (savedState != null) { String savedQuery = savedState.getString(Shared.EXTRA_QUERY); mCurrentSearch = savedQuery != null ? savedQuery : ""; mCurrentSearch = savedState.getString(Shared.EXTRA_QUERY); mChipViewManager.restoreCheckedChipItems(savedState); } else { mCurrentSearch = null; Loading Loading @@ -416,6 +415,10 @@ public class SearchViewManager implements * @param state Bundle to save state too */ public void onSaveInstanceState(Bundle state) { if (mSearchView.hasFocus() && mCurrentSearch == null) { // Restore focus even if no text was input before screen rotation. mCurrentSearch = ""; } state.putString(Shared.EXTRA_QUERY, mCurrentSearch); mChipViewManager.onSaveInstanceState(state); } Loading