Skip to content

Navigation Bar and Status Bar Configuration

This chapter describes how to hide or show the navigation bar and status bar in the Android system.

Command Line

Temporarily hide or show the status bar and navigation bar via ADB commands. The changes take effect immediately but revert to the default state after a reboot.

Rockchip Series / T527

# Hide status bar
adb shell am broadcast -a android.intent.action.HIDE_STATUSBAR_BAR

# Show status bar
adb shell am broadcast -a android.intent.action.SHOW_STATUSBAR_BAR

# Hide navigation bar
adb shell am broadcast -a android.intent.action.HIDE_NAVIGATION_BAR

# Show navigation bar
adb shell am broadcast -a android.intent.action.SHOW_NAVIGATION_BAR

A133

Via system properties. The changes take effect after a reboot:

adb shell setprop persist.sys.ban_sb true
adb shell setprop persist.sys.ban_nb true
adb reboot

A733

Via global settings. The changes take effect immediately without reboot:

# Hide status bar
adb shell settings put global status_bar_enabled 0

# Show status bar
adb shell settings put global status_bar_enabled 1

# Hide navigation bar
adb shell settings put global navigation_bar_enabled 0

# Show navigation bar
adb shell settings put global navigation_bar_enabled 1

App Sample

Download the Status Bar and Navigation Bar test app sample from the cloud storage.

SDK Source Code Modification

Modify the SystemUI source code to hide or disable the status bar and navigation bar by default.

Hide Status Bar by Default

Modify CentralSurfacesImpl.java and call the hideStatusBar() method:

--- 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.

Disable Status Bar Pull-down by Default

Modify CommandQueue.java so that the panelsEnabled() method returns false:

--- 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

Modify CentralSurfacesImpl.java and call the hideNavigation() method:

--- 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.

Overlay Configuration

Modify the overlay configuration files to set the default state at boot.

Default Gesture Navigation

On RK platforms, modify config_navBarInteractionMode in config.xml to enable gesture navigation:

--- 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>

Default Hide Status Bar / Navigation Bar

For A733 / T527, modify the overlay configuration file of SettingsProvider to hide the status bar and navigation bar by default at boot:

--- a/.../SettingsProvider/res/values/defaults.xml
+++ b/.../SettingsProvider/res/values/defaults.xml
+
+    <bool name="def_navigation_bar_enabled">false</bool>
+    <bool name="def_status_bar_enabled">false</bool>
Model Overlay Path
K9 device/softwinner/saturn/t527-demo/overlay/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
K10B device/softwinner/jupiter/a733-demo-aiot/overlay/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml