Separate 2-button mode check from ENABLE_OVERVIEW_ACTIONS

This will allow us to cleanly remove ENABLE_OVERVIEW_ACTIONS while still
keeping the shelf instead of actions in 2-button mode.

Bug: 143361609
Change-Id: I5cd43b6d3daeb527c7787b1cb81fae9179d8911c
This commit is contained in:
Tony Wickham committed 2020-02-06 15:06:59 -08:00
1 parent 61d639d756
commit 04fca1642c
10 files changed
+55 -49

No files matched your search

@@ -15,11 +15,6 @@
*/
package com.android.quickstep;
import static android.content.Context.MODE_PRIVATE;
import static com.android.launcher3.config.FeatureFlags.ENABLE_OVERVIEW_ACTIONS;
import static com.android.launcher3.config.FeatureFlags.FLAGS_PREF_NAME;
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.UserManager;
@@ -27,7 +22,6 @@ import android.util.Log;
import com.android.launcher3.BuildConfig;
import com.android.launcher3.MainProcessInitializer;
import com.android.launcher3.config.FeatureFlags;
import com.android.systemui.shared.system.ThreadedRendererCompat;
@SuppressWarnings("unused")
@@ -55,22 +49,7 @@ public class QuickstepProcessInitializer extends MainProcessInitializer {
super.init(context);
// Elevate GPU priority for Quickstep and Remote animations.
ThreadedRendererCompat.setContextPriority(ThreadedRendererCompat.EGL_CONTEXT_PRIORITY_HIGH_IMG);
// Force disable some feature flags based on the system ui navigation mode.
SysUINavigationMode.Mode currMode = SysUINavigationMode.INSTANCE.get(context)
.addModeChangeListener(mode -> disableFeatureFlagsForSysuiNavMode(context, mode));
disableFeatureFlagsForSysuiNavMode(context, currMode);
}
private void disableFeatureFlagsForSysuiNavMode(Context ctx, SysUINavigationMode.Mode mode) {
if (mode == SysUINavigationMode.Mode.TWO_BUTTONS) {
ctx.getSharedPreferences(FLAGS_PREF_NAME, MODE_PRIVATE)
.edit()
.putBoolean(ENABLE_OVERVIEW_ACTIONS.key, false)
.apply();
FeatureFlags.initialize(ctx);
}
ThreadedRendererCompat.setContextPriority(
ThreadedRendererCompat.EGL_CONTEXT_PRIORITY_HIGH_IMG);
}
}