AI 144245: Fix merge conflict for megering in the CDMA changes in to master from donutburger.
Automated import of CL 144245
This commit is contained in:
committed by
The Android Open Source Project
parent
3afdd56470
commit
04e71b3db8
@@ -117,28 +117,28 @@ public class MobileDataStateTracker extends NetworkStateTracker {
|
||||
mMobileDataState = state;
|
||||
|
||||
switch (state) {
|
||||
case DISCONNECTED:
|
||||
setDetailedState(DetailedState.DISCONNECTED, reason, apnName);
|
||||
if (mInterfaceName != null) {
|
||||
NetworkUtils.resetConnections(mInterfaceName);
|
||||
}
|
||||
mInterfaceName = null;
|
||||
mDefaultGatewayAddr = 0;
|
||||
break;
|
||||
case CONNECTING:
|
||||
setDetailedState(DetailedState.CONNECTING, reason, apnName);
|
||||
break;
|
||||
case SUSPENDED:
|
||||
setDetailedState(DetailedState.SUSPENDED, reason, apnName);
|
||||
break;
|
||||
case CONNECTED:
|
||||
mInterfaceName = intent.getStringExtra(Phone.DATA_IFACE_NAME_KEY);
|
||||
if (mInterfaceName == null) {
|
||||
Log.d(TAG, "CONNECTED event did not supply interface name.");
|
||||
}
|
||||
setupDnsProperties();
|
||||
setDetailedState(DetailedState.CONNECTED, reason, apnName);
|
||||
break;
|
||||
case DISCONNECTED:
|
||||
setDetailedState(DetailedState.DISCONNECTED, reason, apnName);
|
||||
if (mInterfaceName != null) {
|
||||
NetworkUtils.resetConnections(mInterfaceName);
|
||||
}
|
||||
mInterfaceName = null;
|
||||
mDefaultGatewayAddr = 0;
|
||||
break;
|
||||
case CONNECTING:
|
||||
setDetailedState(DetailedState.CONNECTING, reason, apnName);
|
||||
break;
|
||||
case SUSPENDED:
|
||||
setDetailedState(DetailedState.SUSPENDED, reason, apnName);
|
||||
break;
|
||||
case CONNECTED:
|
||||
mInterfaceName = intent.getStringExtra(Phone.DATA_IFACE_NAME_KEY);
|
||||
if (mInterfaceName == null) {
|
||||
Log.d(TAG, "CONNECTED event did not supply interface name.");
|
||||
}
|
||||
setupDnsProperties();
|
||||
setDetailedState(DetailedState.CONNECTED, reason, apnName);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (intent.getAction().equals(TelephonyIntents.ACTION_DATA_CONNECTION_FAILED)) {
|
||||
@@ -199,7 +199,7 @@ public class MobileDataStateTracker extends NetworkStateTracker {
|
||||
*/
|
||||
public boolean isAvailable() {
|
||||
getPhoneService(false);
|
||||
|
||||
|
||||
/*
|
||||
* If the phone process has crashed in the past, we'll get a
|
||||
* RemoteException and need to re-reference the service.
|
||||
@@ -214,7 +214,7 @@ public class MobileDataStateTracker extends NetworkStateTracker {
|
||||
if (retry == 0) getPhoneService(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -241,18 +241,28 @@ public class MobileDataStateTracker extends NetworkStateTracker {
|
||||
* for this network.
|
||||
*/
|
||||
public String getTcpBufferSizesPropName() {
|
||||
String networkTypeStr = "unknown";
|
||||
String networkTypeStr = "unknown";
|
||||
TelephonyManager tm = new TelephonyManager(mContext);
|
||||
//TODO We have to edit the parameter for getNetworkType regarding CDMA
|
||||
switch(tm.getNetworkType()) {
|
||||
case TelephonyManager.NETWORK_TYPE_GPRS:
|
||||
case TelephonyManager.NETWORK_TYPE_GPRS:
|
||||
networkTypeStr = "gprs";
|
||||
break;
|
||||
case TelephonyManager.NETWORK_TYPE_EDGE:
|
||||
case TelephonyManager.NETWORK_TYPE_EDGE:
|
||||
networkTypeStr = "edge";
|
||||
break;
|
||||
case TelephonyManager.NETWORK_TYPE_UMTS:
|
||||
case TelephonyManager.NETWORK_TYPE_UMTS:
|
||||
networkTypeStr = "umts";
|
||||
break;
|
||||
case TelephonyManager.NETWORK_TYPE_CDMA:
|
||||
networkTypeStr = "cdma";
|
||||
break;
|
||||
case TelephonyManager.NETWORK_TYPE_EVDO_0:
|
||||
networkTypeStr = "evdo";
|
||||
break;
|
||||
case TelephonyManager.NETWORK_TYPE_EVDO_A:
|
||||
networkTypeStr = "evdo";
|
||||
break;
|
||||
}
|
||||
return "net.tcp.buffersize." + networkTypeStr;
|
||||
}
|
||||
@@ -281,7 +291,7 @@ public class MobileDataStateTracker extends NetworkStateTracker {
|
||||
if (retry == 0) getPhoneService(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Log.w(TAG, "Failed to tear down mobile data connectivity");
|
||||
return false;
|
||||
}
|
||||
@@ -330,7 +340,7 @@ public class MobileDataStateTracker extends NetworkStateTracker {
|
||||
"Ignoring mobile radio request because could not acquire PhoneService");
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
return mPhoneService.setRadio(turnOn);
|
||||
} catch (RemoteException e) {
|
||||
|
||||
@@ -132,6 +132,7 @@ public final class Checkin {
|
||||
BROWSER_SNAP_CENTER,
|
||||
BROWSER_TEXT_SIZE_CHANGE,
|
||||
BROWSER_ZOOM_OVERVIEW,
|
||||
|
||||
CRASHES_REPORTED,
|
||||
CRASHES_TRUNCATED,
|
||||
ELAPSED_REALTIME_SEC,
|
||||
@@ -181,6 +182,9 @@ public final class Checkin {
|
||||
MARKET_REASON_PARSE_MANIFEST_EMPTY,
|
||||
MARKET_REASON_UNKNOWN,
|
||||
MARKET_STALE_INSTALL_ATTEMPT,
|
||||
PHONE_CDMA_REGISTERED,
|
||||
PHONE_CDMA_DATA_ATTEMPTED,
|
||||
PHONE_CDMA_DATA_CONNECTED,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -347,3 +351,6 @@ public final class Checkin {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2049,6 +2049,70 @@ public final class Settings {
|
||||
* @hide pending API council
|
||||
*/
|
||||
public static final String BACKGROUND_DATA = "background_data";
|
||||
|
||||
/**
|
||||
* The CDMA roaming mode 0 = Home Networks, CDMA default
|
||||
* 1 = Roaming on Affiliated networks
|
||||
* 2 = Roaming on any networks
|
||||
* @hide
|
||||
*/
|
||||
public static final String CDMA_ROAMING_MODE = "roaming_settings";
|
||||
|
||||
/**
|
||||
* The CDMA subscription mode 0 = RUIM/SIM (default)
|
||||
* 1 = NV
|
||||
* @hide
|
||||
*/
|
||||
public static final String CDMA_SUBSCRIPTION_MODE = "subscription_mode";
|
||||
|
||||
/**
|
||||
* represents current active phone class
|
||||
* 1 = GSM-Phone, 0 = CDMA-Phone
|
||||
* @hide
|
||||
*/
|
||||
public static final String CURRENT_ACTIVE_PHONE = "current_active_phone";
|
||||
|
||||
/**
|
||||
* The preferred network mode 7 = Global, CDMA default
|
||||
* 4 = CDMA only
|
||||
* 3 = GSM/UMTS only
|
||||
* @hide
|
||||
*/
|
||||
public static final String PREFERRED_NETWORK_MODE =
|
||||
"preferred_network_mode";
|
||||
|
||||
/**
|
||||
* CDMA Cell Broadcast SMS
|
||||
* 0 = CDMA Cell Broadcast SMS disabled
|
||||
* 1 = CDMA Cell Broadcast SMS enabled
|
||||
* @hide
|
||||
*/
|
||||
public static final String CDMA_CELL_BROADCAST_SMS =
|
||||
"cdma_cell_broadcast_sms";
|
||||
|
||||
/**
|
||||
* The cdma subscription 0 = Subscription from RUIM, when available
|
||||
* 1 = Subscription from NV
|
||||
* @hide
|
||||
*/
|
||||
public static final String PREFERRED_CDMA_SUBSCRIPTION =
|
||||
"preferred_cdma_subscription";
|
||||
|
||||
/**
|
||||
* Whether the enhanced voice privacy mode is enabled.
|
||||
* 0 = normal voice privacy
|
||||
* 1 = enhanced voice privacy
|
||||
* @hide
|
||||
*/
|
||||
public static final String ENHANCED_VOICE_PRIVACY_ENABLED = "enhanced_voice_privacy_enabled";
|
||||
|
||||
/**
|
||||
* Whether the TTY mode mode is enabled.
|
||||
* 0 = disabled
|
||||
* 1 = enabled
|
||||
* @hide
|
||||
*/
|
||||
public static final String TTY_MODE_ENABLED = "tty_mode_enabled";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3127,13 +3191,13 @@ public final class Settings {
|
||||
throw new RuntimeException("this should never happen");
|
||||
}
|
||||
|
||||
String imei = TelephonyManager.getDefault().getDeviceId();
|
||||
if (TextUtils.isEmpty(imei)) {
|
||||
String deviceId = TelephonyManager.getDefault().getDeviceId();
|
||||
if (TextUtils.isEmpty(deviceId)) {
|
||||
return "";
|
||||
}
|
||||
|
||||
byte[] hashedImei = digest.digest(imei.getBytes());
|
||||
String id = new String(Base64.encodeBase64(hashedImei), 0, 12);
|
||||
byte[] hashedDeviceId = digest.digest(deviceId.getBytes());
|
||||
String id = new String(Base64.encodeBase64(hashedDeviceId), 0, 12);
|
||||
id = id.replaceAll("/", "_");
|
||||
sJidResource = JID_RESOURCE_PREFIX + id;
|
||||
return sJidResource;
|
||||
@@ -3152,3 +3216,4 @@ public final class Settings {
|
||||
return "android-" + Long.toHexString(androidId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.telephony.gsm.SmsMessage;
|
||||
import android.telephony.SmsMessage;
|
||||
import android.text.TextUtils;
|
||||
import android.text.util.Regex;
|
||||
import android.util.Config;
|
||||
@@ -47,6 +47,10 @@ public final class Telephony {
|
||||
private static final boolean DEBUG = false;
|
||||
private static final boolean LOCAL_LOGV = DEBUG ? Config.LOGD : Config.LOGV;
|
||||
|
||||
// Constructor
|
||||
public Telephony() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Base columns for tables that contain text based SMSs.
|
||||
*/
|
||||
@@ -1601,3 +1605,5 @@ public final class Telephony {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -46,6 +46,9 @@ public final class AndroidRadioDataProvider extends PhoneStateListener {
|
||||
private static final int RADIO_TYPE_UNKNOWN = 0;
|
||||
private static final int RADIO_TYPE_GSM = 1;
|
||||
private static final int RADIO_TYPE_WCDMA = 2;
|
||||
private static final int RADIO_TYPE_CDMA = 3;
|
||||
private static final int RADIO_TYPE_EVDO = 4;
|
||||
private static final int RADIO_TYPE_1xRTT = 5;
|
||||
|
||||
/** Simple container for radio data */
|
||||
public static final class RadioData {
|
||||
@@ -102,12 +105,21 @@ public final class AndroidRadioDataProvider extends PhoneStateListener {
|
||||
}
|
||||
|
||||
// Finally get the radio type.
|
||||
//TODO We have to edit the parameter for getNetworkType regarding CDMA
|
||||
int type = telephonyManager.getNetworkType();
|
||||
if (type == TelephonyManager.NETWORK_TYPE_UMTS) {
|
||||
radioData.radioType = RADIO_TYPE_WCDMA;
|
||||
} else if (type == TelephonyManager.NETWORK_TYPE_GPRS
|
||||
|| type == TelephonyManager.NETWORK_TYPE_EDGE) {
|
||||
radioData.radioType = RADIO_TYPE_GSM;
|
||||
} else if (type == TelephonyManager.NETWORK_TYPE_CDMA) {
|
||||
radioData.radioType = RADIO_TYPE_CDMA;
|
||||
} else if (type == TelephonyManager.NETWORK_TYPE_EVDO_0) {
|
||||
radioData.radioType = RADIO_TYPE_EVDO;
|
||||
} else if (type == TelephonyManager.NETWORK_TYPE_EVDO_A) {
|
||||
radioData.radioType = RADIO_TYPE_EVDO;
|
||||
} else if (type == TelephonyManager.NETWORK_TYPE_1xRTT) {
|
||||
radioData.radioType = RADIO_TYPE_1xRTT;
|
||||
}
|
||||
|
||||
// Print out what we got.
|
||||
|
||||
Reference in New Issue
Block a user