Reputation: 13
I have noticed that when you flash a device and run it for the first time you get into the setup wizard. I assume that application is run in so called LockTask mode (Kiosk mode for dedicated devices) because it has only one navbar button (usually "back" button, "home", for example, is hidden).
Here are my questions:
Upvotes: 0
Views: 437
Reputation: 13
I finally figured that out. Setup wizards usually use so called “google setupcompat” library. It allows to hide both status and navigation bars and it can show us only “back” button instead of all of them. Functionality stated above can be found here https://cs.android.com/android/platform/superproject/main/+/main:external/setupcompat/main/java/com/google/android/setupcompat/util/SystemBarHelper.java
Upvotes: 0
Reputation: 15082
No, lock task mode is not used by a setup wizard app.
When an Android device is factory reset it looks for a particular app to run as a setup wizard app and it will automatically adjust the nav bar functionality until the the setup wizard indicates setup is complete.
The following question includes an answer that describes how to implement a setup wizard app for Android and how to complete the setup process programmatically: How to implement AOSP out-of-the-box experience (i.e., setup wizard)?
If you are looking for a way to reproduce the setup wizard nav bar behavior after setup is complete you might need to investigate lock task mode as you mention https://developer.android.com/work/dpc/dedicated-devices/lock-task-mode but that seems to require the use of enterprise management APIs.
If you are bundling an app in the system build with priv-app privileges then there might be some options for available but I'm not sure offhand.
If you are building the OS from source and don't need to pass CTS then of course you can hack things as you please.
If you are just building a plain old Android app there is no way to lock the user into your app permanently, that would be easily abused by malware.
Upvotes: 1