diff options
author | Wink Saville <wink@google.com> | 2012-07-25 14:11:58 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-07-25 14:11:59 -0700 |
commit | eca0eee041b866691bb5582665e5519903520aeb (patch) | |
tree | 24ad30f2f9e5700ada6358ce3415cf48a3556cff /src | |
parent | 0cd75608c0dc6f4a33e8ff944478945083430394 (diff) | |
parent | 79bff2a254eb7785b2b8fb6b8b700c274105cfd9 (diff) | |
download | packages_apps_settings-eca0eee041b866691bb5582665e5519903520aeb.zip packages_apps_settings-eca0eee041b866691bb5582665e5519903520aeb.tar.gz packages_apps_settings-eca0eee041b866691bb5582665e5519903520aeb.tar.bz2 |
Merge "Test getAllCellInfo and onCellInfoChanged."
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/RadioInfo.java | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/src/com/android/settings/RadioInfo.java b/src/com/android/settings/RadioInfo.java index 5ba3837..d72508a 100644 --- a/src/com/android/settings/RadioInfo.java +++ b/src/com/android/settings/RadioInfo.java @@ -33,6 +33,7 @@ import android.os.Message; import android.os.RemoteException; import android.os.ServiceManager; import android.os.SystemProperties; +import android.telephony.CellInfo; import android.telephony.CellLocation; import android.telephony.PhoneStateListener; import android.telephony.ServiceState; @@ -111,6 +112,7 @@ public class RadioInfo extends Activity { private TextView mCfi; private TextView mLocation; private TextView mNeighboringCids; + private TextView mCellInfo; private TextView resets; private TextView attempts; private TextView successes; @@ -140,6 +142,7 @@ public class RadioInfo extends Activity { private String mHttpClientTestResult; private boolean mMwiValue = false; private boolean mCfiValue = false; + private List<CellInfo> mCellInfoValue; private PhoneStateListener mPhoneStateListener = new PhoneStateListener() { @Override @@ -171,6 +174,13 @@ public class RadioInfo extends Activity { mCfiValue = cfi; updateCallRedirect(); } + + @Override + public void onCellInfoChanged(List<CellInfo> arrayCi) { + Log.d(TAG, "[RadioInfo] onCellInfoChanged: arrayCi=" + arrayCi); + mCellInfoValue = arrayCi; + updateCellInfoTv(); + } }; private Handler mHandler = new Handler() { @@ -263,6 +273,7 @@ public class RadioInfo extends Activity { mCfi = (TextView) findViewById(R.id.cfi); mLocation = (TextView) findViewById(R.id.location); mNeighboringCids = (TextView) findViewById(R.id.neighboring); + mCellInfo = (TextView) findViewById(R.id.cellinfo); resets = (TextView) findViewById(R.id.resets); attempts = (TextView) findViewById(R.id.attempts); @@ -326,6 +337,10 @@ public class RadioInfo extends Activity { mHandler.obtainMessage(EVENT_QUERY_NEIGHBORING_CIDS_DONE)); CellLocation.requestLocationUpdate(); + + // Get current cell info + mCellInfoValue = mTelephonyManager.getAllCellInfo(); + Log.d(TAG, "[RadioInfo] onCreate: mCellInfoValue=" + mCellInfoValue); } @Override @@ -356,7 +371,8 @@ public class RadioInfo extends Activity { | PhoneStateListener.LISTEN_DATA_ACTIVITY | PhoneStateListener.LISTEN_CELL_LOCATION | PhoneStateListener.LISTEN_MESSAGE_WAITING_INDICATOR - | PhoneStateListener.LISTEN_CALL_FORWARDING_INDICATOR); + | PhoneStateListener.LISTEN_CALL_FORWARDING_INDICATOR + | PhoneStateListener.LISTEN_CELL_INFO); } @Override @@ -508,6 +524,23 @@ public class RadioInfo extends Activity { mNeighboringCids.setText(sb.toString()); } + private final void updateCellInfoTv() { + StringBuilder value = new StringBuilder(); + if (mCellInfoValue != null) { + int index = 0; + for (CellInfo ci : mCellInfoValue) { + value.append('['); + value.append(index); + value.append("]="); + value.append(ci.toString()); + if (++index < mCellInfoValue.size()) { + value.append("\n"); + } + } + } + mCellInfo.setText(value.toString()); + } + private final void updateMessageWaiting() { mMwi.setText(String.valueOf(mMwiValue)); |