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
0e2016789e
commit
c38866843e
@@ -240,7 +240,7 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity android:name="SimLockSettings" android:label="@string/sim_lock_settings"
|
<activity android:name="IccLockSettings" android:label="@string/sim_lock_settings"
|
||||||
android:process="com.android.phone">
|
android:process="com.android.phone">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
@@ -502,3 +502,5 @@
|
|||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -291,6 +291,7 @@
|
|||||||
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
|
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
|
||||||
<string name="radio_info_data_attempts_label">Data attempts:</string>
|
<string name="radio_info_data_attempts_label">Data attempts:</string>
|
||||||
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
|
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
|
||||||
|
|
||||||
<string name="radio_info_gprs_service_label">GPRS service:</string>
|
<string name="radio_info_gprs_service_label">GPRS service:</string>
|
||||||
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
|
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
|
||||||
<string name="radio_info_roaming_label">Roaming:</string>
|
<string name="radio_info_roaming_label">Roaming:</string>
|
||||||
@@ -433,6 +434,25 @@
|
|||||||
<string name="radio_controls_summary">Manage Wi-Fi, Bluetooth, airplane mode, & mobile networks</string>
|
<string name="radio_controls_summary">Manage Wi-Fi, Bluetooth, airplane mode, & mobile networks</string>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- mobile network settings screen, setting check box title -->
|
||||||
|
<string name="roaming">Data roaming</string>
|
||||||
|
<!-- mobile network settings screen, setting option summary text when check box is selected -->
|
||||||
|
<string name="roaming_enable">Connect to data services when roaming</string>
|
||||||
|
<!-- mobile network settings screen, setting option summary text when check box is clear -->
|
||||||
|
<string name="roaming_disable">Connect to data services when roaming</string>
|
||||||
|
<!-- mobile network settings screen, dialog message when you are roaming and clear the "Data roaming" check box -->
|
||||||
|
<string name="roaming_reenable_message">You have lost data connectivity because you left your home network with data roaming turned off.</string>
|
||||||
|
<!-- mobile network settings screen, button on dialog box that appears when you are roaming and clear the "Data roaming" check box -->
|
||||||
|
<string name="roaming_turn_it_on_button">Turn it on</string>
|
||||||
|
<!-- mobile network settings screen, message in dialog box that appears when you select the "Data roaming" check box -->
|
||||||
|
<string name="roaming_warning">Allow data roaming? You may incur significant roaming charges!</string>
|
||||||
|
<!-- mobile network settings screen, title of dialog box that appears when you select the "Data roaming" check box -->
|
||||||
|
<string name="roaming_reenable_title">Attention</string>
|
||||||
|
<!-- mobile network settings screen, setting option name -->
|
||||||
|
<string name="networks">Operator selection</string>
|
||||||
|
<!-- mobile network settings screen, setting option summary text -->
|
||||||
|
<string name="sum_carrier_select">Select a network operator</string>
|
||||||
|
|
||||||
<!-- Date and time settings -->
|
<!-- Date and time settings -->
|
||||||
<!-- Main Settings screen setting option name to go into the date and time settings-->
|
<!-- Main Settings screen setting option name to go into the date and time settings-->
|
||||||
<string name="date_and_time_settings_title">Date & time</string>
|
<string name="date_and_time_settings_title">Date & time</string>
|
||||||
@@ -1528,3 +1548,5 @@ found in the list of installed applications.</string>
|
|||||||
<!-- label for usage time -->
|
<!-- label for usage time -->
|
||||||
<string name="usage_time_label">Usage time</string>
|
<string name="usage_time_label">Usage time</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
||||||
|
|
||||||
|
@@ -202,7 +202,7 @@ public class ApnEditor extends PreferenceActivity
|
|||||||
mApnType.setText(mCursor.getString(TYPE_INDEX));
|
mApnType.setText(mCursor.getString(TYPE_INDEX));
|
||||||
if (mNewApn) {
|
if (mNewApn) {
|
||||||
String numeric =
|
String numeric =
|
||||||
SystemProperties.get(TelephonyProperties.PROPERTY_SIM_OPERATOR_NUMERIC);
|
SystemProperties.get(TelephonyProperties.PROPERTY_ICC_OPERATOR_NUMERIC);
|
||||||
// MCC is first 3 chars and then in 2 - 3 chars of MNC
|
// MCC is first 3 chars and then in 2 - 3 chars of MNC
|
||||||
if (numeric != null && numeric.length() > 4) {
|
if (numeric != null && numeric.length() > 4) {
|
||||||
// Country code
|
// Country code
|
||||||
|
@@ -146,7 +146,7 @@ public class ApnSettings extends PreferenceActivity implements
|
|||||||
|
|
||||||
private void fillList() {
|
private void fillList() {
|
||||||
String where = "numeric=\""
|
String where = "numeric=\""
|
||||||
+ android.os.SystemProperties.get(TelephonyProperties.PROPERTY_SIM_OPERATOR_NUMERIC, "")
|
+ android.os.SystemProperties.get(TelephonyProperties.PROPERTY_ICC_OPERATOR_NUMERIC, "")
|
||||||
+ "\"";
|
+ "\"";
|
||||||
|
|
||||||
Cursor cursor = managedQuery(Telephony.Carriers.CONTENT_URI, new String[] {
|
Cursor cursor = managedQuery(Telephony.Carriers.CONTENT_URI, new String[] {
|
||||||
|
@@ -22,35 +22,36 @@ import android.os.AsyncResult;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
|
import android.preference.CheckBoxPreference;
|
||||||
import android.preference.Preference;
|
import android.preference.Preference;
|
||||||
import android.preference.PreferenceActivity;
|
import android.preference.PreferenceActivity;
|
||||||
import android.preference.CheckBoxPreference;
|
|
||||||
import android.preference.PreferenceScreen;
|
import android.preference.PreferenceScreen;
|
||||||
import com.android.internal.telephony.Phone;
|
|
||||||
import com.android.internal.telephony.PhoneFactory;
|
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.android.internal.telephony.Phone;
|
||||||
|
import com.android.internal.telephony.PhoneFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implements the preference screen to enable/disable SIM lock and
|
* Implements the preference screen to enable/disable ICC lock and
|
||||||
* also the dialogs to change the SIM PIN. In the former case, enabling/disabling
|
* also the dialogs to change the ICC PIN. In the former case, enabling/disabling
|
||||||
* the SIM lock will prompt the user for the current PIN.
|
* the ICC lock will prompt the user for the current PIN.
|
||||||
* In the Change PIN case, it prompts the user for old pin, new pin and new pin
|
* In the Change PIN case, it prompts the user for old pin, new pin and new pin
|
||||||
* again before attempting to change it. Calls the SimCard interface to execute
|
* again before attempting to change it. Calls the SimCard interface to execute
|
||||||
* these operations.
|
* these operations.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class SimLockSettings extends PreferenceActivity
|
public class IccLockSettings extends PreferenceActivity
|
||||||
implements EditPinPreference.OnPinEnteredListener {
|
implements EditPinPreference.OnPinEnteredListener {
|
||||||
|
|
||||||
private static final int OFF_MODE = 0;
|
private static final int OFF_MODE = 0;
|
||||||
// State when enabling/disabling SIM lock
|
// State when enabling/disabling ICC lock
|
||||||
private static final int SIM_LOCK_MODE = 1;
|
private static final int ICC_LOCK_MODE = 1;
|
||||||
// State when entering the old pin
|
// State when entering the old pin
|
||||||
private static final int SIM_OLD_MODE = 2;
|
private static final int ICC_OLD_MODE = 2;
|
||||||
// State when entering the new pin - first time
|
// State when entering the new pin - first time
|
||||||
private static final int SIM_NEW_MODE = 3;
|
private static final int ICC_NEW_MODE = 3;
|
||||||
// State when entering the new pin - second time
|
// State when entering the new pin - second time
|
||||||
private static final int SIM_REENTER_MODE = 4;
|
private static final int ICC_REENTER_MODE = 4;
|
||||||
|
|
||||||
// Keys in xml file
|
// Keys in xml file
|
||||||
private static final String PIN_DIALOG = "sim_pin";
|
private static final String PIN_DIALOG = "sim_pin";
|
||||||
@@ -70,7 +71,7 @@ public class SimLockSettings extends PreferenceActivity
|
|||||||
private String mOldPin;
|
private String mOldPin;
|
||||||
private String mNewPin;
|
private String mNewPin;
|
||||||
private String mError;
|
private String mError;
|
||||||
// Are we trying to enable or disable SIM lock?
|
// Are we trying to enable or disable ICC lock?
|
||||||
private boolean mToState;
|
private boolean mToState;
|
||||||
|
|
||||||
private Phone mPhone;
|
private Phone mPhone;
|
||||||
@@ -81,19 +82,19 @@ public class SimLockSettings extends PreferenceActivity
|
|||||||
private Resources mRes;
|
private Resources mRes;
|
||||||
|
|
||||||
// For async handler to identify request type
|
// For async handler to identify request type
|
||||||
private static final int ENABLE_SIM_PIN_COMPLETE = 100;
|
private static final int ENABLE_ICC_PIN_COMPLETE = 100;
|
||||||
private static final int CHANGE_SIM_PIN_COMPLETE = 101;
|
private static final int CHANGE_ICC_PIN_COMPLETE = 101;
|
||||||
|
|
||||||
// For replies from SimCard interface
|
// For replies from IccCard interface
|
||||||
private Handler mHandler = new Handler() {
|
private Handler mHandler = new Handler() {
|
||||||
public void handleMessage(Message msg) {
|
public void handleMessage(Message msg) {
|
||||||
AsyncResult ar = (AsyncResult) msg.obj;
|
AsyncResult ar = (AsyncResult) msg.obj;
|
||||||
switch (msg.what) {
|
switch (msg.what) {
|
||||||
case ENABLE_SIM_PIN_COMPLETE:
|
case ENABLE_ICC_PIN_COMPLETE:
|
||||||
simLockChanged(ar.exception == null);
|
iccLockChanged(ar.exception == null);
|
||||||
break;
|
break;
|
||||||
case CHANGE_SIM_PIN_COMPLETE:
|
case CHANGE_ICC_PIN_COMPLETE:
|
||||||
simPinChanged(ar.exception == null);
|
iccPinChanged(ar.exception == null);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,13 +103,13 @@ public class SimLockSettings extends PreferenceActivity
|
|||||||
};
|
};
|
||||||
|
|
||||||
// For top-level settings screen to query
|
// For top-level settings screen to query
|
||||||
static boolean isSimLockEnabled() {
|
static boolean isIccLockEnabled() {
|
||||||
return PhoneFactory.getDefaultPhone().getSimCard().getSimLockEnabled();
|
return PhoneFactory.getDefaultPhone().getIccCard().getIccLockEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
static String getSummary(Context context) {
|
static String getSummary(Context context) {
|
||||||
Resources res = context.getResources();
|
Resources res = context.getResources();
|
||||||
String summary = isSimLockEnabled()
|
String summary = isIccLockEnabled()
|
||||||
? res.getString(R.string.sim_lock_on)
|
? res.getString(R.string.sim_lock_on)
|
||||||
: res.getString(R.string.sim_lock_off);
|
: res.getString(R.string.sim_lock_off);
|
||||||
return summary;
|
return summary;
|
||||||
@@ -142,7 +143,7 @@ public class SimLockSettings extends PreferenceActivity
|
|||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
mPinToggle.setChecked(mPhone.getSimCard().getSimLockEnabled());
|
mPinToggle.setChecked(mPhone.getIccCard().getIccLockEnabled());
|
||||||
|
|
||||||
if (mDialogState != OFF_MODE) {
|
if (mDialogState != OFF_MODE) {
|
||||||
showPinDialog();
|
showPinDialog();
|
||||||
@@ -182,21 +183,21 @@ public class SimLockSettings extends PreferenceActivity
|
|||||||
mPinDialog.setText(mPin);
|
mPinDialog.setText(mPin);
|
||||||
String message = "";
|
String message = "";
|
||||||
switch (mDialogState) {
|
switch (mDialogState) {
|
||||||
case SIM_LOCK_MODE:
|
case ICC_LOCK_MODE:
|
||||||
message = mRes.getString(R.string.sim_enter_pin);
|
message = mRes.getString(R.string.sim_enter_pin);
|
||||||
mPinDialog.setDialogTitle(mToState
|
mPinDialog.setDialogTitle(mToState
|
||||||
? mRes.getString(R.string.sim_enable_sim_lock)
|
? mRes.getString(R.string.sim_enable_sim_lock)
|
||||||
: mRes.getString(R.string.sim_disable_sim_lock));
|
: mRes.getString(R.string.sim_disable_sim_lock));
|
||||||
break;
|
break;
|
||||||
case SIM_OLD_MODE:
|
case ICC_OLD_MODE:
|
||||||
message = mRes.getString(R.string.sim_enter_old);
|
message = mRes.getString(R.string.sim_enter_old);
|
||||||
mPinDialog.setDialogTitle(mRes.getString(R.string.sim_change_pin));
|
mPinDialog.setDialogTitle(mRes.getString(R.string.sim_change_pin));
|
||||||
break;
|
break;
|
||||||
case SIM_NEW_MODE:
|
case ICC_NEW_MODE:
|
||||||
message = mRes.getString(R.string.sim_enter_new);
|
message = mRes.getString(R.string.sim_enter_new);
|
||||||
mPinDialog.setDialogTitle(mRes.getString(R.string.sim_change_pin));
|
mPinDialog.setDialogTitle(mRes.getString(R.string.sim_change_pin));
|
||||||
break;
|
break;
|
||||||
case SIM_REENTER_MODE:
|
case ICC_REENTER_MODE:
|
||||||
message = mRes.getString(R.string.sim_reenter_new);
|
message = mRes.getString(R.string.sim_reenter_new);
|
||||||
mPinDialog.setDialogTitle(mRes.getString(R.string.sim_change_pin));
|
mPinDialog.setDialogTitle(mRes.getString(R.string.sim_change_pin));
|
||||||
break;
|
break;
|
||||||
@@ -222,26 +223,26 @@ public class SimLockSettings extends PreferenceActivity
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
switch (mDialogState) {
|
switch (mDialogState) {
|
||||||
case SIM_LOCK_MODE:
|
case ICC_LOCK_MODE:
|
||||||
tryChangeSimLockState();
|
tryChangeIccLockState();
|
||||||
break;
|
break;
|
||||||
case SIM_OLD_MODE:
|
case ICC_OLD_MODE:
|
||||||
mOldPin = mPin;
|
mOldPin = mPin;
|
||||||
mDialogState = SIM_NEW_MODE;
|
mDialogState = ICC_NEW_MODE;
|
||||||
mError = null;
|
mError = null;
|
||||||
mPin = null;
|
mPin = null;
|
||||||
showPinDialog();
|
showPinDialog();
|
||||||
break;
|
break;
|
||||||
case SIM_NEW_MODE:
|
case ICC_NEW_MODE:
|
||||||
mNewPin = mPin;
|
mNewPin = mPin;
|
||||||
mDialogState = SIM_REENTER_MODE;
|
mDialogState = ICC_REENTER_MODE;
|
||||||
mPin = null;
|
mPin = null;
|
||||||
showPinDialog();
|
showPinDialog();
|
||||||
break;
|
break;
|
||||||
case SIM_REENTER_MODE:
|
case ICC_REENTER_MODE:
|
||||||
if (!mPin.equals(mNewPin)) {
|
if (!mPin.equals(mNewPin)) {
|
||||||
mError = mRes.getString(R.string.sim_pins_dont_match);
|
mError = mRes.getString(R.string.sim_pins_dont_match);
|
||||||
mDialogState = SIM_NEW_MODE;
|
mDialogState = ICC_NEW_MODE;
|
||||||
mPin = null;
|
mPin = null;
|
||||||
showPinDialog();
|
showPinDialog();
|
||||||
} else {
|
} else {
|
||||||
@@ -258,21 +259,21 @@ public class SimLockSettings extends PreferenceActivity
|
|||||||
mToState = mPinToggle.isChecked();
|
mToState = mPinToggle.isChecked();
|
||||||
// Flip it back and pop up pin dialog
|
// Flip it back and pop up pin dialog
|
||||||
mPinToggle.setChecked(!mToState);
|
mPinToggle.setChecked(!mToState);
|
||||||
mDialogState = SIM_LOCK_MODE;
|
mDialogState = ICC_LOCK_MODE;
|
||||||
showPinDialog();
|
showPinDialog();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void tryChangeSimLockState() {
|
private void tryChangeIccLockState() {
|
||||||
// Try to change sim lock. If it succeeds, toggle the lock state and
|
// Try to change icc lock. If it succeeds, toggle the lock state and
|
||||||
// reset dialog state. Else inject error message and show dialog again.
|
// reset dialog state. Else inject error message and show dialog again.
|
||||||
Message callback = Message.obtain(mHandler, ENABLE_SIM_PIN_COMPLETE);
|
Message callback = Message.obtain(mHandler, ENABLE_ICC_PIN_COMPLETE);
|
||||||
mPhone.getSimCard().setSimLockEnabled(mToState, mPin, callback);
|
mPhone.getIccCard().setIccLockEnabled(mToState, mPin, callback);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void simLockChanged(boolean success) {
|
private void iccLockChanged(boolean success) {
|
||||||
if (success) {
|
if (success) {
|
||||||
mPinToggle.setChecked(mToState);
|
mPinToggle.setChecked(mToState);
|
||||||
} else {
|
} else {
|
||||||
@@ -283,7 +284,7 @@ public class SimLockSettings extends PreferenceActivity
|
|||||||
resetDialogState();
|
resetDialogState();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void simPinChanged(boolean success) {
|
private void iccPinChanged(boolean success) {
|
||||||
if (!success) {
|
if (!success) {
|
||||||
// TODO: I18N
|
// TODO: I18N
|
||||||
Toast.makeText(this, mRes.getString(R.string.sim_change_failed),
|
Toast.makeText(this, mRes.getString(R.string.sim_change_failed),
|
||||||
@@ -299,8 +300,8 @@ public class SimLockSettings extends PreferenceActivity
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void tryChangePin() {
|
private void tryChangePin() {
|
||||||
Message callback = Message.obtain(mHandler, CHANGE_SIM_PIN_COMPLETE);
|
Message callback = Message.obtain(mHandler, CHANGE_ICC_PIN_COMPLETE);
|
||||||
mPhone.getSimCard().changeSimLockPassword(mOldPin,
|
mPhone.getIccCard().changeIccLockPassword(mOldPin,
|
||||||
mNewPin, callback);
|
mNewPin, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -314,7 +315,7 @@ public class SimLockSettings extends PreferenceActivity
|
|||||||
|
|
||||||
private void resetDialogState() {
|
private void resetDialogState() {
|
||||||
mError = null;
|
mError = null;
|
||||||
mDialogState = SIM_OLD_MODE; // Default for when Change PIN is clicked
|
mDialogState = ICC_OLD_MODE; // Default for when Change PIN is clicked
|
||||||
mPin = "";
|
mPin = "";
|
||||||
setDialogValues();
|
setDialogValues();
|
||||||
}
|
}
|
@@ -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 = 5;
|
||||||
private static final int MENU_ITEM_TOGGLE_DATA_ON_BOOT = 6;
|
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 number;
|
||||||
private TextView callState;
|
private TextView callState;
|
||||||
private TextView operatorName;
|
private TextView operatorName;
|
||||||
@@ -405,7 +405,7 @@ public class RadioInfo extends Activity {
|
|||||||
mTelephonyManager = (TelephonyManager)getSystemService(TELEPHONY_SERVICE);
|
mTelephonyManager = (TelephonyManager)getSystemService(TELEPHONY_SERVICE);
|
||||||
phone = PhoneFactory.getDefaultPhone();
|
phone = PhoneFactory.getDefaultPhone();
|
||||||
|
|
||||||
mImei = (TextView) findViewById(R.id.imei);
|
mDeviceId= (TextView) findViewById(R.id.imei);
|
||||||
number = (TextView) findViewById(R.id.number);
|
number = (TextView) findViewById(R.id.number);
|
||||||
callState = (TextView) findViewById(R.id.call);
|
callState = (TextView) findViewById(R.id.call);
|
||||||
operatorName = (TextView) findViewById(R.id.operator);
|
operatorName = (TextView) findViewById(R.id.operator);
|
||||||
@@ -518,7 +518,8 @@ public class RadioInfo extends Activity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
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');
|
.setAlphabeticShortcut('b');
|
||||||
menu.add(1, MENU_ITEM_VIEW_ADN, 0,
|
menu.add(1, MENU_ITEM_VIEW_ADN, 0,
|
||||||
R.string.radioInfo_menu_viewADN).setOnMenuItemClickListener(mViewADNCallback);
|
R.string.radioInfo_menu_viewADN).setOnMenuItemClickListener(mViewADNCallback);
|
||||||
@@ -531,14 +532,14 @@ public class RadioInfo extends Activity {
|
|||||||
menu.add(1, MENU_ITEM_TOGGLE_DATA,
|
menu.add(1, MENU_ITEM_TOGGLE_DATA,
|
||||||
0, R.string.radioInfo_menu_disableData).setOnMenuItemClickListener(mToggleData);
|
0, R.string.radioInfo_menu_disableData).setOnMenuItemClickListener(mToggleData);
|
||||||
menu.add(1, MENU_ITEM_TOGGLE_DATA_ON_BOOT,
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onPrepareOptionsMenu(Menu menu)
|
public boolean onPrepareOptionsMenu(Menu menu) {
|
||||||
{
|
|
||||||
// Get the TOGGLE DATA menu item in the right state.
|
// Get the TOGGLE DATA menu item in the right state.
|
||||||
MenuItem item = menu.findItem(MENU_ITEM_TOGGLE_DATA);
|
MenuItem item = menu.findItem(MENU_ITEM_TOGGLE_DATA);
|
||||||
int state = mTelephonyManager.getDataState();
|
int state = mTelephonyManager.getDataState();
|
||||||
@@ -575,7 +576,6 @@ public class RadioInfo extends Activity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updatePowerState() {
|
private void updatePowerState() {
|
||||||
//log("updatePowerState");
|
|
||||||
String buttonText = isRadioOn() ?
|
String buttonText = isRadioOn() ?
|
||||||
getString(R.string.turn_off_radio) :
|
getString(R.string.turn_off_radio) :
|
||||||
getString(R.string.turn_on_radio);
|
getString(R.string.turn_on_radio);
|
||||||
@@ -650,11 +650,15 @@ public class RadioInfo extends Activity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private final void updateLocation(CellLocation location) {
|
private final void updateLocation(CellLocation location) {
|
||||||
|
int lac = -1;
|
||||||
|
int cid = -1;
|
||||||
|
if (location instanceof GsmCellLocation) {
|
||||||
GsmCellLocation loc = (GsmCellLocation)location;
|
GsmCellLocation loc = (GsmCellLocation)location;
|
||||||
Resources r = getResources();
|
lac = loc.getLac();
|
||||||
|
cid = loc.getCid();
|
||||||
|
}
|
||||||
|
|
||||||
int lac = loc.getLac();
|
Resources r = getResources();
|
||||||
int cid = loc.getCid();
|
|
||||||
|
|
||||||
mLocation.setText(r.getString(R.string.radioInfo_lac) + " = "
|
mLocation.setText(r.getString(R.string.radioInfo_lac) + " = "
|
||||||
+ ((lac == -1) ? "unknown" : Integer.toHexString(lac))
|
+ ((lac == -1) ? "unknown" : Integer.toHexString(lac))
|
||||||
@@ -782,7 +786,8 @@ public class RadioInfo extends Activity {
|
|||||||
|
|
||||||
s = phone.getDeviceId();
|
s = phone.getDeviceId();
|
||||||
if (s == null) s = r.getString(R.string.radioInfo_unknown);
|
if (s == null) s = r.getString(R.string.radioInfo_unknown);
|
||||||
mImei.setText(s);
|
mDeviceId.setText(s);
|
||||||
|
|
||||||
|
|
||||||
s = phone.getLine1Number();
|
s = phone.getLine1Number();
|
||||||
if (s == null) s = r.getString(R.string.radioInfo_unknown);
|
if (s == null) s = r.getString(R.string.radioInfo_unknown);
|
||||||
@@ -1030,7 +1035,7 @@ public class RadioInfo extends Activity {
|
|||||||
private MenuItem.OnMenuItemClickListener mViewSDNCallback = new MenuItem.OnMenuItemClickListener() {
|
private MenuItem.OnMenuItemClickListener mViewSDNCallback = new MenuItem.OnMenuItemClickListener() {
|
||||||
public boolean onMenuItemClick(MenuItem item) {
|
public boolean onMenuItemClick(MenuItem item) {
|
||||||
Intent intent = new Intent(
|
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
|
// 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 activity manager will try to resolve the type by calling
|
||||||
// the content provider, which causes it to be loaded in a process
|
// 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() {
|
private MenuItem.OnMenuItemClickListener mGetPdpList = new MenuItem.OnMenuItemClickListener() {
|
||||||
public boolean onMenuItemClick(MenuItem item) {
|
public boolean onMenuItemClick(MenuItem item) {
|
||||||
phone.getPdpContextList(null);
|
phone.getDataCallList(null);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -1122,8 +1127,7 @@ public class RadioInfo extends Activity {
|
|||||||
|
|
||||||
OnClickListener mDnsCheckButtonHandler = new OnClickListener() {
|
OnClickListener mDnsCheckButtonHandler = new OnClickListener() {
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
GSMPhone gsmPhone = (GSMPhone) phone;
|
phone.disableDnsCheck(!phone.isDnsCheckDisabled());
|
||||||
gsmPhone.disableDnsCheck(!gsmPhone.isDnsCheckDisabled());
|
|
||||||
updateDnsCheckState();
|
updateDnsCheckState();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -1182,3 +1186,4 @@ public class RadioInfo extends Activity {
|
|||||||
private String[] mPreferredNetworkLabels = {
|
private String[] mPreferredNetworkLabels = {
|
||||||
"WCDMA preferred", "GSM only", "WCDMA only", "Unknown"};
|
"WCDMA preferred", "GSM only", "WCDMA only", "Unknown"};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -124,7 +124,7 @@ public class SecuritySettings extends PreferenceActivity
|
|||||||
simLockPreferences.setTitle(R.string.sim_lock_settings_category);
|
simLockPreferences.setTitle(R.string.sim_lock_settings_category);
|
||||||
// Intent to launch SIM lock settings
|
// Intent to launch SIM lock settings
|
||||||
intent = new Intent();
|
intent = new Intent();
|
||||||
intent.setClassName("com.android.settings", "com.android.settings.SimLockSettings");
|
intent.setClassName("com.android.settings", "com.android.settings.IccLockSettings");
|
||||||
simLockPreferences.setIntent(intent);
|
simLockPreferences.setIntent(intent);
|
||||||
|
|
||||||
PreferenceCategory simLockCat = new PreferenceCategory(this);
|
PreferenceCategory simLockCat = new PreferenceCategory(this);
|
||||||
|
@@ -50,7 +50,7 @@ import java.lang.ref.WeakReference;
|
|||||||
* # Phone Number
|
* # Phone Number
|
||||||
* # Network
|
* # Network
|
||||||
* # Roaming
|
* # Roaming
|
||||||
* # IMEI
|
* # Device Id (IMEI in GSM and MEID in CDMA)
|
||||||
* # Network type
|
* # Network type
|
||||||
* # Signal Strength
|
* # Signal Strength
|
||||||
* # Battery Strength : TODO
|
* # Battery Strength : TODO
|
||||||
@@ -181,7 +181,9 @@ public class Status extends PreferenceActivity {
|
|||||||
mSignalStrength = findPreference("signal_strength");
|
mSignalStrength = findPreference("signal_strength");
|
||||||
mUptime = findPreference("up_time");
|
mUptime = findPreference("up_time");
|
||||||
|
|
||||||
|
//NOTE "imei" is the "Device ID" since it represents the IMEI in GSM and the MEID in CDMA
|
||||||
setSummaryText("imei", mPhone.getDeviceId());
|
setSummaryText("imei", mPhone.getDeviceId());
|
||||||
|
|
||||||
setSummaryText("imei_sv",
|
setSummaryText("imei_sv",
|
||||||
((TelephonyManager) getSystemService(TELEPHONY_SERVICE))
|
((TelephonyManager) getSystemService(TELEPHONY_SERVICE))
|
||||||
.getDeviceSoftwareVersion());
|
.getDeviceSoftwareVersion());
|
||||||
@@ -379,3 +381,5 @@ public class Status extends PreferenceActivity {
|
|||||||
return h + ":" + pad(m) + ":" + pad(s);
|
return h + ":" + pad(m) + ":" + pad(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user