List of usage examples for android.app.admin DevicePolicyManager setApplicationRestrictions
@WorkerThread public void setApplicationRestrictions(@Nullable ComponentName admin, String packageName, Bundle settings)
From source file:com.example.android.apprestrictionenforcer.AppRestrictionEnforcerFragment.java
/** * Saves all the restrictions./* ww w . java 2 s . c om*/ * * @param activity The activity. */ private void saveRestrictions(Activity activity) { DevicePolicyManager devicePolicyManager = (DevicePolicyManager) activity .getSystemService(Context.DEVICE_POLICY_SERVICE); devicePolicyManager.setApplicationRestrictions(EnforcerDeviceAdminReceiver.getComponentName(activity), Constants.PACKAGE_NAME_APP_RESTRICTION_SCHEMA, mCurrentRestrictions); }