Loading core/java/android/app/supervision/SupervisionManager.java +22 −14 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ import android.os.RemoteException; @SystemService(Context.SUPERVISION_SERVICE) public class SupervisionManager { private final Context mContext; private final ISupervisionManager mService; @Nullable private final ISupervisionManager mService; /** * Activity action: ask the human user to enable supervision for this user. Only the app that Loading Loading @@ -66,7 +66,7 @@ public class SupervisionManager { /** @hide */ @UnsupportedAppUsage public SupervisionManager(Context context, ISupervisionManager service) { public SupervisionManager(Context context, @Nullable ISupervisionManager service) { mContext = context; mService = service; } Loading @@ -93,12 +93,15 @@ public class SupervisionManager { value = android.Manifest.permission.INTERACT_ACROSS_USERS, conditional = true) public boolean isSupervisionEnabledForUser(@UserIdInt int userId) { if (mService != null) { try { return mService.isSupervisionEnabledForUser(userId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } return false; } /** * Sets whether the device is supervised for the current user. Loading @@ -122,12 +125,14 @@ public class SupervisionManager { value = android.Manifest.permission.INTERACT_ACROSS_USERS, conditional = true) public void setSupervisionEnabledForUser(@UserIdInt int userId, boolean enabled) { if (mService != null) { try { mService.setSupervisionEnabledForUser(userId, enabled); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } } /** * Returns the package name of the app that is acting as the active supervision app or null if Loading @@ -138,10 +143,13 @@ public class SupervisionManager { @UserHandleAware @Nullable public String getActiveSupervisionAppPackage() { if (mService != null) { try { return mService.getActiveSupervisionAppPackage(mContext.getUserId()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } return null; } } Loading
core/java/android/app/supervision/SupervisionManager.java +22 −14 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ import android.os.RemoteException; @SystemService(Context.SUPERVISION_SERVICE) public class SupervisionManager { private final Context mContext; private final ISupervisionManager mService; @Nullable private final ISupervisionManager mService; /** * Activity action: ask the human user to enable supervision for this user. Only the app that Loading Loading @@ -66,7 +66,7 @@ public class SupervisionManager { /** @hide */ @UnsupportedAppUsage public SupervisionManager(Context context, ISupervisionManager service) { public SupervisionManager(Context context, @Nullable ISupervisionManager service) { mContext = context; mService = service; } Loading @@ -93,12 +93,15 @@ public class SupervisionManager { value = android.Manifest.permission.INTERACT_ACROSS_USERS, conditional = true) public boolean isSupervisionEnabledForUser(@UserIdInt int userId) { if (mService != null) { try { return mService.isSupervisionEnabledForUser(userId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } return false; } /** * Sets whether the device is supervised for the current user. Loading @@ -122,12 +125,14 @@ public class SupervisionManager { value = android.Manifest.permission.INTERACT_ACROSS_USERS, conditional = true) public void setSupervisionEnabledForUser(@UserIdInt int userId, boolean enabled) { if (mService != null) { try { mService.setSupervisionEnabledForUser(userId, enabled); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } } /** * Returns the package name of the app that is acting as the active supervision app or null if Loading @@ -138,10 +143,13 @@ public class SupervisionManager { @UserHandleAware @Nullable public String getActiveSupervisionAppPackage() { if (mService != null) { try { return mService.getActiveSupervisionAppPackage(mContext.getUserId()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } return null; } }