Merge "Add flag to hide nav bar window in favor of taskbar." into tm-qpr-dev
This commit is contained in:
@@ -196,6 +196,10 @@ public class Flags {
|
||||
new DeviceConfigBooleanFlag(1102, "record_task_content",
|
||||
NAMESPACE_WINDOW_MANAGER, false, true);
|
||||
|
||||
@Keep
|
||||
public static final SysPropBooleanFlag HIDE_NAVBAR_WINDOW =
|
||||
new SysPropBooleanFlag(1103, "persist.wm.debug.hide_navbar_window", false);
|
||||
|
||||
// 1200 - predictive back
|
||||
@Keep
|
||||
public static final SysPropBooleanFlag WM_ENABLE_PREDICTIVE_BACK = new SysPropBooleanFlag(
|
||||
|
||||
@@ -51,6 +51,8 @@ import com.android.systemui.Dumpable;
|
||||
import com.android.systemui.dagger.SysUISingleton;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.dump.DumpManager;
|
||||
import com.android.systemui.flags.FeatureFlags;
|
||||
import com.android.systemui.flags.Flags;
|
||||
import com.android.systemui.model.SysUiState;
|
||||
import com.android.systemui.recents.OverviewProxyService;
|
||||
import com.android.systemui.shared.system.QuickStepContract;
|
||||
@@ -82,6 +84,7 @@ public class NavigationBarController implements
|
||||
private final Context mContext;
|
||||
private final Handler mHandler;
|
||||
private final NavigationBarComponent.Factory mNavigationBarComponentFactory;
|
||||
private FeatureFlags mFeatureFlags;
|
||||
private final DisplayManager mDisplayManager;
|
||||
private final TaskbarDelegate mTaskbarDelegate;
|
||||
private final StatusBarKeyguardViewManager mStatusBarKeyguardViewManager;
|
||||
@@ -113,10 +116,12 @@ public class NavigationBarController implements
|
||||
AutoHideController autoHideController,
|
||||
LightBarController lightBarController,
|
||||
Optional<Pip> pipOptional,
|
||||
Optional<BackAnimation> backAnimation) {
|
||||
Optional<BackAnimation> backAnimation,
|
||||
FeatureFlags featureFlags) {
|
||||
mContext = context;
|
||||
mHandler = mainHandler;
|
||||
mNavigationBarComponentFactory = navigationBarComponentFactory;
|
||||
mFeatureFlags = featureFlags;
|
||||
mDisplayManager = mContext.getSystemService(DisplayManager.class);
|
||||
commandQueue.addCallback(this);
|
||||
configurationController.addCallback(this);
|
||||
@@ -217,7 +222,10 @@ public class NavigationBarController implements
|
||||
|
||||
/** @return {@code true} if taskbar is enabled, false otherwise */
|
||||
private boolean initializeTaskbarIfNecessary() {
|
||||
if (mIsTablet) {
|
||||
// Enable for tablet or (phone AND flag is set); assuming phone = !mIsTablet
|
||||
boolean taskbarEnabled = mIsTablet || mFeatureFlags.isEnabled(Flags.HIDE_NAVBAR_WINDOW);
|
||||
|
||||
if (taskbarEnabled) {
|
||||
Trace.beginSection("NavigationBarController#initializeTaskbarIfNecessary");
|
||||
// Remove navigation bar when taskbar is showing
|
||||
removeNavigationBar(mContext.getDisplayId());
|
||||
@@ -226,7 +234,7 @@ public class NavigationBarController implements
|
||||
} else {
|
||||
mTaskbarDelegate.destroy();
|
||||
}
|
||||
return mIsTablet;
|
||||
return taskbarEnabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -294,6 +302,10 @@ public class NavigationBarController implements
|
||||
*/
|
||||
@VisibleForTesting
|
||||
void createNavigationBar(Display display, Bundle savedState, RegisterStatusBarResult result) {
|
||||
if (initializeTaskbarIfNecessary()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (display == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ import androidx.test.filters.SmallTest;
|
||||
import com.android.systemui.Dependency;
|
||||
import com.android.systemui.SysuiTestCase;
|
||||
import com.android.systemui.dump.DumpManager;
|
||||
import com.android.systemui.flags.FeatureFlags;
|
||||
import com.android.systemui.model.SysUiState;
|
||||
import com.android.systemui.recents.OverviewProxyService;
|
||||
import com.android.systemui.statusbar.CommandQueue;
|
||||
@@ -96,7 +97,8 @@ public class NavigationBarControllerTest extends SysuiTestCase {
|
||||
mock(AutoHideController.class),
|
||||
mock(LightBarController.class),
|
||||
Optional.of(mock(Pip.class)),
|
||||
Optional.of(mock(BackAnimation.class))));
|
||||
Optional.of(mock(BackAnimation.class)),
|
||||
mock(FeatureFlags.class)));
|
||||
initializeNavigationBars();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user