问题描述
我正在创建一个全屏应用程序,它将以信息亭模式运行,因此用户将无法退出。该应用程序被定义为启动器(主屏幕)。
清单中的 $ b $ b $ b
请注意,这是针对无法植根的专用工业设备(霍尼韦尔海豚75e)。
是的,因为 com.android.systemui 程序包正在运行,它负责状态栏和软件导航栏。以下是禁用程序包的几种解决方案。 注意 为了使用解决方案,需要扩展权限(理想情况下为 root )。
重新启动持久解决方案
重命名 apk 的$ c>扩展名或完全删除文件。您必须重新挂载 / system 分区,因为默认情况下它是只读的。重命名/删除系统后,可能会卸载 /data/data/com.android.systemui 软件包。如果不是,请手动执行,然后重新启动。
重新启动非永久性解决方案
在以下位置禁用/启用框架服务调用(至少在 KitKat之前有效的 之前有效)的运行时(例如在应用程序启动时):
服务呼叫活动42 s16 com.android.systemui //禁用状态栏
和
am startservice -n com.android.systemui / .SystemUIService //启用状态栏
请注意,解决方案在重新启动后并不持久。
I am creating a fullscreen app which will run in "kiosk" mode, so the user will not be able to exit. The app is defined as a launcher (home screen).
The Activity in the manifest is defined with:
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
Additionally, the Activity ensures full screen mode with the following in its onCreate():
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN); getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
However, it seems that the status bar is still accessible. It's hidden by default, but it can still be shown by touching and pulling down the top of the screen (where it shows with a translucent background instead of the usual solid black).
I already know I can prevent this by adding a transparent 10px system overlay window at the top of the screen which will absorb the touch events. But I removed this hack because I didn't think it was necessary.
I am sure this was all working fine and prevented the status bar from showing without resorting to the hackery. But something has changed somewhere. I have updated to the latest stock firmware and system software - perhaps that has changed this?
The device is currently running Android 4.4.4. I believe it may have been on 4.4.1 before.
Has this ever been possible? Is it more likely that something has changed in Android or I have broken something, or has this been broken all along and I've only just noticed?
Please note that this is for a specialised industrial device (a Honeywell Dolphin 75e) which cannot be rooted.
Yes, because the com.android.systemui package is running which is responsible for the status bar and software navigation bar. The following is a couple of solutions on disabling the package. Note that in order to make use of the solutions the extended privileges (ideally root) are needed.
Reboot persistent solution
Rename the apk extension of /system/app/SystemUI.apk or delete the file completely. You have to remount the /system partition as it is read-only by default. After renaming/deleting the system likely uninstall the /data/data/com.android.systemui package. If not, do it manually, then reboot.
Reboot impermanent solution
Disable/enable the framework service at runtime (e.g. on your app start up) with the calls (valid prior to KitKat at least) to:
service call activity 42 s16 com.android.systemui // disable status bar
and
am startservice -n com.android.systemui/.SystemUIService // enable status bar
Note, the solution is not persistent on reboot.
这篇关于Android全屏应用-禁止访问状态栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!