1

I am working on message app there i want to disable the status bar it should be shown but not touchable.

i have tried below code: In Activity:

StatusBarManager mStatusBarManager = (StatusBarManager) getSystemService(Context.STATUS_BAR_SERVICE);

mStatusBarManager.disable(StatusBarManager.DISABLE_EXPAND);

In Manifest i have also added the permission :

But i am getting following error:

Caused by: java.lang.SecurityException: StatusBarManagerService: Neither user 10004 nor current process has android.permission.STATUS_BAR.

  • The docs for `android.permission.STATUS_BAR` say "Not for use by third-party applications." Presumably that means you have to be root. – Kevin Krumwiede Jan 22 '15 at 14:48
  • I am not using the third party application. I am customizing the default Android message app. and build as a system app – Shekhar Kumar Jan 23 '15 at 06:49
  • How are you building as a system app? The error suggests that you only think you're building as a system app. – Kevin Krumwiede Jan 23 '15 at 10:51
  • I am building the full source code and creating the system image and .fls file. using this command BUILD_FOR_KDUMP=yes make createfls -j32 and all the apk file stored inside the system/app and system/priv-app folder – Shekhar Kumar Jan 23 '15 at 13:37
  • Resolved! By adding android:sharedUserId="android.uid.system" in Manifest file and LOCAL_CERTIFICATE = platfform in Android.mk file. – Shekhar Kumar Jan 27 '15 at 15:02
  • You should put that in as an answer and accept your own answer. – Kevin Krumwiede Jan 27 '15 at 22:02
  • And maybe change the title to "how to build as a system app", since the problem and solution aren't specifically related to the status bar. – Kevin Krumwiede Jan 27 '15 at 22:04

1 Answers1

0

Resolved! By adding android:sharedUserId="android.uid.system" in Manifest file and LOCAL_CERTIFICATE = platform in Android.mk file

Michael Roland
  • 39,663
  • 10
  • 99
  • 206