From 433ca4427ca8d3b349b9997f3dca03f96c5739cf Mon Sep 17 00:00:00 2001 From: Nathan Harold Date: Mon, 23 Apr 2018 18:20:43 -0700 Subject: [PATCH] [Telephony Debug Menu] Add Physical Channel Config Add a field to display the PhyChanConfig and register for this event as part of the PhoneStateListener. Bug: 78791811 Test: manual Change-Id: Ic038aa65655f8efa98bf1d6388e7c61761d2eb4a --- res/layout/radio_info.xml | 12 +++++++++++ res/values/strings.xml | 2 ++ src/com/android/settings/RadioInfo.java | 27 ++++++++++++++++++++++++- 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/res/layout/radio_info.xml b/res/layout/radio_info.xml index 502505c0aee..bc7671a72aa 100644 --- a/res/layout/radio_info.xml +++ b/res/layout/radio_info.xml @@ -91,6 +91,18 @@ + + + + + + + + + Neighbor Cell Info (deprecated): + LTE Physical Channel Configuration: + Cell Info Refresh Rate: All Cell Measurement Info: diff --git a/src/com/android/settings/RadioInfo.java b/src/com/android/settings/RadioInfo.java index 91d319c42ec..ec683f7ec2f 100644 --- a/src/com/android/settings/RadioInfo.java +++ b/src/com/android/settings/RadioInfo.java @@ -52,6 +52,7 @@ import android.telephony.DataConnectionRealTimeInfo; import android.telephony.NeighboringCellInfo; import android.telephony.PreciseCallState; import android.telephony.PhoneStateListener; +import android.telephony.PhysicalChannelConfig; import android.telephony.ServiceState; import android.telephony.SignalStrength; import android.telephony.SubscriptionManager; @@ -194,6 +195,7 @@ public class RadioInfo extends Activity { private TextView mPingHostnameV4; private TextView mPingHostnameV6; private TextView mHttpClientTest; + private TextView mPhyChanConfig; private TextView dnsCheckState; private EditText smsc; private Switch radioPowerOnSwitch; @@ -296,8 +298,29 @@ public class RadioInfo extends Activity { updateNetworkType(); updateImsProvisionedState(); } + + @Override + public void onPhysicalChannelConfigurationChanged( + List configs) { + updatePhysicalChannelConfiguration(configs); + } + }; + private void updatePhysicalChannelConfiguration(List configs) { + StringBuilder sb = new StringBuilder(); + String div = ""; + sb.append("{"); + if (configs != null) { + for(PhysicalChannelConfig c : configs) { + sb.append(div).append(c); + div = ","; + } + } + sb.append("}"); + mPhyChanConfig.setText(sb.toString()); + } + private void updatePreferredNetworkType(int type) { if (type >= mPreferredNetworkLabels.length || type < 0) { log("EVENT_QUERY_PREFERRED_TYPE_DONE: unknown " + @@ -400,6 +423,8 @@ public class RadioInfo extends Activity { mPingHostnameV6 = (TextView) findViewById(R.id.pingHostnameV6); mHttpClientTest = (TextView) findViewById(R.id.httpClientTest); + mPhyChanConfig = (TextView) findViewById(R.id.phy_chan_config); + preferredNetworkType = (Spinner) findViewById(R.id.preferredNetworkType); ArrayAdapter adapter = new ArrayAdapter (this, android.R.layout.simple_spinner_item, mPreferredNetworkLabels); @@ -502,7 +527,7 @@ public class RadioInfo extends Activity { | PhoneStateListener.LISTEN_CELL_INFO | PhoneStateListener.LISTEN_SERVICE_STATE | PhoneStateListener.LISTEN_SIGNAL_STRENGTHS - | PhoneStateListener.LISTEN_DATA_CONNECTION_REAL_TIME_INFO); + | PhoneStateListener.LISTEN_PHYSICAL_CHANNEL_CONFIGURATION); smsc.clearFocus(); }