diff options
author | Wink Saville <> | 2009-04-02 01:37:03 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-04-02 01:37:03 -0700 |
commit | f9e024198d3b16454287888bd5d40fee23390d23 (patch) | |
tree | 111fcc6911cc13c20c271ce793b7124a55fba0dd /src/com/android/settings/RadioInfo.java | |
parent | b20dd917e2d29045225985baa980a2a8e22e10fc (diff) | |
download | packages_apps_Settings-f9e024198d3b16454287888bd5d40fee23390d23.zip packages_apps_Settings-f9e024198d3b16454287888bd5d40fee23390d23.tar.gz packages_apps_Settings-f9e024198d3b16454287888bd5d40fee23390d23.tar.bz2 |
AI 144185: Integrate cdma into the main code base.
Automated import of CL 144185
Diffstat (limited to 'src/com/android/settings/RadioInfo.java')
-rw-r--r-- | src/com/android/settings/RadioInfo.java | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/src/com/android/settings/RadioInfo.java b/src/com/android/settings/RadioInfo.java index 5df9313..b624c7a 100644 --- a/src/com/android/settings/RadioInfo.java +++ b/src/com/android/settings/RadioInfo.java @@ -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"}; } + |