diff options
Diffstat (limited to 'core/java/android/content/Context.java')
| -rw-r--r-- | core/java/android/content/Context.java | 103 |
1 files changed, 6 insertions, 97 deletions
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java index 20e1900654aa..4293ab0b7f25 100644 --- a/core/java/android/content/Context.java +++ b/core/java/android/content/Context.java @@ -483,8 +483,8 @@ public abstract class Context { | Context.BIND_NOT_PERCEPTIBLE | Context.BIND_NOT_VISIBLE; /** @hide */ - @IntDef(flag = true, prefix = { "RECEIVER_VISIBLE" }, value = { - RECEIVER_VISIBLE_TO_INSTANT_APPS, RECEIVER_EXPORTED, RECEIVER_NOT_EXPORTED + @IntDef(flag = true, prefix = { "RECEIVER_VISIBLE_" }, value = { + RECEIVER_VISIBLE_TO_INSTANT_APPS }) @Retention(RetentionPolicy.SOURCE) public @interface RegisterReceiverFlags {} @@ -495,18 +495,6 @@ public abstract class Context { public static final int RECEIVER_VISIBLE_TO_INSTANT_APPS = 0x1; /** - * Flag for {@link #registerReceiver}: The receiver can receive broadcasts from other Apps. - * Has the same behavior as marking a statically registered receiver with "exported=true" - */ - public static final int RECEIVER_EXPORTED = 0x2; - - /** - * Flag for {@link #registerReceiver}: The receiver cannot receive broadcasts from other Apps. - * Has the same behavior as marking a statically registered receiver with "exported=false" - */ - public static final int RECEIVER_NOT_EXPORTED = 0x4; - - /** * Returns an AssetManager instance for the application's package. * <p> * <strong>Note:</strong> Implementations of this method should return @@ -2893,12 +2881,8 @@ public abstract class Context { * * @param receiver The BroadcastReceiver to handle the broadcast. * @param filter Selects the Intent broadcasts to be received. - * @param flags Additional options for the receiver. As of - * {@link android.os.Build.VERSION_CODES#TIRAMISU}, either {@link #RECEIVER_EXPORTED} or - * {@link #RECEIVER_NOT_EXPORTED} must be specified if the receiver isn't being registered - * for protected broadcasts, and may additionally specify - * {@link #RECEIVER_VISIBLE_TO_INSTANT_APPS} if {@link #RECEIVER_EXPORTED} is - * specified. + * @param flags Additional options for the receiver. May be 0 or + * {@link #RECEIVER_VISIBLE_TO_INSTANT_APPS}. * * @return The first sticky intent found that matches <var>filter</var>, * or null if there are none. @@ -2970,12 +2954,8 @@ public abstract class Context { * no permission is required. * @param scheduler Handler identifying the thread that will receive * the Intent. If null, the main thread of the process will be used. - * @param flags Additional options for the receiver. As of - * {@link android.os.Build.VERSION_CODES#TIRAMISU}, either {@link #RECEIVER_EXPORTED} or - * {@link #RECEIVER_NOT_EXPORTED} must be specified if the receiver isn't being registered - * for protected broadcasts, and may additionally specify - * {@link #RECEIVER_VISIBLE_TO_INSTANT_APPS} if {@link #RECEIVER_EXPORTED} is - * specified. + * @param flags Additional options for the receiver. May be 0 or + * {@link #RECEIVER_VISIBLE_TO_INSTANT_APPS}. * * @return The first sticky intent found that matches <var>filter</var>, * or null if there are none. @@ -3022,42 +3002,6 @@ public abstract class Context { } /** - * Same as {@link #registerReceiver(BroadcastReceiver, IntentFilter, String, Handler, int)} - * but this receiver will receive broadcasts that are sent to all users. The receiver can - * use {@link BroadcastReceiver#getSendingUser} to determine on which user the broadcast - * was sent. - * - * @param receiver The BroadcastReceiver to handle the broadcast. - * @param filter Selects the Intent broadcasts to be received. - * @param broadcastPermission String naming a permissions that a - * broadcaster must hold in order to send an Intent to you. If {@code null}, - * no permission is required. - * @param scheduler Handler identifying the thread that will receive - * the Intent. If {@code null}, the main thread of the process will be used. - * @param flags Additional options for the receiver. As of - * {@link android.os.Build.VERSION_CODES#TIRAMISU}, either {@link #RECEIVER_EXPORTED} or - * {@link #RECEIVER_NOT_EXPORTED} must be specified if the receiver isn't being - * registered for protected broadcasts - * - * @return The first sticky intent found that matches <var>filter</var>, - * or {@code null} if there are none. - * - * @see #registerReceiver(BroadcastReceiver, IntentFilter, String, Handler, int) - * @see #sendBroadcast - * @see #unregisterReceiver - * @hide - */ - @SuppressLint("IntentBuilderName") - @Nullable - @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) - @SystemApi - public Intent registerReceiverForAllUsers(@Nullable BroadcastReceiver receiver, - @NonNull IntentFilter filter, @Nullable String broadcastPermission, - @Nullable Handler scheduler, @RegisterReceiverFlags int flags) { - throw new RuntimeException("Not implemented. Must override in a subclass."); - } - - /** * @hide * Same as {@link #registerReceiver(BroadcastReceiver, IntentFilter, String, Handler) * but for a specific user. This receiver will receiver broadcasts that @@ -3088,41 +3032,6 @@ public abstract class Context { @Nullable Handler scheduler); /** - * @hide - * Same as {@link #registerReceiver(BroadcastReceiver, IntentFilter, String, Handler, int) - * but for a specific user. This receiver will receiver broadcasts that - * are sent to the requested user. - * - * @param receiver The BroadcastReceiver to handle the broadcast. - * @param user UserHandle to send the intent to. - * @param filter Selects the Intent broadcasts to be received. - * @param broadcastPermission String naming a permissions that a - * broadcaster must hold in order to send an Intent to you. If null, - * no permission is required. - * @param scheduler Handler identifying the thread that will receive - * the Intent. If null, the main thread of the process will be used. - * @param flags Additional options for the receiver. As of - * {@link android.os.Build.VERSION_CODES#TIRAMISU}, either {@link #RECEIVER_EXPORTED} or - * {@link #RECEIVER_NOT_EXPORTED} must be specified if the receiver isn't being - * registered for protected broadcasts - * - * @return The first sticky intent found that matches <var>filter</var>, - * or null if there are none. - * - * @see #registerReceiver(BroadcastReceiver, IntentFilter, String, Handler, int) - * @see #sendBroadcast - * @see #unregisterReceiver - */ - @SuppressWarnings("HiddenAbstractMethod") - @SuppressLint("IntentBuilderName") - @Nullable - @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) - @UnsupportedAppUsage - public abstract Intent registerReceiverAsUser(BroadcastReceiver receiver, - UserHandle user, IntentFilter filter, @Nullable String broadcastPermission, - @Nullable Handler scheduler, @RegisterReceiverFlags int flags); - - /** * Unregister a previously registered BroadcastReceiver. <em>All</em> * filters that have been registered for this BroadcastReceiver will be * removed. |
