Comments (7)
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.
Thanks for the suggestion.
The feature request is now tracked internally.
from android-testdpc.
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.
Closing, and stay tuned :)
Thanks
from android-testdpc.
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.
from android-testdpc.
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.
from android-testdpc.
Related Issues (20)
- testDPC app crashing on Android 13 HOT 3
- The setCameraDisabled method fails HOT 1
- What's the compatibility condition? HOT 1
- testDPC app crashing on Android 14 (multiuser, user 10) HOT 1
- Couldn't launch 'test dpc' app built myself HOT 1
- How I can run this in My Android Studio HOT 2
- Action APPLICATION_RESTRICTIONS_CHANGED
- add android.permission.POST_NOTIFICATIONS HOT 1
- No toolchains found HOT 1
- DeviceAdminReceiver.onProfileProvisioningComplete() not getting called on when managed profile is created HOT 1
- ADB provisioning command in README is not very noticable HOT 1
- Bazel build is failing HOT 1
- WifiEapTlsCreateDialogFragment's save feature not capable of saving any WiFi Configurations
- Android tester HOT 1
- Cross profile calendar not working properly HOT 1
- cannot import this project to my android studio even after loading bazel plugins HOT 1
- Getting error in "bazel build testdpc" command HOT 3
- Review testing setup HOT 2
- TesDPC keeps stopping after Reboot in Android 14 HOT 1
- Can not revoke admin to uninstall testdpc HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-testdpc.