Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set status bar icons visible #29

Closed
No1e opened this issue Apr 3, 2017 · 7 comments
Closed

Set status bar icons visible #29

No1e opened this issue Apr 3, 2017 · 7 comments

Comments

@No1e
Copy link

No1e commented Apr 3, 2017

"Kiosk Mode" is very nice feature especially how it can be implemented in Android 6, but there is one thing that is nor very nice. Entering lock task mode makes status bar icons invisible (including battery status and wireless status).

"Kiosk Mode" is normally used on company owned devices, often industrial Android base devices from different vendors (Honeywell, Zebra, ...), where user is allowed to use single application or only restricted set of applications. User often work off their desks (e.g. warehouse...). Since user productivity depends of health of device, it is essential to have those icons back since users has to know when there is a problem with wireless, and especially what is the status of battery so they can schedule battery recharge or replace. Those devices are not like user consumer mobile devices where you can plug in charger and use it even when device is on the charger (making calls etc.).

  1. What is the reason behind decision to hide all status bar icons in "lock task" mode?
  2. Is there a way to set status bar icons visible in "lock task" mode?
@jeremywizy
Copy link

Hi No1e,

From my understanding, StartLockTask (Kiosk Mode) lock the device on the current Activity, and restrict access to anything else. The top status bar is the top menu and is hidden too.

I faced this issue too, and create my own "Status app", whitelisted for Kiosk Mode (and thus accessible for end user) and display all the information I want (battery level, data consumtion...)

@No1e
Copy link
Author

No1e commented Apr 3, 2017

Hi Jeremy,

It seems that we are not the only ones that have this problem, but I have not found that there is really support in Android API to enable this. I noticed couple of other problems in the current features list of DPC/Lock Task mode ...

Well, its a bit more complex than what you described, depending if your app is device owner or not...

In my case, I have admin app that is device owner and has the following features:

  • Device owner. Entering in "lock task" mode in this app will disable some stuff (status bar, hide recent apps/home buttons, disable back button when in activity from this app).
  • Main launcher activity (it overtakes google launcher responsibility)
  • Disables google search (some devices have hardware google search button)
  • Maintains apps that are allowed to use "lock task" mode
  • Originally "screen lock" (timeout, button) is also disabled when activity from device owner app enters lock task mode, this is a security issue, so I had to do some hack in order to enable this.
  • Starting allowed apps. In this case home/recent buttons are still disabled, but back button is not, allowing to get back to previous activity (the one from where we can start other apps).
  • etc.

I have workaround to include foreground service in my admin app, This service will create "custom" status bar (draw over other apps) and put there notifications that I need. But, I would like to avoid this if possible by using Android API to save battery that will be used for those activities.

@tony-mak
Copy link
Contributor

tony-mak commented Apr 4, 2017

Thanks for the suggestion.
The feature request is now tracked internally.

@tony-mak
Copy link
Contributor

Closing, and stay tuned :)

Thanks

@namputo
Copy link

namputo commented Jan 20, 2018

Hi is it possible to unhide the home and recents button while still in the locktask mode. I understand they are disabled, and that is okay

@No1e
Copy link
Author

No1e commented Jan 20, 2018 via email

@buffermet
Copy link

buffermet commented Aug 6, 2019

As of Android 9 this has become possible using dpm.setLockTaskFeatures() function.

The status bar (and other features) can be shown whilst in lockTask mode like so:

dpm.setLockTaskFeatures(adminComponentName, DevicePolicyManager.LOCK_TASK_FEATURE_SYSTEM_INFO);

From the Android docs:

LOCK_TASK_FEATURE_SYSTEM_INFO

Enables the status bar’s system info area that contains indicators such as connectivity, battery, and sound and vibrate options.

https://developer.android.com/reference/android/app/admin/DevicePolicyManager#setLockTaskFeatures(android.content.ComponentName,%20int)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants