Update Inet Connection Status display
Cellular signal strength should also be green - these assets aren't, but the art guys are working on that. Also using a new intent so we don't overload the CONNECTIVITY_ACTION and confuse the apps. bug:2994024 Change-Id: I6fe8f65dd6e9869d9724064c4fae45340491a4d8
This commit is contained in:
@@ -123,6 +123,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
|
||||
|
||||
@@ -1008,7 +1008,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);
|
||||
@@ -1512,7 +1520,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
||||
break;
|
||||
}
|
||||
mDefaultInetConditionPublished = mDefaultInetCondition;
|
||||
sendConnectedBroadcast(networkInfo);
|
||||
sendInetConditionBroadcast(networkInfo);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user