Looking for solution to integrate COSU mode in Android.I have already gone through below links,
https://developer.android.com/work/cosu.html
Has anyone implemented it successfully?
Looking for solution to integrate COSU mode in Android.I have already gone through below links,
https://developer.android.com/work/cosu.html
Has anyone implemented it successfully?
Take a look at this tutorial and that repository with example.
...
if (mDevicePolicyManager.isLockTaskPermitted(
getApplicationContext().getPackageName())) {
Intent lockIntent = new Intent(getApplicationContext(),
LockedActivity.class);
lockIntent.putExtra(EXTRA_FILEPATH, mCurrentPhotoPath);
startActivity(lockIntent);
finish();
} else {
Toast.makeText(getApplicationContext(),
R.string.not_lock_whitelisted,Toast.LENGTH_SHORT)
.show();
}
...
You might want to try Google's new Android Management API, it allows to manage COSU devices without having to build an on-device agent (a device policy controller).
I decided neither way was very good. I used device policy ownership to prevent installing any other apps, wrote a launcher app (so we were the homescreen), made it a system app and used the statusbar manager apis (which aren't well known) to remove the recents button and prevent the status bar from being opened so there was no way to launch any app but mine.
© 2022 - 2024 — McMap. All rights reserved.