I am new to Android for work features.
I have written a sample app to test the restriction features provided to a profile owner. My sample app creates a managed work profile and sets itself as the profile owner.
I tried to apply some restriction policies after that, e.g., DevicePolicyManager.addUserRestriction(componentName, UserManager.DISALLOW_UNINSTALL_APPS);
It works and I am unable to uninstall any app from the managed profile. But when I try to apply: DevicePolicyManager.addUserRestriction(componentName, UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES);
,
it seems to be not working.
I couldn't find the default settings app enabled in the profile.
But when I log the apps installed in the managed profile, I can see two setting packages (com.android.settings
and com.android.providers.settings
) in the list.
What my understanding from the above API is after applying the restriction, Setting->security->Unknown Source
switch should be disabled. But I couldn't find any Settings app in the managed profile to verify.
Also, after applying the restriction, I am able to install any apk from adb
in the managed profile along with the primary user.
Please let me know if i am missing something.