Notification Block

I need my embedded Android tablet to be in kiosk mode, so the notification bar should be turned off (and not just hidden, for example, in full-screen games).

This code hides the panel only temporarily:

this.requestWindowFeature(Window.FEATURE_NO_TITLE);    // Removes title bar
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,                 
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.main); 

Same thing when I put this in the AndroidManifest app section:

android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

I tried disabling android-ui with adb command

pm disable com.android.systemui

But then I have no navigation buttons! All I need is for the notification bar to lock on top!

So how can I block the notification bar that it cannot open?

+3
source share
2 answers

I know this is not a general solution to this problem, but in my case I could do it.
I changed SystemUI.apk.

0dip .

, !

+2

, , , . , , Nav/Action .. Crude, , , .

, .. ,

hideNav() onCreate , showNav() onDestroy, , , , , .

, . getActivity(). Finish(), onDestroy .

. , 42, .

public void hideNav()
{
    Log.v(tag, "hideNav");
      try
      {
          Process p;
          p = Runtime.getRuntime().exec("su"); 

          // Attempt to write a file to a root-only
          DataOutputStream os = new DataOutputStream(p.getOutputStream());
          os.writeBytes("service call activity 42 s16 com.android.systemui\n");

          // Close the terminal
          os.writeBytes("exit\n");
          os.flush();
          p.waitFor();

      }
      catch (Exception e)
      {
          Log.e(tag, "hideNav " + e.getMessage());
      }

}

public void showNav()
{
    Log.v(tag, "showNav");

    try{
         Process p;
         p = Runtime.getRuntime().exec("su"); 

         DataOutputStream os = new DataOutputStream(p.getOutputStream());
         os.writeBytes("am startservice -n com.android.systemui/.SystemUIService\n");

         // Close the terminal
         os.writeBytes("exit\n");
         os.flush();
         p.waitFor();
    }catch (IOException e) {
        e.printStackTrace();
        Log.e(tag, "showNav " + e.getMessage());
    } catch (InterruptedException e) {
        Thread.currentThread().interrupt();
        Log.e(tag, "showNav " + e.getMessage());
    }
}
+2

All Articles