java - Cannot Unhide Android System Bar after Hiding -
i have rooted nexus 10 on 4.3, , hiding system bar following code works fine:
process proc = runtime.getruntime().exec(new string[]{"su","-c","service call activity "+ procid +" s16 com.android.systemui"}); //was 79 proc.waitfor();
but when try unhide following code, never unhides:
process proc = runtime.getruntime().exec(new string[]{"am","startservice","-n","com.android.systemui/.systemuiservice"}); proc.waitfor();
if issue "am" command adb shell, works advertised (system bar reappears). there try/catch around root calls , there no exception. completion code of "1" out of "am".
the hide , show in 2 different activities within same app, though don't see why matter.
for interested, kiosk app bar needs go away while running, reappear when app exited hidden menu.
thanks!
after lot of searching on internet, managed system bar hide , appear in 4.2 device using:
to hide:
runtime.getruntime().exec("service call activity 42 s16 com.android.systemui");
or use 79 instead of 42 api less 14. may need include set_debug_app permission, in case need have application signed system key or installed in /system/app/ directory.
to show:
runtime.getruntime().exec("am startservice --user 0 -n com.android.systemui/.systemuiservice");
alternatively people have used -a (instead of -n) option, though causing error on device:
error: not found; no service started.
Comments
Post a Comment