Like google chrome application, can we apply restriction to google play store app too? If anyone has tried it please reply with bundle structure for same.
Thanks in Advance!!!
Like google chrome application, can we apply restriction to google play store app too? If anyone has tried it please reply with bundle structure for same.
Thanks in Advance!!!
Please check below API to restrict chrome
final DevicePolicyManager manager =
(DevicePolicyManager) activity.getSystemService(Context.DEVICE_POLICY_SERVICE);
final Bundle settings = new Bundle();
settings.putString("EditBookmarksEnabled", "false");
settings.putString("IncognitoModeAvailability", "1");
settings.putString("ManagedBookmarks",
"[{\"name\": \"Chromium\", \"url\": \"http://chromium.org\"}, " +
"{\"name\": \"Google\", \"url\": \"https://www.google.com\"}]");
settings.putString("DefaultSearchProviderEnabled", "true");
settings.putString("DefaultSearchProviderName", "\"LMGTFY\"");
settings.putString("DefaultSearchProviderSearchURL",
"\"any URL\"");
settings.putString("URLBlacklist", "[\"facebook.com\", \"example.org\"]");
Now you can use
manager.setApplicationRestrictions(BasicDeviceAdminReceiver.getComponentName(activity),
packageName,
settings);
to set restriction.
The Google Play Store app does not expose any app restriction to configure.
To get the list of app restrictions that an app exposes you can either
android.content.APP_RESTRICTIONS
(more details in the Android documentation),