mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-28 15:56:49 +00:00
[DO NOT MERGE] Keeping Launcher in overview UI if activity is restarting am: 980c089d2f
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/13192821 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: Id2a3c6c21c3c00464fa0384d5f78943cbbbe8e97
This commit is contained in:
@@ -18,6 +18,7 @@ package com.android.launcher3;
|
||||
|
||||
import static android.content.pm.ActivityInfo.CONFIG_ORIENTATION;
|
||||
import static android.content.pm.ActivityInfo.CONFIG_SCREEN_SIZE;
|
||||
import static android.content.pm.ActivityInfo.CONFIG_UI_MODE;
|
||||
import static android.view.accessibility.AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED;
|
||||
|
||||
import static com.android.launcher3.AbstractFloatingView.TYPE_ALL;
|
||||
@@ -1103,7 +1104,11 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche
|
||||
int stateOrdinal = savedState.getInt(RUNTIME_STATE, NORMAL.ordinal);
|
||||
LauncherState[] stateValues = LauncherState.values();
|
||||
LauncherState state = stateValues[stateOrdinal];
|
||||
if (!state.shouldDisableRestore()) {
|
||||
|
||||
NonConfigInstance lastInstance = (NonConfigInstance) getLastNonConfigurationInstance();
|
||||
boolean forceRestore = lastInstance != null
|
||||
&& (lastInstance.config.diff(mOldConfig) & CONFIG_UI_MODE) != 0;
|
||||
if (forceRestore || !state.shouldDisableRestore()) {
|
||||
mStateManager.goToState(state, false /* animated */);
|
||||
}
|
||||
|
||||
@@ -1343,6 +1348,13 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche
|
||||
closeContextMenu();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object onRetainNonConfigurationInstance() {
|
||||
NonConfigInstance instance = new NonConfigInstance();
|
||||
instance.config = new Configuration(mOldConfig);
|
||||
return instance;
|
||||
}
|
||||
|
||||
public AllAppsTransitionController getAllAppsController() {
|
||||
return mAllAppsController;
|
||||
}
|
||||
@@ -2745,4 +2757,8 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche
|
||||
|
||||
void onLauncherResume();
|
||||
}
|
||||
|
||||
private static class NonConfigInstance {
|
||||
public Configuration config;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +121,9 @@ public abstract class StatefulActivity<STATE_TYPE extends BaseState<STATE_TYPE>>
|
||||
final int origDragLayerChildCount = dragLayer.getChildCount();
|
||||
super.onStop();
|
||||
|
||||
getStateManager().moveToRestState();
|
||||
if (!isChangingConfigurations()) {
|
||||
getStateManager().moveToRestState();
|
||||
}
|
||||
|
||||
// Workaround for b/78520668, explicitly trim memory once UI is hidden
|
||||
onTrimMemory(TRIM_MEMORY_UI_HIDDEN);
|
||||
|
||||
Reference in New Issue
Block a user