Add displaying DataConnectionRealTimeInfo.

Change-Id: Iadcbf9765af57c125bcdf74e3fc652ed6c8f7d42
This commit is contained in:
Wink Saville
2014-04-15 22:05:24 -07:00
parent 210bb8694a
commit 4f0d881871
3 changed files with 24 additions and 1 deletions

View File

@@ -32,6 +32,7 @@ import android.os.Message;
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 @@ public class RadioInfo extends Activity {
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 @@ public class RadioInfo extends Activity {
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 @@ public class RadioInfo extends Activity {
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 @@ public class RadioInfo extends Activity {
| 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 @@ public class RadioInfo extends Activity {
mCellInfo.setText(value.toString());
}
private final void updateDcRtInfoTv(DataConnectionRealTimeInfo dcRtInfo) {
mDcRtInfoTv.setText(dcRtInfo.toString());
}
private final void
updateMessageWaiting() {
mMwi.setText(String.valueOf(mMwiValue));