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

Commit 2c49d18c authored by Jorge Ruesga's avatar Jorge Ruesga
Browse files

Profiles: add PROFILES_STATE_CHANGED_ACTION broadcast intent



Added a new broadcast intent to profiles manager (PROFILES_STATE_CHANGED_ACTION), for
notify an event when profiles are enabled or disabled.

Change-Id: If701b3be54157c23acdf74e1da658fbce335437e
Signed-off-by: default avatarJorge Ruesga <jorge@ruesga.com>
parent 5a43151b
Loading
Loading
Loading
Loading
+37 −0
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ package android.app;

import java.util.UUID;

import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
import android.content.Context;
import android.os.Handler;
import android.os.IBinder;
@@ -43,6 +45,41 @@ public class ProfileManager {

    private static final String SYSTEM_PROFILES_ENABLED = "system_profiles_enabled";

    /**
     * Broadcast intent action indicating that Profiles has been enabled or disabled.
     * One extra provides this state as an int.
     *
     * @see #EXTRA_PROFILES_STATE
     * @hide
     */
    @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
    public static final String PROFILES_STATE_CHANGED_ACTION =
        "android.app.profiles.PROFILES_STATE_CHANGED";
    /**
     * The lookup key for an int that indicates whether Profiles are enabled or
     * disabled. Retrieve it with {@link android.content.Intent#getIntExtra(String,int)}.
     *
     * @see #PROFILES_STATE_DISABLED
     * @see #PROFILES_STATE_ENABLED
     * @hide
     */
    public static final String EXTRA_PROFILES_STATE = "profile_state";

    /**
     * Profiles are disabled.
     *
     * @see #PROFILES_STATE_CHANGED_ACTION
     * @hide
     */
    public static final int PROFILES_STATE_DISABLED = 0;
    /**
     * Profiles are enabled.
     *
     * @see #PROFILES_STATE_CHANGED_ACTION
     * @hide
     */
    public static final int PROFILES_STATE_ENABLED = 1;

    // A blank profile that is created to be returned if profiles disabled
    private static Profile mEmptyProfile;