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();
}
...