mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-28 15:56:49 +00:00
Defer recreation until resumed am: 3f8d868110
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12309024 Change-Id: I814a6cab9046b82d66426fbe19636087cfd3e2b6
This commit is contained in:
@@ -42,6 +42,7 @@ import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.android.launcher3.Launcher.OnResumeCallback;
|
||||
import com.android.launcher3.LauncherSettings.Favorites;
|
||||
import com.android.launcher3.logging.InstanceId;
|
||||
import com.android.launcher3.logging.InstanceIdSequence;
|
||||
@@ -107,10 +108,20 @@ public abstract class BaseDraggingActivity extends BaseActivity
|
||||
|
||||
private void updateTheme() {
|
||||
if (mThemeRes != Themes.getActivityThemeRes(this)) {
|
||||
recreate();
|
||||
// Workaround (b/162812884): The system currently doesn't allow recreating an activity
|
||||
// when it is not resumed, in such a case defer recreation until it is possible
|
||||
if (hasBeenResumed()) {
|
||||
recreate();
|
||||
} else {
|
||||
addOnResumeCallback(this::recreate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void addOnResumeCallback(OnResumeCallback callback) {
|
||||
// To be overridden
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActionModeStarted(ActionMode mode) {
|
||||
super.onActionModeStarted(mode);
|
||||
|
||||
Reference in New Issue
Block a user