Giter VIP home page Giter VIP logo

Comments (7)

No1e avatar No1e commented on August 19, 2024 1

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.

from android-testdpc.

tony-mak avatar tony-mak commented on August 19, 2024 1

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

from android-testdpc.

jeremywizy avatar jeremywizy commented on August 19, 2024

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...)

from android-testdpc.

tony-mak avatar tony-mak commented on August 19, 2024

Closing, and stay tuned :)

Thanks

from android-testdpc.

namputo avatar namputo commented on August 19, 2024

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

from android-testdpc.

No1e avatar No1e commented on August 19, 2024

from android-testdpc.

buffermet avatar buffermet commented on August 19, 2024

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)

from android-testdpc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.