Loading core/java/android/app/supervision/SupervisionAppService.java +14 −4 Original line number Diff line number Diff line Loading @@ -27,8 +27,19 @@ import android.content.Intent; import android.os.IBinder; /** * Base class for a service that the {@code android.app.role.RoleManager.ROLE_SYSTEM_SUPERVISION} * role holder must implement. * Base class for a service that the holders of the * {@link android.app.role.RoleManager#ROLE_SYSTEM_SUPERVISION} or * {@link android.app.role.RoleManager#ROLE_SUPERVISION} roles must extend. * * <p>When supervision is enabled, the system searches for this service from each supervision role * holder using an intent filter for the {@link #ACTION_SUPERVISION_APP_SERVICE} action. The system * attempts to maintain a bound connection to the service, keeping it in the foreground. * * <p>If a supervision role holder's process crashes, the system will restart it and automatically * rebind to the service after a backoff period. * * <p>The service must be protected with the permission * {@link android.Manifest.permission#BIND_SUPERVISION_APP_SERVICE}. * * @hide */ Loading @@ -36,8 +47,7 @@ import android.os.IBinder; @FlaggedApi(Flags.FLAG_ENABLE_SUPERVISION_APP_SERVICE) public class SupervisionAppService extends Service { /** * Service action: Action for a service that the {@code * android.app.role.RoleManager.ROLE_SYSTEM_SUPERVISION} role holder must implement. * Service Action: Action for a service that a supervision role holder must extend. * * @hide */ Loading core/java/android/app/supervision/SupervisionManager.java +11 −9 Original line number Diff line number Diff line Loading @@ -25,6 +25,8 @@ import android.annotation.FlaggedApi; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.annotation.SdkConstant; import android.annotation.SdkConstant.SdkConstantType; import android.annotation.SystemApi; import android.annotation.SystemService; import android.annotation.TestApi; Loading @@ -37,7 +39,7 @@ import android.content.Intent; import android.os.RemoteException; /** * Service for handling parental supervision. * This class provides information about and manages supervision. * * @hide */ Loading Loading @@ -84,8 +86,7 @@ public class SupervisionManager { @Nullable private final ISupervisionManager mService; /** * Activity action: ask the human user to enable supervision for this user. Only the app that * holds the {@code SYSTEM_SUPERVISION} role can launch this intent. * Activity Action: Ask the user to confirm enabling supervision. * * <p>The intent must be invoked via {@link Activity#startActivityForResult} to receive the * result of whether or not the user approved the action. If approved, the result will be {@link Loading @@ -97,12 +98,12 @@ public class SupervisionManager { */ @SystemApi @FlaggedApi(Flags.FLAG_SUPERVISION_MANAGER_APIS) @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) public static final String ACTION_ENABLE_SUPERVISION = "android.app.supervision.action.ENABLE_SUPERVISION"; /** * Activity action: ask the human user to disable supervision for this user. Only the app that * holds the {@code SYSTEM_SUPERVISION} role can launch this intent. * Activity Action: Ask the user to confirm disabling supervision. * * <p>The intent must be invoked via {@link Activity#startActivityForResult} to receive the * result of whether or not the user approved the action. If approved, the result will be {@link Loading @@ -114,6 +115,7 @@ public class SupervisionManager { */ @SystemApi @FlaggedApi(Flags.FLAG_SUPERVISION_MANAGER_APIS) @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) public static final String ACTION_DISABLE_SUPERVISION = "android.app.supervision.action.DISABLE_SUPERVISION"; Loading Loading @@ -160,7 +162,7 @@ public class SupervisionManager { } /** * Returns whether the device is supervised. * Returns whether supervision is enabled for the current user. * * @hide */ Loading @@ -173,7 +175,7 @@ public class SupervisionManager { } /** * Returns whether the device is supervised. * Returns whether supervision is enabled for the given user. * * @hide */ Loading @@ -191,7 +193,7 @@ public class SupervisionManager { } /** * Sets whether the device is supervised for the current user. * Sets whether the supervision is enabled for the current user. * * @hide */ Loading @@ -202,7 +204,7 @@ public class SupervisionManager { } /** * Sets whether the device is supervised for a given user. * Sets whether the supervision is enabled for the given user. * * @hide */ Loading core/java/android/app/supervision/SupervisionRecoveryInfo.java +5 −5 Original line number Diff line number Diff line Loading @@ -33,12 +33,12 @@ import java.lang.annotation.RetentionPolicy; import java.util.Objects; /** * Contains the information needed for recovering the device supervision PIN. * Contains the information needed for recovering the device-wide supervision credentials. * * <p>Typically returned as an {@link android.content.Intent} extra by the supervision PIN recovery * activity hosted by the {@code android.app.role.RoleManager#ROLE_SYSTEM_SUPERVISION} role holder. * This activity is generally launched to set up a recovery method or for recovery within the device * supervision flow. * <p>This is typically returned as an {@link android.content.Intent} extra from the supervision * credentials recovery activity. This activity is hosted by the holder of the * {@code android.app.role.RoleManager#ROLE_SYSTEM_SUPERVISION} role and is generally launched to * set up a recovery method or to reset the supervision credentials. * * @hide */ Loading Loading
core/java/android/app/supervision/SupervisionAppService.java +14 −4 Original line number Diff line number Diff line Loading @@ -27,8 +27,19 @@ import android.content.Intent; import android.os.IBinder; /** * Base class for a service that the {@code android.app.role.RoleManager.ROLE_SYSTEM_SUPERVISION} * role holder must implement. * Base class for a service that the holders of the * {@link android.app.role.RoleManager#ROLE_SYSTEM_SUPERVISION} or * {@link android.app.role.RoleManager#ROLE_SUPERVISION} roles must extend. * * <p>When supervision is enabled, the system searches for this service from each supervision role * holder using an intent filter for the {@link #ACTION_SUPERVISION_APP_SERVICE} action. The system * attempts to maintain a bound connection to the service, keeping it in the foreground. * * <p>If a supervision role holder's process crashes, the system will restart it and automatically * rebind to the service after a backoff period. * * <p>The service must be protected with the permission * {@link android.Manifest.permission#BIND_SUPERVISION_APP_SERVICE}. * * @hide */ Loading @@ -36,8 +47,7 @@ import android.os.IBinder; @FlaggedApi(Flags.FLAG_ENABLE_SUPERVISION_APP_SERVICE) public class SupervisionAppService extends Service { /** * Service action: Action for a service that the {@code * android.app.role.RoleManager.ROLE_SYSTEM_SUPERVISION} role holder must implement. * Service Action: Action for a service that a supervision role holder must extend. * * @hide */ Loading
core/java/android/app/supervision/SupervisionManager.java +11 −9 Original line number Diff line number Diff line Loading @@ -25,6 +25,8 @@ import android.annotation.FlaggedApi; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.annotation.SdkConstant; import android.annotation.SdkConstant.SdkConstantType; import android.annotation.SystemApi; import android.annotation.SystemService; import android.annotation.TestApi; Loading @@ -37,7 +39,7 @@ import android.content.Intent; import android.os.RemoteException; /** * Service for handling parental supervision. * This class provides information about and manages supervision. * * @hide */ Loading Loading @@ -84,8 +86,7 @@ public class SupervisionManager { @Nullable private final ISupervisionManager mService; /** * Activity action: ask the human user to enable supervision for this user. Only the app that * holds the {@code SYSTEM_SUPERVISION} role can launch this intent. * Activity Action: Ask the user to confirm enabling supervision. * * <p>The intent must be invoked via {@link Activity#startActivityForResult} to receive the * result of whether or not the user approved the action. If approved, the result will be {@link Loading @@ -97,12 +98,12 @@ public class SupervisionManager { */ @SystemApi @FlaggedApi(Flags.FLAG_SUPERVISION_MANAGER_APIS) @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) public static final String ACTION_ENABLE_SUPERVISION = "android.app.supervision.action.ENABLE_SUPERVISION"; /** * Activity action: ask the human user to disable supervision for this user. Only the app that * holds the {@code SYSTEM_SUPERVISION} role can launch this intent. * Activity Action: Ask the user to confirm disabling supervision. * * <p>The intent must be invoked via {@link Activity#startActivityForResult} to receive the * result of whether or not the user approved the action. If approved, the result will be {@link Loading @@ -114,6 +115,7 @@ public class SupervisionManager { */ @SystemApi @FlaggedApi(Flags.FLAG_SUPERVISION_MANAGER_APIS) @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) public static final String ACTION_DISABLE_SUPERVISION = "android.app.supervision.action.DISABLE_SUPERVISION"; Loading Loading @@ -160,7 +162,7 @@ public class SupervisionManager { } /** * Returns whether the device is supervised. * Returns whether supervision is enabled for the current user. * * @hide */ Loading @@ -173,7 +175,7 @@ public class SupervisionManager { } /** * Returns whether the device is supervised. * Returns whether supervision is enabled for the given user. * * @hide */ Loading @@ -191,7 +193,7 @@ public class SupervisionManager { } /** * Sets whether the device is supervised for the current user. * Sets whether the supervision is enabled for the current user. * * @hide */ Loading @@ -202,7 +204,7 @@ public class SupervisionManager { } /** * Sets whether the device is supervised for a given user. * Sets whether the supervision is enabled for the given user. * * @hide */ Loading
core/java/android/app/supervision/SupervisionRecoveryInfo.java +5 −5 Original line number Diff line number Diff line Loading @@ -33,12 +33,12 @@ import java.lang.annotation.RetentionPolicy; import java.util.Objects; /** * Contains the information needed for recovering the device supervision PIN. * Contains the information needed for recovering the device-wide supervision credentials. * * <p>Typically returned as an {@link android.content.Intent} extra by the supervision PIN recovery * activity hosted by the {@code android.app.role.RoleManager#ROLE_SYSTEM_SUPERVISION} role holder. * This activity is generally launched to set up a recovery method or for recovery within the device * supervision flow. * <p>This is typically returned as an {@link android.content.Intent} extra from the supervision * credentials recovery activity. This activity is hosted by the holder of the * {@code android.app.role.RoleManager#ROLE_SYSTEM_SUPERVISION} role and is generally launched to * set up a recovery method or to reset the supervision credentials. * * @hide */ Loading