Search code examples
android-source

How to hide status bar in AOSP build


I'd like to hide/remove the status bar (i.e the top bar containing clock, notifications,...) in my custom AOSP image.

Do you know if it's practically possible ? And how ?


Solution

  • The status bar layout is defined in frameworks/base/packages/SystemUI/res/layout/status_bar.xml:

    <com.android.systemui.statusbar.phone.PhoneStatusBarView
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui"
        android:layout_width="match_parent"
        android:layout_height="@dimen/status_bar_height"
        android:id="@+id/status_bar"
        android:background="@drawable/system_bar_background"
        android:orientation="vertical"
        android:focusable="false"
        android:descendantFocusability="afterDescendants"
        >
    
        <!-- […] -->
    
    </com.android.systemui.statusbar.phone.PhoneStatusBarView>
    

    You could try to set the height of com.android.systemui.statusbar.phone.PhoneStatusBarView to 0dp (defined by status_bar_height in frameworks/base/core/res/res/values/dimens.xml) or its visibility to gone.

    Here is a link to a guide on xda-developers that explains how to "hack" SystemUI.apk and framework-res.apk to hide the status bar: [GUIDE] Hide Status Bar and still being able to expand it on Jelly Bean. It may be useful to know which resources to modify.