Loading core/java/android/app/admin/DevicePolicyManager.java +7 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.annotation.SdkConstant; import android.annotation.SdkConstant.SdkConstantType; import android.annotation.SystemApi; import android.annotation.UserIdInt; import android.annotation.WorkerThread; import android.app.Activity; import android.app.admin.SecurityLog.SecurityEvent; import android.content.ComponentName; Loading Loading @@ -4226,6 +4227,8 @@ public class DevicePolicyManager { * owner, and the application restrictions managing package via * {@link #getApplicationRestrictions}. * * <p>NOTE: The method performs disk I/O and shouldn't be called on the main thread * * @param admin Which {@link DeviceAdminReceiver} this request is associated with, or * {@code null} if called by the application restrictions managing package. * @param packageName The name of the package to update restricted settings for. Loading @@ -4235,6 +4238,7 @@ public class DevicePolicyManager { * @see #setApplicationRestrictionsManagingPackage * @see UserManager#KEY_RESTRICTIONS_PENDING */ @WorkerThread public void setApplicationRestrictions(@Nullable ComponentName admin, String packageName, Bundle settings) { throwIfParentInstance("setApplicationRestrictions"); Loading Loading @@ -4981,6 +4985,8 @@ public class DevicePolicyManager { * application restrictions via {@link #setApplicationRestrictionsManagingPackage}; otherwise a * security exception will be thrown. * * <p>NOTE: The method performs disk I/O and shouldn't be called on the main thread * * @param admin Which {@link DeviceAdminReceiver} this request is associated with, or * {@code null} if called by the application restrictions managing package. * @param packageName The name of the package to fetch restricted settings of. Loading @@ -4990,6 +4996,7 @@ public class DevicePolicyManager { * @throws SecurityException if {@code admin} is not a device or profile owner. * @see {@link #setApplicationRestrictionsManagingPackage} */ @WorkerThread public Bundle getApplicationRestrictions(@Nullable ComponentName admin, String packageName) { throwIfParentInstance("getApplicationRestrictions"); if (mService != null) { Loading core/java/android/os/UserManager.java +6 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.annotation.SystemApi; import android.annotation.UserIdInt; import android.annotation.WorkerThread; import android.app.Activity; import android.app.ActivityManager; import android.app.ActivityManagerNative; Loading Loading @@ -2072,12 +2073,15 @@ public class UserManager { * <li>From {@link android.os.Build.VERSION_CODES#M}, {@code Bundle} or {@code Bundle[]} * </ul> * * <p>NOTE: The method performs disk I/O and shouldn't be called on the main thread * * @param packageName the package name of the calling application * @return a {@link Bundle} with the restrictions for that package, or an empty {@link Bundle} * if there are no saved restrictions. * * @see #KEY_RESTRICTIONS_PENDING */ @WorkerThread public Bundle getApplicationRestrictions(String packageName) { try { return mService.getApplicationRestrictions(packageName); Loading @@ -2089,6 +2093,7 @@ public class UserManager { /** * @hide */ @WorkerThread public Bundle getApplicationRestrictions(String packageName, UserHandle user) { try { return mService.getApplicationRestrictionsForUser(packageName, user.getIdentifier()); Loading @@ -2100,6 +2105,7 @@ public class UserManager { /** * @hide */ @WorkerThread public void setApplicationRestrictions(String packageName, Bundle restrictions, UserHandle user) { try { Loading Loading
core/java/android/app/admin/DevicePolicyManager.java +7 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.annotation.SdkConstant; import android.annotation.SdkConstant.SdkConstantType; import android.annotation.SystemApi; import android.annotation.UserIdInt; import android.annotation.WorkerThread; import android.app.Activity; import android.app.admin.SecurityLog.SecurityEvent; import android.content.ComponentName; Loading Loading @@ -4226,6 +4227,8 @@ public class DevicePolicyManager { * owner, and the application restrictions managing package via * {@link #getApplicationRestrictions}. * * <p>NOTE: The method performs disk I/O and shouldn't be called on the main thread * * @param admin Which {@link DeviceAdminReceiver} this request is associated with, or * {@code null} if called by the application restrictions managing package. * @param packageName The name of the package to update restricted settings for. Loading @@ -4235,6 +4238,7 @@ public class DevicePolicyManager { * @see #setApplicationRestrictionsManagingPackage * @see UserManager#KEY_RESTRICTIONS_PENDING */ @WorkerThread public void setApplicationRestrictions(@Nullable ComponentName admin, String packageName, Bundle settings) { throwIfParentInstance("setApplicationRestrictions"); Loading Loading @@ -4981,6 +4985,8 @@ public class DevicePolicyManager { * application restrictions via {@link #setApplicationRestrictionsManagingPackage}; otherwise a * security exception will be thrown. * * <p>NOTE: The method performs disk I/O and shouldn't be called on the main thread * * @param admin Which {@link DeviceAdminReceiver} this request is associated with, or * {@code null} if called by the application restrictions managing package. * @param packageName The name of the package to fetch restricted settings of. Loading @@ -4990,6 +4996,7 @@ public class DevicePolicyManager { * @throws SecurityException if {@code admin} is not a device or profile owner. * @see {@link #setApplicationRestrictionsManagingPackage} */ @WorkerThread public Bundle getApplicationRestrictions(@Nullable ComponentName admin, String packageName) { throwIfParentInstance("getApplicationRestrictions"); if (mService != null) { Loading
core/java/android/os/UserManager.java +6 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.annotation.SystemApi; import android.annotation.UserIdInt; import android.annotation.WorkerThread; import android.app.Activity; import android.app.ActivityManager; import android.app.ActivityManagerNative; Loading Loading @@ -2072,12 +2073,15 @@ public class UserManager { * <li>From {@link android.os.Build.VERSION_CODES#M}, {@code Bundle} or {@code Bundle[]} * </ul> * * <p>NOTE: The method performs disk I/O and shouldn't be called on the main thread * * @param packageName the package name of the calling application * @return a {@link Bundle} with the restrictions for that package, or an empty {@link Bundle} * if there are no saved restrictions. * * @see #KEY_RESTRICTIONS_PENDING */ @WorkerThread public Bundle getApplicationRestrictions(String packageName) { try { return mService.getApplicationRestrictions(packageName); Loading @@ -2089,6 +2093,7 @@ public class UserManager { /** * @hide */ @WorkerThread public Bundle getApplicationRestrictions(String packageName, UserHandle user) { try { return mService.getApplicationRestrictionsForUser(packageName, user.getIdentifier()); Loading @@ -2100,6 +2105,7 @@ public class UserManager { /** * @hide */ @WorkerThread public void setApplicationRestrictions(String packageName, Bundle restrictions, UserHandle user) { try { Loading