Minor Fixes for RadioInfo Test Menu
-Fix a race condition in re-creating activity -Ensure cell info is disabled when Menu is paused -Fix issue with focus on creating view Change-Id: Icfb7667fe6e47ab6dc950918447bbe892e0681ad
This commit is contained in:
@@ -19,9 +19,11 @@
|
|||||||
-->
|
-->
|
||||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent" >
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<LinearLayout style="@style/info_layout">
|
<LinearLayout style="@style/info_layout"
|
||||||
|
android:descendantFocusability="beforeDescendants"
|
||||||
|
android:focusableInTouchMode="true">
|
||||||
|
|
||||||
<!-- IMEI -->
|
<!-- IMEI -->
|
||||||
<LinearLayout style="@style/entry_layout">
|
<LinearLayout style="@style/entry_layout">
|
||||||
|
@@ -302,7 +302,7 @@ public class RadioInfo extends Activity {
|
|||||||
case EVENT_SET_PREFERRED_TYPE_DONE:
|
case EVENT_SET_PREFERRED_TYPE_DONE:
|
||||||
ar= (AsyncResult) msg.obj;
|
ar= (AsyncResult) msg.obj;
|
||||||
if (ar.exception != null) {
|
if (ar.exception != null) {
|
||||||
log("Set preferred network type success.");
|
log("Set preferred network type failed.");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EVENT_QUERY_SMSC_DONE:
|
case EVENT_QUERY_SMSC_DONE:
|
||||||
@@ -404,7 +404,7 @@ public class RadioInfo extends Activity {
|
|||||||
oemInfoButton.setEnabled(false);
|
oemInfoButton.setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
mCellInfoRefreshRateIndex = CELL_INFO_LIST_RATE_DISABLED;
|
mCellInfoRefreshRateIndex = 0; //disabled
|
||||||
mPreferredNetworkTypeResult = mPreferredNetworkLabels.length - 1; //Unknown
|
mPreferredNetworkTypeResult = mPreferredNetworkLabels.length - 1; //Unknown
|
||||||
|
|
||||||
//FIXME: Replace with TelephonyManager call
|
//FIXME: Replace with TelephonyManager call
|
||||||
@@ -438,9 +438,14 @@ public class RadioInfo extends Activity {
|
|||||||
mPingHostnameV6.setText(mPingHostnameResultV6);
|
mPingHostnameV6.setText(mPingHostnameResultV6);
|
||||||
mHttpClientTest.setText(mHttpClientTestResult);
|
mHttpClientTest.setText(mHttpClientTestResult);
|
||||||
|
|
||||||
//move these here so that the initial updates in create don't cause values to reset
|
|
||||||
cellInfoRefreshRateSpinner.setOnItemSelectedListener(mCellInfoRefreshRateHandler);
|
cellInfoRefreshRateSpinner.setOnItemSelectedListener(mCellInfoRefreshRateHandler);
|
||||||
|
//set selection after registering listener to force update
|
||||||
|
cellInfoRefreshRateSpinner.setSelection(mCellInfoRefreshRateIndex);
|
||||||
|
|
||||||
|
//set selection before registering to prevent update
|
||||||
|
preferredNetworkType.setSelection(mPreferredNetworkTypeResult, true);
|
||||||
preferredNetworkType.setOnItemSelectedListener(mPreferredNetworkHandler);
|
preferredNetworkType.setOnItemSelectedListener(mPreferredNetworkHandler);
|
||||||
|
|
||||||
radioPowerOnSwitch.setOnCheckedChangeListener(mRadioPowerOnChangeListener);
|
radioPowerOnSwitch.setOnCheckedChangeListener(mRadioPowerOnChangeListener);
|
||||||
imsVoLteProvisionedSwitch.setOnCheckedChangeListener(mImsVoLteCheckedChangeListener);
|
imsVoLteProvisionedSwitch.setOnCheckedChangeListener(mImsVoLteCheckedChangeListener);
|
||||||
|
|
||||||
@@ -457,6 +462,8 @@ public class RadioInfo extends Activity {
|
|||||||
| PhoneStateListener.LISTEN_SERVICE_STATE
|
| PhoneStateListener.LISTEN_SERVICE_STATE
|
||||||
| PhoneStateListener.LISTEN_SIGNAL_STRENGTHS
|
| PhoneStateListener.LISTEN_SIGNAL_STRENGTHS
|
||||||
| PhoneStateListener.LISTEN_DATA_CONNECTION_REAL_TIME_INFO);
|
| PhoneStateListener.LISTEN_DATA_CONNECTION_REAL_TIME_INFO);
|
||||||
|
|
||||||
|
smsc.clearFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -466,6 +473,7 @@ public class RadioInfo extends Activity {
|
|||||||
log("onPause: unregister phone & data intents");
|
log("onPause: unregister phone & data intents");
|
||||||
|
|
||||||
mTelephonyManager.listen(mPhoneStateListener, PhoneStateListener.LISTEN_NONE);
|
mTelephonyManager.listen(mPhoneStateListener, PhoneStateListener.LISTEN_NONE);
|
||||||
|
phone.setCellInfoListRate(CELL_INFO_LIST_RATE_DISABLED);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void restoreFromBundle(Bundle b) {
|
private void restoreFromBundle(Bundle b) {
|
||||||
@@ -485,8 +493,6 @@ public class RadioInfo extends Activity {
|
|||||||
mPreferredNetworkLabels.length - 1);
|
mPreferredNetworkLabels.length - 1);
|
||||||
|
|
||||||
mCellInfoRefreshRateIndex = b.getInt("mCellInfoRefreshRateIndex", 0);
|
mCellInfoRefreshRateIndex = b.getInt("mCellInfoRefreshRateIndex", 0);
|
||||||
|
|
||||||
cellInfoRefreshRateSpinner.setSelection(mCellInfoRefreshRateIndex);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -496,7 +502,6 @@ public class RadioInfo extends Activity {
|
|||||||
outState.putString("mHttpClientTestResult", mHttpClientTestResult);
|
outState.putString("mHttpClientTestResult", mHttpClientTestResult);
|
||||||
|
|
||||||
outState.putInt("mPreferredNetworkTypeResult", mPreferredNetworkTypeResult);
|
outState.putInt("mPreferredNetworkTypeResult", mPreferredNetworkTypeResult);
|
||||||
|
|
||||||
outState.putInt("mCellInfoRefreshRateIndex", mCellInfoRefreshRateIndex);
|
outState.putInt("mCellInfoRefreshRateIndex", mCellInfoRefreshRateIndex);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user