am 429b020e: am 280b4495: am 967c8816: am cfd45ae4: Merge "Add SUPL-specific network bcast" into mnc-dr-dev
* commit '429b020e615eebd244208373c2a3e81c59da36ec': Add SUPL-specific network bcast
This commit is contained in:
committed by
Android Git Automerger
commit
43b0bcbe25
@@ -99,6 +99,16 @@ public class ConnectivityManager {
|
||||
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
|
||||
public static final String CONNECTIVITY_ACTION = "android.net.conn.CONNECTIVITY_CHANGE";
|
||||
|
||||
/**
|
||||
* A temporary hack until SUPL system can get off the legacy APIS.
|
||||
* They do too many network requests and the long list of apps listening
|
||||
* and waking due to the CONNECTIVITY_ACTION bcast makes it expensive.
|
||||
* Use this bcast intent instead for SUPL requests.
|
||||
* @hide
|
||||
*/
|
||||
public static final String CONNECTIVITY_ACTION_SUPL =
|
||||
"android.net.conn.CONNECTIVITY_CHANGE_SUPL";
|
||||
|
||||
/**
|
||||
* The device has connected to a network that has presented a captive
|
||||
* portal, which is blocking Internet connectivity. The user was presented
|
||||
|
||||
@@ -1524,10 +1524,14 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
|
||||
final long ident = Binder.clearCallingIdentity();
|
||||
if (ConnectivityManager.CONNECTIVITY_ACTION.equals(intent.getAction())) {
|
||||
final NetworkInfo ni = intent.getParcelableExtra(
|
||||
ConnectivityManager.EXTRA_NETWORK_INFO);
|
||||
if (ni.getType() == ConnectivityManager.TYPE_MOBILE_SUPL) {
|
||||
intent.setAction(ConnectivityManager.CONNECTIVITY_ACTION_SUPL);
|
||||
intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY);
|
||||
}
|
||||
final IBatteryStats bs = BatteryStatsService.getService();
|
||||
try {
|
||||
NetworkInfo ni = intent.getParcelableExtra(
|
||||
ConnectivityManager.EXTRA_NETWORK_INFO);
|
||||
bs.noteConnectivityChanged(intent.getIntExtra(
|
||||
ConnectivityManager.EXTRA_NETWORK_TYPE, ConnectivityManager.TYPE_NONE),
|
||||
ni != null ? ni.getState().toString() : "?");
|
||||
|
||||
Reference in New Issue
Block a user