4

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!!!

KR_Android
  • 1,149
  • 9
  • 19

2 Answers2

4

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.

Sud
  • 421
  • 1
  • 4
  • 8
0

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

Fred
  • 2,191
  • 1
  • 12
  • 14