AI 144185: Integrate cdma into the main code base.
Automated import of CL 144185
This commit is contained in:

committed by
The Android Open Source Project
parent
b20dd917e2
commit
f9e024198d
@@ -94,7 +94,7 @@ public class RadioInfo extends Activity {
|
||||
private static final int MENU_ITEM_TOGGLE_DATA = 5;
|
||||
private static final int MENU_ITEM_TOGGLE_DATA_ON_BOOT = 6;
|
||||
|
||||
private TextView mImei;
|
||||
private TextView mDeviceId; //DeviceId is the IMEI in GSM and the MEID in CDMA
|
||||
private TextView number;
|
||||
private TextView callState;
|
||||
private TextView operatorName;
|
||||
@@ -405,7 +405,7 @@ public class RadioInfo extends Activity {
|
||||
mTelephonyManager = (TelephonyManager)getSystemService(TELEPHONY_SERVICE);
|
||||
phone = PhoneFactory.getDefaultPhone();
|
||||
|
||||
mImei = (TextView) findViewById(R.id.imei);
|
||||
mDeviceId= (TextView) findViewById(R.id.imei);
|
||||
number = (TextView) findViewById(R.id.number);
|
||||
callState = (TextView) findViewById(R.id.call);
|
||||
operatorName = (TextView) findViewById(R.id.operator);
|
||||
@@ -518,7 +518,8 @@ public class RadioInfo extends Activity {
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
menu.add(0, MENU_ITEM_SELECT_BAND, 0, R.string.radio_info_band_mode_label).setOnMenuItemClickListener(mSelectBandCallback)
|
||||
menu.add(0, MENU_ITEM_SELECT_BAND, 0, R.string.radio_info_band_mode_label)
|
||||
.setOnMenuItemClickListener(mSelectBandCallback)
|
||||
.setAlphabeticShortcut('b');
|
||||
menu.add(1, MENU_ITEM_VIEW_ADN, 0,
|
||||
R.string.radioInfo_menu_viewADN).setOnMenuItemClickListener(mViewADNCallback);
|
||||
@@ -531,14 +532,14 @@ public class RadioInfo extends Activity {
|
||||
menu.add(1, MENU_ITEM_TOGGLE_DATA,
|
||||
0, R.string.radioInfo_menu_disableData).setOnMenuItemClickListener(mToggleData);
|
||||
menu.add(1, MENU_ITEM_TOGGLE_DATA_ON_BOOT,
|
||||
0, R.string.radioInfo_menu_disableDataOnBoot).setOnMenuItemClickListener(mToggleDataOnBoot);
|
||||
0, R.string.radioInfo_menu_disableDataOnBoot).setOnMenuItemClickListener(
|
||||
mToggleDataOnBoot);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onPrepareOptionsMenu(Menu menu)
|
||||
{
|
||||
public boolean onPrepareOptionsMenu(Menu menu) {
|
||||
// Get the TOGGLE DATA menu item in the right state.
|
||||
MenuItem item = menu.findItem(MENU_ITEM_TOGGLE_DATA);
|
||||
int state = mTelephonyManager.getDataState();
|
||||
@@ -575,11 +576,10 @@ public class RadioInfo extends Activity {
|
||||
}
|
||||
|
||||
private void updatePowerState() {
|
||||
//log("updatePowerState");
|
||||
String buttonText = isRadioOn() ?
|
||||
getString(R.string.turn_off_radio) :
|
||||
getString(R.string.turn_on_radio);
|
||||
radioPowerButton.setText(buttonText);
|
||||
radioPowerButton.setText(buttonText);
|
||||
}
|
||||
|
||||
private void updateQxdmState(Boolean newQxdmStatus) {
|
||||
@@ -650,11 +650,15 @@ public class RadioInfo extends Activity {
|
||||
}
|
||||
|
||||
private final void updateLocation(CellLocation location) {
|
||||
GsmCellLocation loc = (GsmCellLocation)location;
|
||||
Resources r = getResources();
|
||||
int lac = -1;
|
||||
int cid = -1;
|
||||
if (location instanceof GsmCellLocation) {
|
||||
GsmCellLocation loc = (GsmCellLocation)location;
|
||||
lac = loc.getLac();
|
||||
cid = loc.getCid();
|
||||
}
|
||||
|
||||
int lac = loc.getLac();
|
||||
int cid = loc.getCid();
|
||||
Resources r = getResources();
|
||||
|
||||
mLocation.setText(r.getString(R.string.radioInfo_lac) + " = "
|
||||
+ ((lac == -1) ? "unknown" : Integer.toHexString(lac))
|
||||
@@ -782,8 +786,9 @@ public class RadioInfo extends Activity {
|
||||
|
||||
s = phone.getDeviceId();
|
||||
if (s == null) s = r.getString(R.string.radioInfo_unknown);
|
||||
mImei.setText(s);
|
||||
mDeviceId.setText(s);
|
||||
|
||||
|
||||
s = phone.getLine1Number();
|
||||
if (s == null) s = r.getString(R.string.radioInfo_unknown);
|
||||
number.setText(s);
|
||||
@@ -1030,7 +1035,7 @@ public class RadioInfo extends Activity {
|
||||
private MenuItem.OnMenuItemClickListener mViewSDNCallback = new MenuItem.OnMenuItemClickListener() {
|
||||
public boolean onMenuItemClick(MenuItem item) {
|
||||
Intent intent = new Intent(
|
||||
Intent.ACTION_VIEW, Uri.parse("content://sim/sdn"));
|
||||
Intent.ACTION_VIEW, Uri.parse("content://icc/sdn"));
|
||||
// XXX We need to specify the component here because if we don't
|
||||
// the activity manager will try to resolve the type by calling
|
||||
// the content provider, which causes it to be loaded in a process
|
||||
@@ -1085,7 +1090,7 @@ public class RadioInfo extends Activity {
|
||||
|
||||
private MenuItem.OnMenuItemClickListener mGetPdpList = new MenuItem.OnMenuItemClickListener() {
|
||||
public boolean onMenuItemClick(MenuItem item) {
|
||||
phone.getPdpContextList(null);
|
||||
phone.getDataCallList(null);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
@@ -1122,8 +1127,7 @@ public class RadioInfo extends Activity {
|
||||
|
||||
OnClickListener mDnsCheckButtonHandler = new OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
GSMPhone gsmPhone = (GSMPhone) phone;
|
||||
gsmPhone.disableDnsCheck(!gsmPhone.isDnsCheckDisabled());
|
||||
phone.disableDnsCheck(!phone.isDnsCheckDisabled());
|
||||
updateDnsCheckState();
|
||||
}
|
||||
};
|
||||
@@ -1182,3 +1186,4 @@ public class RadioInfo extends Activity {
|
||||
private String[] mPreferredNetworkLabels = {
|
||||
"WCDMA preferred", "GSM only", "WCDMA only", "Unknown"};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user