1

I need to disable the quick settings and notifications bar on an Android Lollipop rooted device. The only way I've been able to do it is disabling the SystemUI app using the following command pm disable com.android.systemui. Is there any other way to do it that doesn't require installing any apps like Xposed? Maybe modifying .prop files or editing settings on .db?

I have a system app so maybe I can use that? Anyone knows how does Xposed-Gravity do it?

Storo
  • 988
  • 1
  • 7
  • 31

1 Answers1

1

I managed to do this creating a system app. Next are the steps.

  1. Add the android.permission.STATUS_BAR permission to the manifest.
  2. On a BroadcastReceiver listening for android.intent.action.BOOT_COMPLETED, do the following:

    public class BootReceiver extends BroadcastReceiver {
    
        @Override
        public void onReceive(Context context, Intent intent) {
            StatusBarManager statusBarManager = (StatusBarManager) context.getSystemService("statusbar");
            statusBarManager.disable(StatusBarManager.DISABLE_EXPAND);
        }
    
    }
    

For a couple of seconds the status bar will be usable but after the BOOT_COMPLETED broadcast is launch, it will be disables. If you don't want this to happen your app should be a launcher type of application and use this code as soon as the launcher is displayed.

Extra: you can also use the following to disable the soft keys:

            StatusBarManager statusBarManager = (StatusBarManager) context.getSystemService("statusbar");
            int state = StatusBarManager.DISABLE_EXPAND | StatusBarManager.DISABLE_RECENT | StatusBarManager.DISABLE_HOME | StatusBarManager.DISABLE_BACK;
            statusBarManager.disable(state);
Storo
  • 988
  • 1
  • 7
  • 31