Merge "Fix for updating TCP buffer size when switching network type"
This commit is contained in:
@@ -184,8 +184,17 @@ public class MobileDataStateTracker implements NetworkStateTracker {
|
||||
if (!TextUtils.equals(apnType, mApnType)) {
|
||||
return;
|
||||
}
|
||||
mNetworkInfo.setSubtype(TelephonyManager.getDefault().getNetworkType(),
|
||||
TelephonyManager.getDefault().getNetworkTypeName());
|
||||
|
||||
int oldSubtype = mNetworkInfo.getSubtype();
|
||||
int newSubType = TelephonyManager.getDefault().getNetworkType();
|
||||
String subTypeName = TelephonyManager.getDefault().getNetworkTypeName();
|
||||
mNetworkInfo.setSubtype(newSubType, subTypeName);
|
||||
if (newSubType != oldSubtype && mNetworkInfo.isConnected()) {
|
||||
Message msg = mTarget.obtainMessage(EVENT_NETWORK_SUBTYPE_CHANGED,
|
||||
oldSubtype, 0, mNetworkInfo);
|
||||
msg.sendToTarget();
|
||||
}
|
||||
|
||||
PhoneConstants.DataState state = Enum.valueOf(PhoneConstants.DataState.class,
|
||||
intent.getStringExtra(PhoneConstants.STATE_KEY));
|
||||
String reason = intent.getStringExtra(PhoneConstants.STATE_CHANGE_REASON_KEY);
|
||||
|
||||
@@ -68,6 +68,12 @@ public interface NetworkStateTracker {
|
||||
*/
|
||||
public static final int EVENT_RESTORE_DEFAULT_NETWORK = 6;
|
||||
|
||||
/**
|
||||
* msg.what = EVENT_NETWORK_SUBTYPE_CHANGED
|
||||
* msg.obj = NetworkInfo object
|
||||
*/
|
||||
public static final int EVENT_NETWORK_SUBTYPE_CHANGED = 7;
|
||||
|
||||
/**
|
||||
* -------------------------------------------------------------
|
||||
* Control Interface
|
||||
|
||||
@@ -2490,6 +2490,11 @@ private NetworkStateTracker makeWimaxStateTracker() {
|
||||
// @see bug/4455071
|
||||
handleConnectivityChange(info.getType(), false);
|
||||
break;
|
||||
case NetworkStateTracker.EVENT_NETWORK_SUBTYPE_CHANGED:
|
||||
info = (NetworkInfo) msg.obj;
|
||||
type = info.getType();
|
||||
updateNetworkSettings(mNetTrackers[type]);
|
||||
break;
|
||||
case EVENT_CLEAR_NET_TRANSITION_WAKELOCK:
|
||||
String causedBy = null;
|
||||
synchronized (ConnectivityService.this) {
|
||||
|
||||
Reference in New Issue
Block a user