From 51fcccb3bb8b96aad142ec480e23484c3454b703 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Thu, 9 Jan 2020 05:47:41 -0800 Subject: [PATCH 1/2] Intent: Promote broadcast flag needed by wifi to @SystemApi FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT is used by wifi mainline module, promoting to a @SystemApi. Bug: 147374337 Test: Compiles Change-Id: Ib822706700533c0b79833504dad5c8d5253d5d55 --- api/system-current.txt | 1 + core/java/android/content/Intent.java | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/api/system-current.txt b/api/system-current.txt index 75e8f462f4c3e..27fcc38cdf8e1 100755 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -1781,6 +1781,7 @@ package android.content { field @Deprecated public static final String EXTRA_SIM_STATE = "ss"; field public static final String EXTRA_UNKNOWN_INSTANT_APP = "android.intent.extra.UNKNOWN_INSTANT_APP"; field public static final String EXTRA_VERIFICATION_BUNDLE = "android.intent.extra.VERIFICATION_BUNDLE"; + field public static final int FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT = 67108864; // 0x4000000 field public static final String METADATA_SETUP_VERSION = "android.SETUP_VERSION"; field @Deprecated public static final String SIM_ABSENT_ON_PERM_DISABLED = "PERM_DISABLED"; field @Deprecated public static final String SIM_LOCKED_NETWORK = "NETWORK"; diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index 3bb0f92222370..c8f587f71bca8 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -6440,19 +6440,22 @@ public class Intent implements Parcelable, Cloneable { */ public static final int FLAG_RECEIVER_NO_ABORT = 0x08000000; /** - * If set, when sending a broadcast before boot has completed only + * If set, when sending a broadcast before the system has fully booted up + * (which is even before {@link #ACTION_LOCKED_BOOT_COMPLETED} has been sent)" only * registered receivers will be called -- no BroadcastReceiver components * will be launched. Sticky intent state will be recorded properly even * if no receivers wind up being called. If {@link #FLAG_RECEIVER_REGISTERED_ONLY} * is specified in the broadcast intent, this flag is unnecessary. * - *

This flag is only for use by system sevices as a convenience to - * avoid having to implement a more complex mechanism around detection + *

This flag is only for use by system services (even services from mainline modules) as a + * convenience to avoid having to implement a more complex mechanism around detection * of boot completion. * + *

This is useful to system server mainline modules + * * @hide */ - @UnsupportedAppUsage + @SystemApi public static final int FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT = 0x04000000; /** * Set when this broadcast is for a boot upgrade, a special mode that From 6769c541e32b5c6bfc011292fe0c4473263b133f Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Fri, 10 Jan 2020 06:51:59 -0800 Subject: [PATCH 2/2] AndroidManifest.xml: Mark NETWORK_SETTINGS_RESET broadcast as protected Bug: 147374337 Test: Ensured that the warning message logged by framework when wifi service sends this broadcast is no longer present. Change-Id: I121b9246b07d75ec6bbb2d15545432fb6e04154c --- core/res/AndroidManifest.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index 03d34b595e4a7..d887032dbdbcb 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -370,6 +370,7 @@ +