Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 999661c3 authored by Vitor Carvalho's avatar Vitor Carvalho
Browse files

Introduce new intent actions in SupervisionManager to enable and disable supervision.

Bug: 381428475
Test: n/a
Flag: EXEMPT unreachable code
Change-Id: If665d55cbc63e8ea1f3a2f5a5d26167f71c263b1
parent 8ee235ee
Loading
Loading
Loading
Loading
+29 −0
Original line number Diff line number Diff line
@@ -34,6 +34,35 @@ public class SupervisionManager {
    private final Context mContext;
    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.
     *
     * <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
     * Activity#RESULT_OK}.
     *
     * <p>If supervision is already enabled, the operation will return a failure result.
     *
     * @hide
     */
    public static final String ACTION_ENABLE_SUPERVISION = "android.app.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.
     *
     * <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
     * Activity#RESULT_OK}.
     *
     * <p>If supervision is not enabled, the operation will return a failure result.
     *
     * @hide
     */
    public static final String ACTION_DISABLE_SUPERVISION =
            "android.app.action.DISABLE_SUPERVISION";

    /** @hide */
    @UnsupportedAppUsage
    public SupervisionManager(Context context, ISupervisionManager service) {