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

Commit 2c6a657c authored by Olivier Nshimiye's avatar Olivier Nshimiye
Browse files

Add generic broadcasts for profile availability.

Bug: 299068704
Bug: 298630478
Test: atest CtsMultiUserTestCases:UserManagerTest
Change-Id: I1849df2347b6a552c98ebae1614aa58d634dc0de
parent bc9258bb
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -11002,8 +11002,10 @@ package android.content {
    field public static final String ACTION_PROCESS_TEXT = "android.intent.action.PROCESS_TEXT";
    field public static final String ACTION_PROFILE_ACCESSIBLE = "android.intent.action.PROFILE_ACCESSIBLE";
    field public static final String ACTION_PROFILE_ADDED = "android.intent.action.PROFILE_ADDED";
    field @FlaggedApi("android.os.allow_private_profile") public static final String ACTION_PROFILE_AVAILABLE = "android.intent.action.PROFILE_AVAILABLE";
    field public static final String ACTION_PROFILE_INACCESSIBLE = "android.intent.action.PROFILE_INACCESSIBLE";
    field public static final String ACTION_PROFILE_REMOVED = "android.intent.action.PROFILE_REMOVED";
    field @FlaggedApi("android.os.allow_private_profile") public static final String ACTION_PROFILE_UNAVAILABLE = "android.intent.action.PROFILE_UNAVAILABLE";
    field public static final String ACTION_PROVIDER_CHANGED = "android.intent.action.PROVIDER_CHANGED";
    field public static final String ACTION_QUICK_CLOCK = "android.intent.action.QUICK_CLOCK";
    field public static final String ACTION_QUICK_VIEW = "android.intent.action.QUICK_VIEW";
+30 −0
Original line number Diff line number Diff line
@@ -18,11 +18,13 @@ package android.content;
import static android.app.sdksandbox.SdkSandboxManager.ACTION_START_SANDBOXED_ACTIVITY;
import static android.content.ContentProvider.maybeAddUserId;
import static android.os.Flags.FLAG_ALLOW_PRIVATE_PROFILE;
import android.Manifest;
import android.accessibilityservice.AccessibilityService;
import android.annotation.AnyRes;
import android.annotation.BroadcastBehavior;
import android.annotation.FlaggedApi;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -4156,6 +4158,34 @@ public class Intent implements Parcelable, Cloneable {
    public static final String ACTION_MANAGED_PROFILE_UNAVAILABLE =
            "android.intent.action.MANAGED_PROFILE_UNAVAILABLE";
    /**
     * Broadcast sent to the primary user when an associated profile has become available.
     * This is sent when a user disables quiet mode for the profile. Carries an extra
     * {@link #EXTRA_USER} that specifies the {@link UserHandle} of the profile. When quiet mode is
     * changed, this broadcast will carry a boolean extra {@link #EXTRA_QUIET_MODE} indicating the
     * new state of quiet mode. This is only sent to registered receivers, not manifest receivers.
     *
     * <p>This broadcast is similar to {@link #ACTION_MANAGED_PROFILE_AVAILABLE} but functions as a
     * generic broadcast for all users of type {@link android.content.pm.UserInfo#isProfile()}}.
     */
    @FlaggedApi(FLAG_ALLOW_PRIVATE_PROFILE)
    public static final String ACTION_PROFILE_AVAILABLE =
            "android.intent.action.PROFILE_AVAILABLE";
    /**
     * Broadcast sent to the primary user when an associated profile has become unavailable.
     * This is sent when a user enables quiet mode for the profile. Carries an extra
     * {@link #EXTRA_USER} that specifies the {@link UserHandle} of the profile. When quiet mode is
     * changed, this broadcast will carry a boolean extra {@link #EXTRA_QUIET_MODE} indicating the
     * new state of quiet mode. This is only sent to registered receivers, not manifest receivers.
     *
     * <p>This broadcast is similar to {@link #ACTION_MANAGED_PROFILE_UNAVAILABLE} but functions as
     * a generic broadcast for all users of type {@link android.content.pm.UserInfo#isProfile()}}.
     */
    @FlaggedApi(FLAG_ALLOW_PRIVATE_PROFILE)
    public static final String ACTION_PROFILE_UNAVAILABLE =
            "android.intent.action.PROFILE_UNAVAILABLE";
    /**
     * Broadcast sent to the parent user when an associated profile has been started and unlocked.
     * Carries an extra {@link #EXTRA_USER} that specifies the {@link UserHandle} of the profile.
+4 −0
Original line number Diff line number Diff line
@@ -828,6 +828,10 @@
    <protected-broadcast android:name="android.app.admin.action.DEVICE_POLICY_SET_RESULT" />
    <protected-broadcast android:name="android.app.admin.action.DEVICE_POLICY_CHANGED" />

    <!-- Added in V -->
    <protected-broadcast android:name="android.intent.action.PROFILE_AVAILABLE" />
    <protected-broadcast android:name="android.intent.action.PROFILE_UNAVAILABLE" />

    <!-- ====================================================================== -->
    <!--                          RUNTIME PERMISSIONS                           -->
    <!-- ====================================================================== -->