am 134b28a7: Merge "Update Inet Connection Status display" into gingerbread
Merge commit '134b28a7f049719cb74fd5baadbbcc5915bc861b' into gingerbread-plus-aosp * commit '134b28a7f049719cb74fd5baadbbcc5915bc861b': Update Inet Connection Status display
This commit is contained in:
@@ -126,6 +126,17 @@ public class ConnectivityManager
|
||||
public static final String ACTION_BACKGROUND_DATA_SETTING_CHANGED =
|
||||
"android.net.conn.BACKGROUND_DATA_SETTING_CHANGED";
|
||||
|
||||
|
||||
/**
|
||||
* Broadcast Action: The network connection may not be good
|
||||
* uses {@code ConnectivityManager.EXTRA_INET_CONDITION} and
|
||||
* {@code ConnectivityManager.EXTRA_NETWORK_INFO} to specify
|
||||
* the network and it's condition.
|
||||
* @hide
|
||||
*/
|
||||
public static final String INET_CONDITION_ACTION =
|
||||
"android.net.conn.INET_CONDITION_ACTION";
|
||||
|
||||
/**
|
||||
* Broadcast Action: A tetherable connection has come or gone
|
||||
* TODO - finish the doc
|
||||
|
||||
@@ -1039,7 +1039,15 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
||||
}
|
||||
|
||||
private void sendConnectedBroadcast(NetworkInfo info) {
|
||||
Intent intent = new Intent(ConnectivityManager.CONNECTIVITY_ACTION);
|
||||
sendGeneralBroadcast(info, ConnectivityManager.CONNECTIVITY_ACTION);
|
||||
}
|
||||
|
||||
private void sendInetConditionBroadcast(NetworkInfo info) {
|
||||
sendGeneralBroadcast(info, ConnectivityManager.INET_CONDITION_ACTION);
|
||||
}
|
||||
|
||||
private void sendGeneralBroadcast(NetworkInfo info, String bcastType) {
|
||||
Intent intent = new Intent(bcastType);
|
||||
intent.putExtra(ConnectivityManager.EXTRA_NETWORK_INFO, info);
|
||||
if (info.isFailover()) {
|
||||
intent.putExtra(ConnectivityManager.EXTRA_IS_FAILOVER, true);
|
||||
@@ -1543,7 +1551,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
||||
break;
|
||||
}
|
||||
mDefaultInetConditionPublished = mDefaultInetCondition;
|
||||
sendConnectedBroadcast(networkInfo);
|
||||
sendInetConditionBroadcast(networkInfo);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user