1.首先屏蔽底部任务栏显示:
packages/apps/Launcher3/src/com/android/launcher3/config/FeatureFlags.java
diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java
old mode 100644
new mode 100755
index 2d31aa4..15eadff
--- a/src/com/android/launcher3/config/FeatureFlags.java
+++ b/src/com/android/launcher3/config/FeatureFlags.java
@@ -191,7 +191,7 @@ public final class FeatureFlags {
+ "predictions to be updated while they are visible to the user.");
public static final BooleanFlag ENABLE_TASKBAR = getDebugFlag(
- "ENABLE_TASKBAR", true, "Allows a system Taskbar to be shown on larger devices.");
+ "ENABLE_TASKBAR", false, "Allows a system Taskbar to be shown on larger devices.");
public static final BooleanFlag ENABLE_TASKBAR_EDU = getDebugFlag("ENABLE_TASKBAR_EDU", true,
"Enables showing taskbar education the first time an app is opened.");
frameworks/base/packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/Utilities.java
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/Utilities.java b/packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/Utilities.java
index 8d98a75..6650989 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/Utilities.java
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/Utilities.java
@@ -127,7 +127,7 @@ public class Utilities {
float smallestWidth = dpiFromPx(Math.min(bounds.width(), bounds.height()),
context.getResources().getConfiguration().densityDpi);
- return smallestWidth >= TABLET_MIN_DPS;
+ return false;
}
public static float dpiFromPx(float size, int densityDpi) {
2.frameworks/base下面打上下面补丁:
diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml
index 27ece4b8e..b4d7e56 100644
--- a/packages/SystemUI/AndroidManifest.xml
+++ b/packages/SystemUI/AndroidManifest.xml
@@ -295,6 +295,16 @@
<protected-broadcast android:name="com.android.settingslib.action.UNREGISTER_SLICE_RECEIVER" />
<protected-broadcast android:name="com.android.settings.flashlight.action.FLASHLIGHT_CHANGED" />
+ <protected-broadcast android:name="com.systemui.statusbar.show" />
+ <protected-broadcast android:name="com.systemui.statusbar.hide" />
+
+ <!-- For NavigationBar show or not -->
+ <protected-broadcast android:name="com.systemui.navigationbar.show" />
+ <protected-broadcast android:name="com.systemui.navigationbar.hide" />
+
+ <protected-broadcast android:name="android.intent.action_disable_statusbar" />
+ <protected-broadcast android:name="android.intent.action_enable_statusbar" />
+
<application
android:name=".SystemUIApplication"
android:persistent="true"
diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarController.java b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarController.java
index a984974..f1748c0 100644
--- a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarController.java
+++ b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarController.java
@@ -241,6 +241,13 @@ public class NavigationBarController implements
}
}
+ public void removeNavigationBars() {
+ Display[] displays = mDisplayManager.getDisplays();
+ for (Display display : displays) {
+ removeNavigationBar(display.getDisplayId());
+ }
+ }
+
/**
* Recreates the navigation bar for the given display.
*/
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
index a6fb317..a5c0b47 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
@@ -313,6 +313,13 @@ public class StatusBar extends SystemUI implements
public static final int[] CAMERA_LAUNCH_GESTURE_VIBRATION_AMPLITUDES =
new int[]{39, 82, 139, 213, 0, 127};
+ private static final String ACTION_HIDE_STATUS_BAR = "com.systemui.statusbar.hide";
+ private static final String ACTION_SHOW_STATUS_BAR = "com.systemui.statusbar.show";
+ private static final String ACTION_HIDE_NAVIGATION_BAR = "com.systemui.navigationbar.hide";
+ private static final String ACTION_SHOW_NAVIGATION_BAR = "com.systemui.navigationbar.show";
+ private static final String SYS_PROPERTY_STATUS_BAR = "persist.sys.statusbar.enable";
+ private static final String SYS_PROPERTY_NAVIGATION_BAR = "persist.sys.navigationbar.enable";
+
/**
* If true, the system is in the half-boot-to-decryption-screen state.
* Prudently disable QS and notifications.
@@ -967,6 +974,10 @@ public class StatusBar extends SystemUI implements
createAndAddWindows(result);
+ if (!SystemProperties.getBoolean(SYS_PROPERTY_STATUS_BAR, true)) {
+ mStatusBarWindowController.setBarVisibility(View.GONE);
+ }
+
if (mWallpaperSupported) {
// Make sure we always have the most current wallpaper info.
IntentFilter wallpaperChangedFilter = new IntentFilter(Intent.ACTION_WALLPAPER_CHANGED);
@@ -1178,7 +1189,9 @@ public class StatusBar extends SystemUI implements
mHeadsUpManager.addListener(mVisualStabilityManager);
mNotificationPanelViewController.setHeadsUpManager(mHeadsUpManager);
- createNavigationBar(result);
+ if (SystemProperties.getBoolean(SYS_PROPERTY_NAVIGATION_BAR, true)) {
+ createNavigationBar(result);
+ }
if (ENABLE_LOCKSCREEN_WALLPAPER && mWallpaperSupported) {
mLockscreenWallpaper = mLockscreenWallpaperLazy.get();
@@ -1406,6 +1419,10 @@ public class StatusBar extends SystemUI implements
filter.addAction(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
filter.addAction(Intent.ACTION_SCREEN_OFF);
filter.addAction(DevicePolicyManager.ACTION_SHOW_DEVICE_MONITORING_DIALOG);
+ filter.addAction(ACTION_HIDE_NAVIGATION_BAR);
+ filter.addAction(ACTION_SHOW_NAVIGATION_BAR);
+ filter.addAction(ACTION_HIDE_STATUS_BAR);
+ filter.addAction(ACTION_SHOW_STATUS_BAR);
mBroadcastDispatcher.registerReceiver(mBroadcastReceiver, filter, null, UserHandle.ALL);
}
@@ -2666,6 +2683,18 @@ public class StatusBar extends SystemUI implements
}
else if (DevicePolicyManager.ACTION_SHOW_DEVICE_MONITORING_DIALOG.equals(action)) {
mQSPanelController.showDeviceMonitoringDialog();
+ } else if (ACTION_HIDE_NAVIGATION_BAR.equals(action)) {
+ mNavigationBarController.removeNavigationBars();
+ SystemProperties.set(SYS_PROPERTY_NAVIGATION_BAR, "false");
+ } else if (ACTION_SHOW_NAVIGATION_BAR.equals(action)) {
+ createNavigationBar(null);
+ SystemProperties.set(SYS_PROPERTY_NAVIGATION_BAR, "true");
+ } else if (ACTION_HIDE_STATUS_BAR.equals(action)) {
+ mStatusBarWindowController.setBarVisibility(View.GONE);
+ SystemProperties.set(SYS_PROPERTY_STATUS_BAR, "false");
+ } else if (ACTION_SHOW_STATUS_BAR.equals(action)) {
+ mStatusBarWindowController.setBarVisibility(View.VISIBLE);
+ SystemProperties.set(SYS_PROPERTY_STATUS_BAR, "true");
}
Trace.endSection();
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowController.java b/packages/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowController.java
index 85a6cd2..8405964 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowController.java
@@ -315,4 +315,8 @@ public class StatusBarWindowController {
mLpChanged.privateFlags &= ~PRIVATE_FLAG_FORCE_SHOW_STATUS_BAR;
}
}
+
+ public void setBarVisibility(int visibility) {
+ mStatusBarWindowView.setVisibility(visibility);
+ }
}