Android Hide Status bar and Navigation Bars
Android Configuration Method
Note
In the Android 13 environment, all RK series boards support the following modification methods, while among AllWinner series boards, only T527 and A733 series boards support them.
Command Line Modification
Hide status bar via command line:
Show status bar via command line:
Hide navigation bar via command line:
Show navigation bar via command line:
APP Modification
Obtain the Status Bar and Navigation Bar Test APP from the network storage.
SDK Source Code Modification
Hide Status Bar by Default
Modification to hide the status bar by default in Android 13:
--- a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
+++ b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
@@ -952,6 +952,8 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
mRegisterStatusBarResult = result;
createAndAddWindows(result);
+ hideStatusBar();
if (mWallpaperSupported) {
// Make sure we always have the most current wallpaper info.
Modification to disable status bar pull-down by default in Android 13:
--- a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
+++ b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
@@ -536,10 +536,12 @@ public class CommandQueue extends IStatusBar.Stub implements
// TODO(b/118592525): add multi-display support if needed.
public boolean panelsEnabled() {
- final int disabled1 = getDisabled1(mDisplayTracker.getDefaultDisplayId());
- final int disabled2 = getDisabled2(mDisplayTracker.getDefaultDisplayId());
- return (disabled1 & StatusBarManager.DISABLE_EXPAND) == 0
- && (disabled2 & StatusBarManager.DISABLE2_NOTIFICATION_SHADE) == 0;
+ return false;
+ // final int disabled1 = getDisabled1(mDisplayTracker.getDefaultDisplayId());
+ // final int disabled2 = getDisabled2(mDisplayTracker.getDefaultDisplayId());
+ // return (disabled1 & StatusBarManager.DISABLE_EXPAND) == 0
+ // && (disabled2 & StatusBarManager.DISABLE2_NOTIFICATION_SHADE) == 0;
+
}
Hide Navigation Bar by Default
Modification to hide the navigation bar by default in Android 13:
--- a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
+++ b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
@@ -952,6 +952,8 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
mRegisterStatusBarResult = result;
createAndAddWindows(result);
+ hideNavigation();
if (mWallpaperSupported) {
// Make sure we always have the most current wallpaper info.
Use Gesture Navigation by Default
Modification to use gesture navigation by default in Android 13:
--- a/device/rockchip/rk356x/overlay/frameworks/base/core/res/res/values/config.xml
+++ b/device/rockchip/rk356x/overlay/frameworks/base/core/res/res/values/config.xml
@@ -61,7 +61,7 @@
0: 3 button mode (back, home, overview buttons)
1: 2 button mode (back, home buttons + swipe up for overview)
2: gestures only for back, home and overview -->
- <integer name="config_navBarInteractionMode">0</integer>
+ <integer name="config_navBarInteractionMode">2</integer>
<bool name="config_swipe_up_gesture_setting_available">true</bool>
</resources>
#### The status bar/navigation bar is hidden by default on the A733 series board.
On K10B, the default hidden state at boot is implemented by modifying the default values in `SettingsProvider` via overlay.
```diff
--- a/device/softwinner/jupiter/a733-demo-aiot/overlay/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
+++ b/device/softwinner/jupiter/a733-demo-aiot/overlay/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
@@ -40,3 +40,6 @@
<!-- Do not launch provision app -->
<bool name="def_device_provisioned">true</bool>
<bool name="def_user_setup_complete">true</bool>
+
+ <bool name="def_navigation_bar_enabled">false</bool>
+ <bool name="def_status_bar_enabled">false</bool>
</resources>
AllWinner Configuration Method
A133 Command Line Modification
Modify via setting system properties:
A733 Command Line Modification
Control the visibility of the status bar and navigation bar via global settings,The change takes effect immediately without the need for a reboot: