Merge "pre-provide the mvno data of the edited apn" into jb-mr2-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
58f9cbd677
@@ -94,6 +94,7 @@ public class ApnEditor extends PreferenceActivity
|
|||||||
private boolean mNewApn;
|
private boolean mNewApn;
|
||||||
private boolean mFirstTime;
|
private boolean mFirstTime;
|
||||||
private Resources mRes;
|
private Resources mRes;
|
||||||
|
private TelephonyManager mTelephonyManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Standard projection for the interesting columns of a normal note.
|
* Standard projection for the interesting columns of a normal note.
|
||||||
@@ -224,6 +225,8 @@ public class ApnEditor extends PreferenceActivity
|
|||||||
mCursor = managedQuery(mUri, sProjection, null, null);
|
mCursor = managedQuery(mUri, sProjection, null, null);
|
||||||
mCursor.moveToFirst();
|
mCursor.moveToFirst();
|
||||||
|
|
||||||
|
mTelephonyManager = (TelephonyManager) getSystemService(TELEPHONY_SERVICE);
|
||||||
|
|
||||||
fillUi();
|
fillUi();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -359,18 +362,30 @@ public class ApnEditor extends PreferenceActivity
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private String mvnoDescription(String raw) {
|
private String mvnoDescription(String newValue) {
|
||||||
int mvnoIndex = mMvnoType.findIndexOfValue(raw);
|
int mvnoIndex = mMvnoType.findIndexOfValue(newValue);
|
||||||
|
String oldValue = mMvnoType.getValue();
|
||||||
|
|
||||||
if (mvnoIndex == -1) {
|
if (mvnoIndex == -1) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
String[] values = mRes.getStringArray(R.array.mvno_type_entries);
|
String[] values = mRes.getStringArray(R.array.mvno_type_entries);
|
||||||
if (values[mvnoIndex].equals("None")) {
|
if (values[mvnoIndex].equals("None")) {
|
||||||
mMvnoMatchData.setEnabled(false);
|
mMvnoMatchData.setEnabled(false);
|
||||||
mMvnoMatchData.setText("");
|
|
||||||
} else {
|
} else {
|
||||||
mMvnoMatchData.setEnabled(true);
|
mMvnoMatchData.setEnabled(true);
|
||||||
}
|
}
|
||||||
|
if (newValue != null && newValue.equals(oldValue) == false) {
|
||||||
|
if (values[mvnoIndex].equals("SPN")) {
|
||||||
|
mMvnoMatchData.setText(mTelephonyManager.getSimOperatorName());
|
||||||
|
} else if (values[mvnoIndex].equals("IMSI")) {
|
||||||
|
String numeric =
|
||||||
|
SystemProperties.get(TelephonyProperties.PROPERTY_ICC_OPERATOR_NUMERIC);
|
||||||
|
mMvnoMatchData.setText(numeric + "x");
|
||||||
|
} else if (values[mvnoIndex].equals("GID")) {
|
||||||
|
mMvnoMatchData.setText(mTelephonyManager.getGroupIdLevel1());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return values[mvnoIndex];
|
return values[mvnoIndex];
|
||||||
|
Reference in New Issue
Block a user