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:
Jeff Sharkey
2011-08-29 16:02:57 -07:00
parent 0a7279c958
commit 971cd16561
3 changed files with 39 additions and 17 deletions

View File

@@ -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)}.