Introduce immediate CONNECTIVITY_ACTION variant.
New broadcast that is dispatched immediately after connectivity changes have been handled by ConnectivityService, bypassing any applicable CONNECTIVITY_CHANGE_DELAY. Also protect CONNECTIVITY_CHANGE broadcasts, since they should only be sent by system. Bug: 5198167 Change-Id: I75f1fb44b21da1879f0ab960bcaa481126d70fde
This commit is contained in:
@@ -23,6 +23,7 @@ import android.annotation.SdkConstant.SdkConstantType;
|
||||
import android.os.Binder;
|
||||
import android.os.Build.VERSION_CODES;
|
||||
import android.os.RemoteException;
|
||||
import android.provider.Settings;
|
||||
|
||||
import java.net.InetAddress;
|
||||
|
||||
@@ -70,6 +71,15 @@ public class ConnectivityManager {
|
||||
*/
|
||||
public static final String CONNECTIVITY_ACTION = "android.net.conn.CONNECTIVITY_CHANGE";
|
||||
|
||||
/**
|
||||
* Identical to {@link #CONNECTIVITY_ACTION} broadcast, but sent without any
|
||||
* applicable {@link Settings.Secure#CONNECTIVITY_CHANGE_DELAY}.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static final String CONNECTIVITY_ACTION_IMMEDIATE =
|
||||
"android.net.conn.CONNECTIVITY_CHANGE_IMMEDIATE";
|
||||
|
||||
/**
|
||||
* The lookup key for a {@link NetworkInfo} object. Retrieve with
|
||||
* {@link android.content.Intent#getParcelableExtra(String)}.
|
||||
|
||||
Reference in New Issue
Block a user