diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java index 92c721bdb0..f7729340ad 100644 --- a/core/java/android/net/ConnectivityManager.java +++ b/core/java/android/net/ConnectivityManager.java @@ -3215,11 +3215,24 @@ public class ConnectivityManager { /** * Device is restricting metered network activity while application is running on background. + *

* In this state, application should not try to use the network while running on background, * because it would be denied. */ public static final int RESTRICT_BACKGROUND_STATUS_ENABLED = 3; + /** + * A change in the background metered network activity restriction has occurred. + *

+ * Applications should call {@link #getRestrictBackgroundStatus()} to check if the restriction + * applies to them. + *

+ * This is only sent to registered receivers, not manifest receivers. + */ + @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) + public static final String ACTION_RESTRICT_BACKGROUND_CHANGED = + "android.net.conn.RESTRICT_BACKGROUND_CHANGED"; + /** @hide */ @Retention(RetentionPolicy.SOURCE) @IntDef(flag = false, value = {