Add displaying DataConnectionRealTimeInfo.
Change-Id: Iadcbf9765af57c125bcdf74e3fc652ed6c8f7d42
diff --git a/res/layout/radio_info.xml b/res/layout/radio_info.xml
index eeb46a0..d81dad6 100644
--- a/res/layout/radio_info.xml
+++ b/res/layout/radio_info.xml
@@ -91,6 +91,13 @@
<TextView android:id="@+id/cellinfo" style="@style/info_value" />
</LinearLayout>
+ <!-- DcRtInfo - DataConnectionRealTimeInfo -->
+ <LinearLayout style="@style/entry_layout">
+ <TextView android:text="@string/radio_info_dcrtinfo_label"
+ style="@style/info_label" />
+ <TextView android:id="@+id/dcrtinfo" style="@style/info_value" />
+ </LinearLayout>
+
<!-- Roaming -->
<LinearLayout style="@style/entry_layout">
<TextView android:text="@string/radio_info_roaming_label" style="@style/info_label" />
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 7ad8f8e..dc8e251 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -455,6 +455,8 @@
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
<string name="radio_info_cellinfo_label">CellInfo:</string>
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
+ <string name="radio_info_dcrtinfo_label">DcRtInfo:</string>
+ <!-- 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>
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
diff --git a/src/com/android/settings/RadioInfo.java b/src/com/android/settings/RadioInfo.java
index df93626..4c86144 100644
--- a/src/com/android/settings/RadioInfo.java
+++ b/src/com/android/settings/RadioInfo.java
@@ -32,6 +32,7 @@
import android.os.SystemProperties;
import android.telephony.CellInfo;
import android.telephony.CellLocation;
+import android.telephony.DataConnectionRealTimeInfo;
import android.telephony.PhoneStateListener;
import android.telephony.ServiceState;
import android.telephony.TelephonyManager;
@@ -103,6 +104,7 @@
private TextView mLocation;
private TextView mNeighboringCids;
private TextView mCellInfo;
+ private TextView mDcRtInfoTv;
private TextView resets;
private TextView attempts;
private TextView successes;
@@ -171,6 +173,12 @@
log("onCellInfoChanged: arrayCi=" + arrayCi);
updateCellInfoTv(arrayCi);
}
+
+ @Override
+ public void onDataConnectionRealTimeInfoChanged(DataConnectionRealTimeInfo dcRtInfo) {
+ log("onDataConnectionRealTimeInfoChanged: dcRtInfo=" + dcRtInfo);
+ updateDcRtInfoTv(dcRtInfo);
+ }
};
private Handler mHandler = new Handler() {
@@ -264,6 +272,7 @@
mLocation = (TextView) findViewById(R.id.location);
mNeighboringCids = (TextView) findViewById(R.id.neighboring);
mCellInfo = (TextView) findViewById(R.id.cellinfo);
+ mDcRtInfoTv = (TextView) findViewById(R.id.dcrtinfo);
resets = (TextView) findViewById(R.id.resets);
attempts = (TextView) findViewById(R.id.attempts);
@@ -366,7 +375,8 @@
| PhoneStateListener.LISTEN_CELL_LOCATION
| PhoneStateListener.LISTEN_MESSAGE_WAITING_INDICATOR
| PhoneStateListener.LISTEN_CALL_FORWARDING_INDICATOR
- | PhoneStateListener.LISTEN_CELL_INFO);
+ | PhoneStateListener.LISTEN_CELL_INFO
+ | PhoneStateListener.LISTEN_DATA_CONNECTION_REAL_TIME_INFO);
}
@Override
@@ -541,6 +551,10 @@
mCellInfo.setText(value.toString());
}
+ private final void updateDcRtInfoTv(DataConnectionRealTimeInfo dcRtInfo) {
+ mDcRtInfoTv.setText(dcRtInfo.toString());
+ }
+
private final void
updateMessageWaiting() {
mMwi.setText(String.valueOf(mMwiValue));