blob: 4a1c8870c0bc61a63f6db4fa16e70094abb80bc6 [file] [log] [blame]
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -08001/*
2 * Copyright (C) 2006 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.settings;
18
19import android.app.Activity;
Pavel Zhamaitsiakcb267a62015-01-21 18:25:14 -080020import android.app.QueuedWork;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080021import android.content.Intent;
Tammo Spalinka5f4c8f2009-10-15 20:08:58 +080022import android.content.pm.PackageManager;
23import android.content.pm.ResolveInfo;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080024import android.content.res.Resources;
Nathan Haroldcea413a2015-11-23 15:48:10 -080025import android.graphics.Typeface;
Jeff Sharkey93029862011-05-27 18:26:15 -070026import android.net.TrafficStats;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080027import android.net.Uri;
28import android.os.AsyncResult;
29import android.os.Bundle;
30import android.os.Handler;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080031import android.os.Message;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080032import android.os.SystemProperties;
Wink Saville79bff2a2012-06-01 14:37:21 -070033import android.telephony.CellInfo;
Nathan Haroldcea413a2015-11-23 15:48:10 -080034import android.telephony.CellInfoCdma;
35import android.telephony.CellInfoGsm;
36import android.telephony.CellInfoLte;
37import android.telephony.CellInfoWcdma;
38import android.telephony.CellIdentityCdma;
39import android.telephony.CellIdentityGsm;
40import android.telephony.CellIdentityLte;
41import android.telephony.CellIdentityWcdma;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080042import android.telephony.CellLocation;
Nathan Haroldcea413a2015-11-23 15:48:10 -080043import android.telephony.CellSignalStrengthCdma;
44import android.telephony.CellSignalStrengthGsm;
45import android.telephony.CellSignalStrengthLte;
46import android.telephony.CellSignalStrengthWcdma;
Wink Saville4f0d8812014-04-15 22:05:24 -070047import android.telephony.DataConnectionRealTimeInfo;
Jason Monk39b46742015-09-10 15:52:51 -040048import android.telephony.NeighboringCellInfo;
Nathan Harold2b77d742016-03-19 13:22:10 -070049import android.telephony.PreciseCallState;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080050import android.telephony.PhoneStateListener;
51import android.telephony.ServiceState;
Nathan Harold2b77d742016-03-19 13:22:10 -070052import android.telephony.SignalStrength;
Nathan Haroldcea413a2015-11-23 15:48:10 -080053import android.telephony.SubscriptionManager;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080054import android.telephony.TelephonyManager;
jsh534f5ae2009-09-24 09:19:22 -070055import android.telephony.cdma.CdmaCellLocation;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080056import android.telephony.gsm.GsmCellLocation;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080057import android.util.Log;
58import android.view.Menu;
59import android.view.MenuItem;
60import android.view.View;
61import android.view.View.OnClickListener;
62import android.widget.AdapterView;
63import android.widget.ArrayAdapter;
64import android.widget.Button;
Nathan Harold2b77d742016-03-19 13:22:10 -070065import android.widget.CompoundButton;
66import android.widget.CompoundButton.OnCheckedChangeListener;
Jason Monk39b46742015-09-10 15:52:51 -040067import android.widget.EditText;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080068import android.widget.Spinner;
Nathan Harold2b77d742016-03-19 13:22:10 -070069import android.widget.Switch;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080070import android.widget.TextView;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080071
Jason Monk39b46742015-09-10 15:52:51 -040072import com.android.ims.ImsConfig;
73import com.android.ims.ImsException;
74import com.android.ims.ImsManager;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080075import com.android.internal.telephony.Phone;
Wink Saville55434042012-06-14 12:33:43 -070076import com.android.internal.telephony.PhoneConstants;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080077import com.android.internal.telephony.PhoneFactory;
Nathan Haroldcea413a2015-11-23 15:48:10 -080078import com.android.internal.telephony.RILConstants;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080079import com.android.internal.telephony.TelephonyProperties;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080080
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080081import java.io.IOException;
Jason Monk39b46742015-09-10 15:52:51 -040082import java.net.HttpURLConnection;
83import java.net.URL;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080084import java.net.UnknownHostException;
85import java.util.ArrayList;
86import java.util.List;
87
88public class RadioInfo extends Activity {
Nathan Harold2b77d742016-03-19 13:22:10 -070089 private static final String TAG = "RadioInfo";
johnwang342101a2009-09-23 16:22:34 -070090
Nathan Harold2b77d742016-03-19 13:22:10 -070091 private static final String[] mPreferredNetworkLabels = {
92 "WCDMA preferred",
93 "GSM only",
94 "WCDMA only",
95 "GSM auto (PRL)",
96 "CDMA auto (PRL)",
97 "CDMA only",
98 "EvDo only",
99 "Global auto (PRL)",
100 "LTE/CDMA auto (PRL)",
101 "LTE/UMTS auto (PRL)",
102 "LTE/CDMA/UMTS auto (PRL)",
103 "LTE only",
104 "LTE/WCDMA",
105 "TD-SCDMA only",
106 "TD-SCDMA/WCDMA",
107 "LTE/TD-SCDMA",
108 "TD-SCDMA/GSM",
109 "TD-SCDMA/UMTS",
110 "LTE/TD-SCDMA/WCDMA",
111 "LTE/TD-SCDMA/UMTS",
112 "TD-SCDMA/CDMA/UMTS",
113 "Global/TD-SCDMA",
114 "Unknown"
115 };
116
117
118 private static final int CELL_INFO_LIST_RATE_DISABLED = Integer.MAX_VALUE;
119 private static final int CELL_INFO_LIST_RATE_MAX = 0;
120
121 //Values in must match mCellInfoRefreshRates
122 private static final String[] mCellInfoRefreshRateLabels = {
123 "Disabled",
124 "Immediate",
125 "Min 5s",
126 "Min 10s",
127 "Min 60s"
128 };
129
130 //Values in seconds, must match mCellInfoRefreshRateLabels
131 private static final int mCellInfoRefreshRates[] = {
132 CELL_INFO_LIST_RATE_DISABLED,
133 CELL_INFO_LIST_RATE_MAX,
134 5000,
135 10000,
136 60000
137 };
138
139 private void log(String s) {
140 Log.d(TAG, s);
141 }
142
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800143 private static final int EVENT_CFI_CHANGED = 302;
144
145 private static final int EVENT_QUERY_PREFERRED_TYPE_DONE = 1000;
146 private static final int EVENT_SET_PREFERRED_TYPE_DONE = 1001;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800147 private static final int EVENT_QUERY_SMSC_DONE = 1005;
148 private static final int EVENT_UPDATE_SMSC_DONE = 1006;
149
150 private static final int MENU_ITEM_SELECT_BAND = 0;
151 private static final int MENU_ITEM_VIEW_ADN = 1;
152 private static final int MENU_ITEM_VIEW_FDN = 2;
153 private static final int MENU_ITEM_VIEW_SDN = 3;
154 private static final int MENU_ITEM_GET_PDP_LIST = 4;
155 private static final int MENU_ITEM_TOGGLE_DATA = 5;
Tammo Spalinka5f4c8f2009-10-15 20:08:58 +0800156
Wink Savillec3886682009-04-02 11:00:56 -0700157 private TextView mDeviceId; //DeviceId is the IMEI in GSM and the MEID in CDMA
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800158 private TextView number;
159 private TextView callState;
160 private TextView operatorName;
161 private TextView roamingState;
162 private TextView gsmState;
163 private TextView gprsState;
Nathan Harold2b77d742016-03-19 13:22:10 -0700164 private TextView voiceNetwork;
165 private TextView dataNetwork;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800166 private TextView dBm;
167 private TextView mMwi;
168 private TextView mCfi;
169 private TextView mLocation;
170 private TextView mNeighboringCids;
Wink Saville79bff2a2012-06-01 14:37:21 -0700171 private TextView mCellInfo;
Wink Saville4f0d8812014-04-15 22:05:24 -0700172 private TextView mDcRtInfoTv;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800173 private TextView sent;
174 private TextView received;
Nathan Haroldcea413a2015-11-23 15:48:10 -0800175 private TextView mPingHostnameV4;
176 private TextView mPingHostnameV6;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800177 private TextView mHttpClientTest;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800178 private TextView dnsCheckState;
179 private EditText smsc;
Nathan Harold2b77d742016-03-19 13:22:10 -0700180 private Switch radioPowerOnSwitch;
181 private Button cellInfoRefreshRateButton;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800182 private Button dnsCheckToggleButton;
183 private Button pingTestButton;
184 private Button updateSmscButton;
185 private Button refreshSmscButton;
Tammo Spalinka5f4c8f2009-10-15 20:08:58 +0800186 private Button oemInfoButton;
Nathan Harold2b77d742016-03-19 13:22:10 -0700187 private Switch imsVoLteProvisionedSwitch;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800188 private Spinner preferredNetworkType;
Nathan Harold2b77d742016-03-19 13:22:10 -0700189 private Spinner cellInfoRefreshRateSpinner;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800190
191 private TelephonyManager mTelephonyManager;
Nathan Haroldcea413a2015-11-23 15:48:10 -0800192 private ImsManager mImsManager = null;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800193 private Phone phone = null;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800194
Nathan Haroldcea413a2015-11-23 15:48:10 -0800195 private String mPingHostnameResultV4;
196 private String mPingHostnameResultV6;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800197 private String mHttpClientTestResult;
198 private boolean mMwiValue = false;
199 private boolean mCfiValue = false;
Nathan Haroldcea413a2015-11-23 15:48:10 -0800200
201 private List<CellInfo> mCellInfoResult = null;
202 private CellLocation mCellLocationResult = null;
203 private List<NeighboringCellInfo> mNeighboringCellResult = null;
204
205 private int mPreferredNetworkTypeResult;
Nathan Harold2b77d742016-03-19 13:22:10 -0700206 private int mCellInfoRefreshRateIndex;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800207
Nathan Harold2b77d742016-03-19 13:22:10 -0700208 private final PhoneStateListener mPhoneStateListener = new PhoneStateListener() {
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800209 @Override
210 public void onDataConnectionStateChanged(int state) {
211 updateDataState();
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800212 updateNetworkType();
213 }
214
215 @Override
216 public void onDataActivity(int direction) {
217 updateDataStats2();
218 }
219
220 @Override
Nathan Harold2b77d742016-03-19 13:22:10 -0700221 public void onCallStateChanged(int state, String incomingNumber) {
222 updateNetworkType();
223 updatePhoneState(state);
224 }
225
226 @Override
227 public void onPreciseCallStateChanged(PreciseCallState preciseState) {
228 updateNetworkType();
229 }
230
231 @Override
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800232 public void onCellLocationChanged(CellLocation location) {
233 updateLocation(location);
234 }
235
236 @Override
237 public void onMessageWaitingIndicatorChanged(boolean mwi) {
238 mMwiValue = mwi;
239 updateMessageWaiting();
240 }
241
242 @Override
243 public void onCallForwardingIndicatorChanged(boolean cfi) {
244 mCfiValue = cfi;
245 updateCallRedirect();
246 }
Wink Saville79bff2a2012-06-01 14:37:21 -0700247
248 @Override
249 public void onCellInfoChanged(List<CellInfo> arrayCi) {
Wink Savillebf471282013-04-05 15:04:05 -0700250 log("onCellInfoChanged: arrayCi=" + arrayCi);
Nathan Haroldcea413a2015-11-23 15:48:10 -0800251 mCellInfoResult = arrayCi;
252 updateCellInfo(mCellInfoResult);
Wink Saville79bff2a2012-06-01 14:37:21 -0700253 }
Wink Saville4f0d8812014-04-15 22:05:24 -0700254
255 @Override
256 public void onDataConnectionRealTimeInfoChanged(DataConnectionRealTimeInfo dcRtInfo) {
257 log("onDataConnectionRealTimeInfoChanged: dcRtInfo=" + dcRtInfo);
258 updateDcRtInfoTv(dcRtInfo);
259 }
Nathan Harold2b77d742016-03-19 13:22:10 -0700260
261 @Override
262 public void onSignalStrengthsChanged(SignalStrength signalStrength) {
263 log("onSignalStrengthChanged: SignalStrength=" +signalStrength);
264 updateSignalStrength(signalStrength);
265 }
266
267 @Override
268 public void onServiceStateChanged(ServiceState serviceState) {
269 log("onServiceStateChanged: ServiceState=" + serviceState);
270 updateServiceState(serviceState);
271 updateRadioPowerState();
272 updateNetworkType();
273 updateImsVoLteProvisionedState();
274 }
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800275 };
276
Nathan Haroldcea413a2015-11-23 15:48:10 -0800277 private void updatePreferredNetworkType(int type) {
278 if (type >= mPreferredNetworkLabels.length || type < 0) {
279 log("EVENT_QUERY_PREFERRED_TYPE_DONE: unknown " +
280 "type=" + type);
281 type = mPreferredNetworkLabels.length - 1; //set to Unknown
282 }
283 mPreferredNetworkTypeResult = type;
284
285 preferredNetworkType.setSelection(mPreferredNetworkTypeResult, true);
286 }
287
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800288 private Handler mHandler = new Handler() {
Nathan Haroldcea413a2015-11-23 15:48:10 -0800289 @Override
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800290 public void handleMessage(Message msg) {
291 AsyncResult ar;
292 switch (msg.what) {
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800293 case EVENT_QUERY_PREFERRED_TYPE_DONE:
294 ar= (AsyncResult) msg.obj;
Nathan Haroldcea413a2015-11-23 15:48:10 -0800295 if (ar.exception == null && ar.result != null) {
296 updatePreferredNetworkType(((int[])ar.result)[0]);
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800297 } else {
Nathan Haroldcea413a2015-11-23 15:48:10 -0800298 //In case of an exception, we will set this to unknown
299 updatePreferredNetworkType(mPreferredNetworkLabels.length-1);
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800300 }
301 break;
302 case EVENT_SET_PREFERRED_TYPE_DONE:
303 ar= (AsyncResult) msg.obj;
304 if (ar.exception != null) {
Nathan Haroldcea413a2015-11-23 15:48:10 -0800305 log("Set preferred network type success.");
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800306 }
307 break;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800308 case EVENT_QUERY_SMSC_DONE:
309 ar= (AsyncResult) msg.obj;
310 if (ar.exception != null) {
311 smsc.setText("refresh error");
312 } else {
jsh21dd4072009-05-12 11:26:55 -0700313 smsc.setText((String)ar.result);
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800314 }
315 break;
316 case EVENT_UPDATE_SMSC_DONE:
317 updateSmscButton.setEnabled(true);
318 ar= (AsyncResult) msg.obj;
319 if (ar.exception != null) {
320 smsc.setText("update error");
321 }
322 break;
323 default:
Nathan Haroldcea413a2015-11-23 15:48:10 -0800324 super.handleMessage(msg);
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800325 break;
326
327 }
328 }
329 };
330
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800331 @Override
332 public void onCreate(Bundle icicle) {
333 super.onCreate(icicle);
334
335 setContentView(R.layout.radio_info);
336
Nathan Haroldcea413a2015-11-23 15:48:10 -0800337 log("Started onCreate");
338
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800339 mTelephonyManager = (TelephonyManager)getSystemService(TELEPHONY_SERVICE);
340 phone = PhoneFactory.getDefaultPhone();
341
Nathan Haroldcea413a2015-11-23 15:48:10 -0800342 //TODO: Need to update this if the default phoneId changes?
343 // Better to have an instance per phone?
344 mImsManager = ImsManager.getInstance(getApplicationContext(),
345 SubscriptionManager.getDefaultVoicePhoneId());
346
Wink Savillec3886682009-04-02 11:00:56 -0700347 mDeviceId= (TextView) findViewById(R.id.imei);
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800348 number = (TextView) findViewById(R.id.number);
349 callState = (TextView) findViewById(R.id.call);
350 operatorName = (TextView) findViewById(R.id.operator);
351 roamingState = (TextView) findViewById(R.id.roaming);
352 gsmState = (TextView) findViewById(R.id.gsm);
353 gprsState = (TextView) findViewById(R.id.gprs);
Nathan Harold2b77d742016-03-19 13:22:10 -0700354 voiceNetwork = (TextView) findViewById(R.id.voice_network);
355 dataNetwork = (TextView) findViewById(R.id.data_network);
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800356 dBm = (TextView) findViewById(R.id.dbm);
357 mMwi = (TextView) findViewById(R.id.mwi);
358 mCfi = (TextView) findViewById(R.id.cfi);
359 mLocation = (TextView) findViewById(R.id.location);
360 mNeighboringCids = (TextView) findViewById(R.id.neighboring);
Wink Saville79bff2a2012-06-01 14:37:21 -0700361 mCellInfo = (TextView) findViewById(R.id.cellinfo);
Nathan Haroldcea413a2015-11-23 15:48:10 -0800362 mCellInfo.setTypeface(Typeface.MONOSPACE);
Wink Saville4f0d8812014-04-15 22:05:24 -0700363 mDcRtInfoTv = (TextView) findViewById(R.id.dcrtinfo);
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800364
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800365 sent = (TextView) findViewById(R.id.sent);
366 received = (TextView) findViewById(R.id.received);
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800367 smsc = (EditText) findViewById(R.id.smsc);
368 dnsCheckState = (TextView) findViewById(R.id.dnsCheckState);
Nathan Haroldcea413a2015-11-23 15:48:10 -0800369 mPingHostnameV4 = (TextView) findViewById(R.id.pingHostnameV4);
370 mPingHostnameV6 = (TextView) findViewById(R.id.pingHostnameV6);
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800371 mHttpClientTest = (TextView) findViewById(R.id.httpClientTest);
372
373 preferredNetworkType = (Spinner) findViewById(R.id.preferredNetworkType);
374 ArrayAdapter<String> adapter = new ArrayAdapter<String> (this,
375 android.R.layout.simple_spinner_item, mPreferredNetworkLabels);
johnwang342101a2009-09-23 16:22:34 -0700376 adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800377 preferredNetworkType.setAdapter(adapter);
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800378
Nathan Harold2b77d742016-03-19 13:22:10 -0700379 cellInfoRefreshRateSpinner = (Spinner) findViewById(R.id.cell_info_rate_select);
380 ArrayAdapter<String> cellInfoAdapter = new ArrayAdapter<String>(this,
381 android.R.layout.simple_spinner_item, mCellInfoRefreshRateLabels);
382 cellInfoAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
383 cellInfoRefreshRateSpinner.setAdapter(cellInfoAdapter);
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800384
Nathan Harold2b77d742016-03-19 13:22:10 -0700385 imsVoLteProvisionedSwitch = (Switch) findViewById(R.id.volte_provisioned_switch);
Wink Savillebf471282013-04-05 15:04:05 -0700386
Nathan Harold2b77d742016-03-19 13:22:10 -0700387 radioPowerOnSwitch = (Switch) findViewById(R.id.radio_power);
Wink Saville426fc662011-09-25 14:39:02 -0700388
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800389 pingTestButton = (Button) findViewById(R.id.ping_test);
390 pingTestButton.setOnClickListener(mPingButtonHandler);
391 updateSmscButton = (Button) findViewById(R.id.update_smsc);
392 updateSmscButton.setOnClickListener(mUpdateSmscButtonHandler);
393 refreshSmscButton = (Button) findViewById(R.id.refresh_smsc);
394 refreshSmscButton.setOnClickListener(mRefreshSmscButtonHandler);
395 dnsCheckToggleButton = (Button) findViewById(R.id.dns_check_toggle);
396 dnsCheckToggleButton.setOnClickListener(mDnsCheckButtonHandler);
johnwang342101a2009-09-23 16:22:34 -0700397
Tammo Spalinka5f4c8f2009-10-15 20:08:58 +0800398 oemInfoButton = (Button) findViewById(R.id.oem_info);
399 oemInfoButton.setOnClickListener(mOemInfoButtonHandler);
400 PackageManager pm = getPackageManager();
401 Intent oemInfoIntent = new Intent("com.android.settings.OEM_RADIO_INFO");
402 List<ResolveInfo> oemInfoIntentList = pm.queryIntentActivities(oemInfoIntent, 0);
403 if (oemInfoIntentList.size() == 0) {
404 oemInfoButton.setEnabled(false);
405 }
406
Nathan Harold2b77d742016-03-19 13:22:10 -0700407 mCellInfoRefreshRateIndex = CELL_INFO_LIST_RATE_DISABLED;
Nathan Haroldcea413a2015-11-23 15:48:10 -0800408 mPreferredNetworkTypeResult = mPreferredNetworkLabels.length - 1; //Unknown
409
410 //FIXME: Replace with TelephonyManager call
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800411 phone.getPreferredNetworkType(
412 mHandler.obtainMessage(EVENT_QUERY_PREFERRED_TYPE_DONE));
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800413
Nathan Haroldcea413a2015-11-23 15:48:10 -0800414 restoreFromBundle(icicle);
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800415 }
416
417 @Override
418 protected void onResume() {
419 super.onResume();
420
Nathan Haroldcea413a2015-11-23 15:48:10 -0800421 log("Started onResume");
422
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800423 updateMessageWaiting();
424 updateCallRedirect();
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800425 updateDataState();
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800426 updateDataStats2();
Nathan Harold2b77d742016-03-19 13:22:10 -0700427 updateRadioPowerState();
Pavel Zhamaitsiakcb267a62015-01-21 18:25:14 -0800428 updateImsVoLteProvisionedState();
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800429 updateProperties();
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800430 updateDnsCheckState();
Nathan Harold2b77d742016-03-19 13:22:10 -0700431 updateNetworkType();
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800432
Nathan Haroldcea413a2015-11-23 15:48:10 -0800433 updateNeighboringCids(mNeighboringCellResult);
434 updateLocation(mCellLocationResult);
435 updateCellInfo(mCellInfoResult);
436
437 mPingHostnameV4.setText(mPingHostnameResultV4);
438 mPingHostnameV6.setText(mPingHostnameResultV6);
439 mHttpClientTest.setText(mHttpClientTestResult);
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800440
Nathan Harold2b77d742016-03-19 13:22:10 -0700441 //move these here so that the initial updates in create don't cause values to reset
442 cellInfoRefreshRateSpinner.setOnItemSelectedListener(mCellInfoRefreshRateHandler);
443 preferredNetworkType.setOnItemSelectedListener(mPreferredNetworkHandler);
444 radioPowerOnSwitch.setOnCheckedChangeListener(mRadioPowerOnChangeListener);
445 imsVoLteProvisionedSwitch.setOnCheckedChangeListener(mImsVoLteCheckedChangeListener);
446
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800447 mTelephonyManager.listen(mPhoneStateListener,
Nathan Harold2b77d742016-03-19 13:22:10 -0700448 PhoneStateListener.LISTEN_CALL_STATE
449 //b/27803938 - RadioInfo currently cannot read PRECISE_CALL_STATE
450 // | PhoneStateListener.LISTEN_PRECISE_CALL_STATE
451 | PhoneStateListener.LISTEN_DATA_CONNECTION_STATE
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800452 | PhoneStateListener.LISTEN_DATA_ACTIVITY
453 | PhoneStateListener.LISTEN_CELL_LOCATION
454 | PhoneStateListener.LISTEN_MESSAGE_WAITING_INDICATOR
Wink Saville79bff2a2012-06-01 14:37:21 -0700455 | PhoneStateListener.LISTEN_CALL_FORWARDING_INDICATOR
Wink Saville4f0d8812014-04-15 22:05:24 -0700456 | PhoneStateListener.LISTEN_CELL_INFO
Nathan Harold2b77d742016-03-19 13:22:10 -0700457 | PhoneStateListener.LISTEN_SERVICE_STATE
458 | PhoneStateListener.LISTEN_SIGNAL_STRENGTHS
Wink Saville4f0d8812014-04-15 22:05:24 -0700459 | PhoneStateListener.LISTEN_DATA_CONNECTION_REAL_TIME_INFO);
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800460 }
461
462 @Override
Nathan Haroldcea413a2015-11-23 15:48:10 -0800463 protected void onPause() {
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800464 super.onPause();
465
Wink Savillebf471282013-04-05 15:04:05 -0700466 log("onPause: unregister phone & data intents");
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800467
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800468 mTelephonyManager.listen(mPhoneStateListener, PhoneStateListener.LISTEN_NONE);
469 }
470
Nathan Haroldcea413a2015-11-23 15:48:10 -0800471 private void restoreFromBundle(Bundle b) {
472 if( b == null) {
473 return;
474 }
475
476 mPingHostnameResultV4 = b.getString("mPingHostnameResultV4","");
477 mPingHostnameResultV6 = b.getString("mPingHostnameResultV6","");
478 mHttpClientTestResult = b.getString("mHttpClientTestResult","");
479
480 mPingHostnameV4.setText(mPingHostnameResultV4);
481 mPingHostnameV6.setText(mPingHostnameResultV6);
482 mHttpClientTest.setText(mHttpClientTestResult);
483
Nathan Harold2b77d742016-03-19 13:22:10 -0700484 mPreferredNetworkTypeResult = b.getInt("mPreferredNetworkTypeResult",
485 mPreferredNetworkLabels.length - 1);
486
487 mCellInfoRefreshRateIndex = b.getInt("mCellInfoRefreshRateIndex", 0);
488
489 cellInfoRefreshRateSpinner.setSelection(mCellInfoRefreshRateIndex);
Nathan Haroldcea413a2015-11-23 15:48:10 -0800490 }
491
492 @Override
493 protected void onSaveInstanceState(Bundle outState) {
494 outState.putString("mPingHostnameResultV4", mPingHostnameResultV4);
495 outState.putString("mPingHostnameResultV6", mPingHostnameResultV6);
496 outState.putString("mHttpClientTestResult", mHttpClientTestResult);
Nathan Harold2b77d742016-03-19 13:22:10 -0700497
Nathan Haroldcea413a2015-11-23 15:48:10 -0800498 outState.putInt("mPreferredNetworkTypeResult", mPreferredNetworkTypeResult);
Nathan Harold2b77d742016-03-19 13:22:10 -0700499
500 outState.putInt("mCellInfoRefreshRateIndex", mCellInfoRefreshRateIndex);
501
Nathan Haroldcea413a2015-11-23 15:48:10 -0800502 }
503
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800504 @Override
505 public boolean onCreateOptionsMenu(Menu menu) {
Wink Savillec3886682009-04-02 11:00:56 -0700506 menu.add(0, MENU_ITEM_SELECT_BAND, 0, R.string.radio_info_band_mode_label)
507 .setOnMenuItemClickListener(mSelectBandCallback)
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800508 .setAlphabeticShortcut('b');
509 menu.add(1, MENU_ITEM_VIEW_ADN, 0,
510 R.string.radioInfo_menu_viewADN).setOnMenuItemClickListener(mViewADNCallback);
511 menu.add(1, MENU_ITEM_VIEW_FDN, 0,
512 R.string.radioInfo_menu_viewFDN).setOnMenuItemClickListener(mViewFDNCallback);
513 menu.add(1, MENU_ITEM_VIEW_SDN, 0,
514 R.string.radioInfo_menu_viewSDN).setOnMenuItemClickListener(mViewSDNCallback);
515 menu.add(1, MENU_ITEM_GET_PDP_LIST,
516 0, R.string.radioInfo_menu_getPDP).setOnMenuItemClickListener(mGetPdpList);
517 menu.add(1, MENU_ITEM_TOGGLE_DATA,
Nathan Harold2b77d742016-03-19 13:22:10 -0700518 0, R.string.radio_info_data_connection_disable).setOnMenuItemClickListener(mToggleData);
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800519 return true;
520 }
521
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800522 @Override
Wink Savillec3886682009-04-02 11:00:56 -0700523 public boolean onPrepareOptionsMenu(Menu menu) {
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800524 // Get the TOGGLE DATA menu item in the right state.
525 MenuItem item = menu.findItem(MENU_ITEM_TOGGLE_DATA);
526 int state = mTelephonyManager.getDataState();
527 boolean visible = true;
528
529 switch (state) {
530 case TelephonyManager.DATA_CONNECTED:
531 case TelephonyManager.DATA_SUSPENDED:
Nathan Harold2b77d742016-03-19 13:22:10 -0700532 item.setTitle(R.string.radio_info_data_connection_disable);
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800533 break;
534 case TelephonyManager.DATA_DISCONNECTED:
Nathan Harold2b77d742016-03-19 13:22:10 -0700535 item.setTitle(R.string.radio_info_data_connection_enable);
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800536 break;
537 default:
538 visible = false;
539 break;
540 }
541 item.setVisible(visible);
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800542 return true;
543 }
544
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800545 private void updateDnsCheckState() {
Nathan Haroldcea413a2015-11-23 15:48:10 -0800546 //FIXME: Replace with a TelephonyManager call
Mike Lockwood5304c7e2009-04-05 11:37:45 -0700547 dnsCheckState.setText(phone.isDnsCheckDisabled() ?
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800548 "0.0.0.0 allowed" :"0.0.0.0 not allowed");
549 }
Wink Savillee2a14e32009-05-29 14:06:30 -0700550
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800551 private final void
Nathan Harold2b77d742016-03-19 13:22:10 -0700552 updateSignalStrength(SignalStrength signalStrength) {
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800553 Resources r = getResources();
554
Nathan Harold2b77d742016-03-19 13:22:10 -0700555 int signalDbm = signalStrength.getDbm();
Wink Savillee2a14e32009-05-29 14:06:30 -0700556
Nathan Harold2b77d742016-03-19 13:22:10 -0700557 int signalAsu = signalStrength.getAsuLevel();
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800558
559 if (-1 == signalAsu) signalAsu = 0;
560
561 dBm.setText(String.valueOf(signalDbm) + " "
562 + r.getString(R.string.radioInfo_display_dbm) + " "
563 + String.valueOf(signalAsu) + " "
564 + r.getString(R.string.radioInfo_display_asu));
565 }
566
567 private final void updateLocation(CellLocation location) {
jsh534f5ae2009-09-24 09:19:22 -0700568 Resources r = getResources();
Wink Savillec3886682009-04-02 11:00:56 -0700569 if (location instanceof GsmCellLocation) {
570 GsmCellLocation loc = (GsmCellLocation)location;
jsh534f5ae2009-09-24 09:19:22 -0700571 int lac = loc.getLac();
572 int cid = loc.getCid();
573 mLocation.setText(r.getString(R.string.radioInfo_lac) + " = "
574 + ((lac == -1) ? "unknown" : Integer.toHexString(lac))
575 + " "
576 + r.getString(R.string.radioInfo_cid) + " = "
577 + ((cid == -1) ? "unknown" : Integer.toHexString(cid)));
578 } else if (location instanceof CdmaCellLocation) {
579 CdmaCellLocation loc = (CdmaCellLocation)location;
580 int bid = loc.getBaseStationId();
581 int sid = loc.getSystemId();
582 int nid = loc.getNetworkId();
583 int lat = loc.getBaseStationLatitude();
584 int lon = loc.getBaseStationLongitude();
585 mLocation.setText("BID = "
586 + ((bid == -1) ? "unknown" : Integer.toHexString(bid))
587 + " "
588 + "SID = "
589 + ((sid == -1) ? "unknown" : Integer.toHexString(sid))
590 + " "
591 + "NID = "
592 + ((nid == -1) ? "unknown" : Integer.toHexString(nid))
593 + "\n"
594 + "LAT = "
595 + ((lat == -1) ? "unknown" : Integer.toHexString(lat))
596 + " "
597 + "LONG = "
598 + ((lon == -1) ? "unknown" : Integer.toHexString(lon)));
599 } else {
600 mLocation.setText("unknown");
Wink Savillec3886682009-04-02 11:00:56 -0700601 }
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800602
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800603
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800604 }
605
Nathan Haroldcea413a2015-11-23 15:48:10 -0800606 private final void updateNeighboringCids(List<NeighboringCellInfo> cids) {
johnwangf02c65f2009-09-25 17:26:54 -0700607 StringBuilder sb = new StringBuilder();
608
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800609 if (cids != null) {
610 if ( cids.isEmpty() ) {
johnwangf02c65f2009-09-25 17:26:54 -0700611 sb.append("no neighboring cells");
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800612 } else {
613 for (NeighboringCellInfo cell : cids) {
johnwangf02c65f2009-09-25 17:26:54 -0700614 sb.append(cell.toString()).append(" ");
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800615 }
616 }
617 } else {
johnwangf02c65f2009-09-25 17:26:54 -0700618 sb.append("unknown");
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800619 }
johnwangf02c65f2009-09-25 17:26:54 -0700620 mNeighboringCids.setText(sb.toString());
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800621 }
622
Nathan Haroldcea413a2015-11-23 15:48:10 -0800623 private final String getCellInfoDisplayString(int i) {
624 return (i != Integer.MAX_VALUE) ? Integer.toString(i) : "";
625 }
626
627 private final String getCellInfoDisplayString(long i) {
628 return (i != Long.MAX_VALUE) ? Long.toString(i) : "";
629 }
630
631 private final String buildCdmaInfoString(CellInfoCdma ci) {
632 CellIdentityCdma cidCdma = ci.getCellIdentity();
633 CellSignalStrengthCdma ssCdma = ci.getCellSignalStrength();
634
635 return String.format("%-3.3s %-5.5s %-5.5s %-5.5s %-6.6s %-6.6s %-6.6s %-6.6s %-5.5s",
636 ci.isRegistered() ? "S " : " ",
637 getCellInfoDisplayString(cidCdma.getSystemId()),
638 getCellInfoDisplayString(cidCdma.getNetworkId()),
639 getCellInfoDisplayString(cidCdma.getBasestationId()),
640 getCellInfoDisplayString(ssCdma.getCdmaDbm()),
641 getCellInfoDisplayString(ssCdma.getCdmaEcio()),
642 getCellInfoDisplayString(ssCdma.getEvdoDbm()),
643 getCellInfoDisplayString(ssCdma.getEvdoEcio()),
644 getCellInfoDisplayString(ssCdma.getEvdoSnr()));
645 }
646
647 private final String buildGsmInfoString(CellInfoGsm ci) {
648 CellIdentityGsm cidGsm = ci.getCellIdentity();
649 CellSignalStrengthGsm ssGsm = ci.getCellSignalStrength();
650
Nathan Harold2b77d742016-03-19 13:22:10 -0700651 return String.format("%-3.3s %-3.3s %-3.3s %-5.5s %-5.5s %-6.6s %-4.4s %-4.4s\n",
Nathan Haroldcea413a2015-11-23 15:48:10 -0800652 ci.isRegistered() ? "S " : " ",
653 getCellInfoDisplayString(cidGsm.getMcc()),
654 getCellInfoDisplayString(cidGsm.getMnc()),
655 getCellInfoDisplayString(cidGsm.getLac()),
656 getCellInfoDisplayString(cidGsm.getCid()),
Nathan Harold2b77d742016-03-19 13:22:10 -0700657 getCellInfoDisplayString(cidGsm.getArfcn()),
658 getCellInfoDisplayString(cidGsm.getBsic()),
Nathan Haroldcea413a2015-11-23 15:48:10 -0800659 getCellInfoDisplayString(ssGsm.getDbm()));
660 }
661
662 private final String buildLteInfoString(CellInfoLte ci) {
663 CellIdentityLte cidLte = ci.getCellIdentity();
664 CellSignalStrengthLte ssLte = ci.getCellSignalStrength();
665
666 return String.format(
Nathan Harold2b77d742016-03-19 13:22:10 -0700667 "%-3.3s %-3.3s %-3.3s %-5.5s %-5.5s %-3.3s %-6.6s %-4.4s %-4.4s %-2.2s\n",
Nathan Haroldcea413a2015-11-23 15:48:10 -0800668 ci.isRegistered() ? "S " : " ",
669 getCellInfoDisplayString(cidLte.getMcc()),
670 getCellInfoDisplayString(cidLte.getMnc()),
671 getCellInfoDisplayString(cidLte.getTac()),
672 getCellInfoDisplayString(cidLte.getCi()),
673 getCellInfoDisplayString(cidLte.getPci()),
Nathan Harold2b77d742016-03-19 13:22:10 -0700674 getCellInfoDisplayString(cidLte.getEarfcn()),
Nathan Haroldcea413a2015-11-23 15:48:10 -0800675 getCellInfoDisplayString(ssLte.getDbm()),
676 getCellInfoDisplayString(ssLte.getRsrq()),
677 getCellInfoDisplayString(ssLte.getTimingAdvance()));
678 }
679
680 private final String buildWcdmaInfoString(CellInfoWcdma ci) {
681 CellIdentityWcdma cidWcdma = ci.getCellIdentity();
682 CellSignalStrengthWcdma ssWcdma = ci.getCellSignalStrength();
683
Nathan Harold2b77d742016-03-19 13:22:10 -0700684 return String.format("%-3.3s %-3.3s %-3.3s %-5.5s %-5.5s %-6.6s %-3.3s %-4.4s\n",
Nathan Haroldcea413a2015-11-23 15:48:10 -0800685 ci.isRegistered() ? "S " : " ",
686 getCellInfoDisplayString(cidWcdma.getMcc()),
687 getCellInfoDisplayString(cidWcdma.getMnc()),
688 getCellInfoDisplayString(cidWcdma.getLac()),
689 getCellInfoDisplayString(cidWcdma.getCid()),
Nathan Harold2b77d742016-03-19 13:22:10 -0700690 getCellInfoDisplayString(cidWcdma.getUarfcn()),
Nathan Haroldcea413a2015-11-23 15:48:10 -0800691 getCellInfoDisplayString(cidWcdma.getPsc()),
692 getCellInfoDisplayString(ssWcdma.getDbm()));
693 }
694
695 private final String buildCellInfoString(List<CellInfo> arrayCi) {
696 String value = new String();
697 StringBuilder cdmaCells = new StringBuilder(),
698 gsmCells = new StringBuilder(),
699 lteCells = new StringBuilder(),
700 wcdmaCells = new StringBuilder();
701
702 if (arrayCi != null) {
703 for (CellInfo ci : arrayCi) {
704
705 if (ci instanceof CellInfoLte) {
706 lteCells.append(buildLteInfoString((CellInfoLte) ci));
707 } else if (ci instanceof CellInfoWcdma) {
708 wcdmaCells.append(buildWcdmaInfoString((CellInfoWcdma) ci));
709 } else if (ci instanceof CellInfoGsm) {
710 gsmCells.append(buildGsmInfoString((CellInfoGsm) ci));
711 } else if (ci instanceof CellInfoCdma) {
712 cdmaCells.append(buildCdmaInfoString((CellInfoCdma) ci));
Wink Saville79bff2a2012-06-01 14:37:21 -0700713 }
714 }
Nathan Haroldcea413a2015-11-23 15:48:10 -0800715 if (lteCells.length() != 0) {
716 value += String.format(
Nathan Harold2b77d742016-03-19 13:22:10 -0700717 "LTE\n%-3.3s %-3.3s %-3.3s %-5.5s %-5.5s %-3.3s %-6.6s %-4.4s %-4.4s %-2.2s\n",
718 "SRV", "MCC", "MNC", "TAC", "CID", "PCI", "EARFCN", "RSRP", "RSRQ", "TA");
Nathan Haroldcea413a2015-11-23 15:48:10 -0800719 value += lteCells.toString();
720 }
721 if (wcdmaCells.length() != 0) {
Nathan Harold2b77d742016-03-19 13:22:10 -0700722 value += String.format("WCDMA\n%-3.3s %-3.3s %-3.3s %-5.5s %-5.5s %-6.6s %-3.3s %-4.4s\n",
723 "SRV", "MCC", "MNC", "LAC", "CID", "UARFCN", "PSC", "RSCP");
Nathan Haroldcea413a2015-11-23 15:48:10 -0800724 value += wcdmaCells.toString();
725 }
726 if (gsmCells.length() != 0) {
Nathan Harold2b77d742016-03-19 13:22:10 -0700727 value += String.format("GSM\n%-3.3s %-3.3s %-3.3s %-5.5s %-5.5s %-6.6s %-4.4s %-4.4s\n",
728 "SRV", "MCC", "MNC", "LAC", "CID", "ARFCN", "BSIC", "RSSI");
Nathan Haroldcea413a2015-11-23 15:48:10 -0800729 value += gsmCells.toString();
730 }
731 if (cdmaCells.length() != 0) {
732 value += String.format(
733 "CDMA/EVDO\n%-3.3s %-5.5s %-5.5s %-5.5s %-6.6s %-6.6s %-6.6s %-6.6s %-5.5s\n",
734 "SRV", "SID", "NID", "BSID", "C-RSSI", "C-ECIO", "E-RSSI", "E-ECIO", "E-SNR");
735 value += cdmaCells.toString();
736 }
737 } else {
738 value ="unknown";
Wink Saville79bff2a2012-06-01 14:37:21 -0700739 }
Nathan Haroldcea413a2015-11-23 15:48:10 -0800740
741 return value.toString();
742 }
743
744 private final void updateCellInfo(List<CellInfo> arrayCi) {
745 mCellInfo.setText(buildCellInfoString(arrayCi));
Wink Saville79bff2a2012-06-01 14:37:21 -0700746 }
747
Wink Saville4f0d8812014-04-15 22:05:24 -0700748 private final void updateDcRtInfoTv(DataConnectionRealTimeInfo dcRtInfo) {
749 mDcRtInfoTv.setText(dcRtInfo.toString());
750 }
751
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800752 private final void
753 updateMessageWaiting() {
754 mMwi.setText(String.valueOf(mMwiValue));
755 }
756
757 private final void
758 updateCallRedirect() {
759 mCfi.setText(String.valueOf(mCfiValue));
760 }
761
762
763 private final void
Nathan Harold2b77d742016-03-19 13:22:10 -0700764 updateServiceState(ServiceState serviceState) {
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800765 int state = serviceState.getState();
766 Resources r = getResources();
767 String display = r.getString(R.string.radioInfo_unknown);
johnwang342101a2009-09-23 16:22:34 -0700768
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800769 switch (state) {
770 case ServiceState.STATE_IN_SERVICE:
771 display = r.getString(R.string.radioInfo_service_in);
772 break;
773 case ServiceState.STATE_OUT_OF_SERVICE:
774 case ServiceState.STATE_EMERGENCY_ONLY:
775 display = r.getString(R.string.radioInfo_service_emergency);
776 break;
777 case ServiceState.STATE_POWER_OFF:
778 display = r.getString(R.string.radioInfo_service_off);
779 break;
780 }
johnwang342101a2009-09-23 16:22:34 -0700781
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800782 gsmState.setText(display);
johnwang342101a2009-09-23 16:22:34 -0700783
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800784 if (serviceState.getRoaming()) {
785 roamingState.setText(R.string.radioInfo_roaming_in);
786 } else {
787 roamingState.setText(R.string.radioInfo_roaming_not);
788 }
789
790 operatorName.setText(serviceState.getOperatorAlphaLong());
791 }
792
793 private final void
Nathan Harold2b77d742016-03-19 13:22:10 -0700794 updatePhoneState(int state) {
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800795 Resources r = getResources();
796 String display = r.getString(R.string.radioInfo_unknown);
797
798 switch (state) {
Nathan Harold2b77d742016-03-19 13:22:10 -0700799 case TelephonyManager.CALL_STATE_IDLE:
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800800 display = r.getString(R.string.radioInfo_phone_idle);
801 break;
Nathan Harold2b77d742016-03-19 13:22:10 -0700802 case TelephonyManager.CALL_STATE_RINGING:
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800803 display = r.getString(R.string.radioInfo_phone_ringing);
804 break;
Nathan Harold2b77d742016-03-19 13:22:10 -0700805 case TelephonyManager.CALL_STATE_OFFHOOK:
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800806 display = r.getString(R.string.radioInfo_phone_offhook);
807 break;
808 }
809
810 callState.setText(display);
811 }
812
813 private final void
814 updateDataState() {
815 int state = mTelephonyManager.getDataState();
816 Resources r = getResources();
817 String display = r.getString(R.string.radioInfo_unknown);
818
819 switch (state) {
820 case TelephonyManager.DATA_CONNECTED:
821 display = r.getString(R.string.radioInfo_data_connected);
822 break;
823 case TelephonyManager.DATA_CONNECTING:
824 display = r.getString(R.string.radioInfo_data_connecting);
825 break;
826 case TelephonyManager.DATA_DISCONNECTED:
827 display = r.getString(R.string.radioInfo_data_disconnected);
828 break;
829 case TelephonyManager.DATA_SUSPENDED:
830 display = r.getString(R.string.radioInfo_data_suspended);
831 break;
832 }
johnwang342101a2009-09-23 16:22:34 -0700833
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800834 gprsState.setText(display);
835 }
836
837 private final void updateNetworkType() {
Nathan Harold2b77d742016-03-19 13:22:10 -0700838 if( phone != null ) {
839 ServiceState ss = phone.getServiceState();
840 dataNetwork.setText(ServiceState.rilRadioTechnologyToString(
841 phone.getServiceState().getRilDataRadioTechnology()));
842 voiceNetwork.setText(ServiceState.rilRadioTechnologyToString(
843 phone.getServiceState().getRilVoiceRadioTechnology()));
844 }
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800845 }
846
847 private final void
848 updateProperties() {
849 String s;
850 Resources r = getResources();
851
852 s = phone.getDeviceId();
johnwang342101a2009-09-23 16:22:34 -0700853 if (s == null) s = r.getString(R.string.radioInfo_unknown);
Wink Savillec3886682009-04-02 11:00:56 -0700854 mDeviceId.setText(s);
johnwang342101a2009-09-23 16:22:34 -0700855
Nathan Haroldcea413a2015-11-23 15:48:10 -0800856 //FIXME: Replace with a TelephonyManager call
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800857 s = phone.getLine1Number();
johnwang342101a2009-09-23 16:22:34 -0700858 if (s == null) s = r.getString(R.string.radioInfo_unknown);
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800859 number.setText(s);
860 }
861
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800862 private final void updateDataStats2() {
863 Resources r = getResources();
864
Jeff Sharkey93029862011-05-27 18:26:15 -0700865 long txPackets = TrafficStats.getMobileTxPackets();
866 long rxPackets = TrafficStats.getMobileRxPackets();
867 long txBytes = TrafficStats.getMobileTxBytes();
868 long rxBytes = TrafficStats.getMobileRxBytes();
johnwang342101a2009-09-23 16:22:34 -0700869
Jeff Sharkey93029862011-05-27 18:26:15 -0700870 String packets = r.getString(R.string.radioInfo_display_packets);
871 String bytes = r.getString(R.string.radioInfo_display_bytes);
johnwang342101a2009-09-23 16:22:34 -0700872
Jeff Sharkey93029862011-05-27 18:26:15 -0700873 sent.setText(txPackets + " " + packets + ", " + txBytes + " " + bytes);
874 received.setText(rxPackets + " " + packets + ", " + rxBytes + " " + bytes);
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800875 }
876
877 /**
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800878 * Ping a host name
879 */
880 private final void pingHostname() {
881 try {
Nathan Haroldcea413a2015-11-23 15:48:10 -0800882 try {
883 Process p4 = Runtime.getRuntime().exec("ping -c 1 www.google.com");
884 int status4 = p4.waitFor();
885 if (status4 == 0) {
886 mPingHostnameResultV4 = "Pass";
887 } else {
888 mPingHostnameResultV4 = String.format("Fail(%d)", status4);
889 }
890 } catch (IOException e) {
891 mPingHostnameResultV4 = "Fail: IOException";
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800892 }
Nathan Haroldcea413a2015-11-23 15:48:10 -0800893 try {
894 Process p6 = Runtime.getRuntime().exec("ping6 -c 1 www.google.com");
895 int status6 = p6.waitFor();
896 if (status6 == 0) {
897 mPingHostnameResultV6 = "Pass";
898 } else {
899 mPingHostnameResultV6 = String.format("Fail(%d)", status6);
900 }
901 } catch (IOException e) {
902 mPingHostnameResultV6 = "Fail: IOException";
903 }
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800904 } catch (InterruptedException e) {
Nathan Haroldcea413a2015-11-23 15:48:10 -0800905 mPingHostnameResultV4 = mPingHostnameResultV6 = "Fail: InterruptedException";
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800906 }
907 }
908
909 /**
910 * This function checks for basic functionality of HTTP Client.
911 */
912 private void httpClientTest() {
Narayan Kamathf25627c2014-12-12 13:53:28 +0000913 HttpURLConnection urlConnection = null;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800914 try {
Narayan Kamathf25627c2014-12-12 13:53:28 +0000915 // TODO: Hardcoded for now, make it UI configurable
Alex Klyubinb0090232015-04-02 11:08:51 -0700916 URL url = new URL("https://www.google.com");
Narayan Kamathf25627c2014-12-12 13:53:28 +0000917 urlConnection = (HttpURLConnection) url.openConnection();
918 if (urlConnection.getResponseCode() == 200) {
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800919 mHttpClientTestResult = "Pass";
920 } else {
Narayan Kamathf25627c2014-12-12 13:53:28 +0000921 mHttpClientTestResult = "Fail: Code: " + urlConnection.getResponseMessage();
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800922 }
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800923 } catch (IOException e) {
924 mHttpClientTestResult = "Fail: IOException";
Narayan Kamathf25627c2014-12-12 13:53:28 +0000925 } finally {
926 if (urlConnection != null) {
927 urlConnection.disconnect();
928 }
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800929 }
930 }
931
932 private void refreshSmsc() {
Nathan Haroldcea413a2015-11-23 15:48:10 -0800933 //FIXME: Replace with a TelephonyManager call
jsh21dd4072009-05-12 11:26:55 -0700934 phone.getSmscAddress(mHandler.obtainMessage(EVENT_QUERY_SMSC_DONE));
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800935 }
936
Nathan Haroldcea413a2015-11-23 15:48:10 -0800937 private final void updateAllCellInfo() {
938
939 mCellInfo.setText("");
940 mNeighboringCids.setText("");
941 mLocation.setText("");
942
943 final Runnable updateAllCellInfoResults = new Runnable() {
944 public void run() {
945 updateNeighboringCids(mNeighboringCellResult);
946 updateLocation(mCellLocationResult);
947 updateCellInfo(mCellInfoResult);
948 }
949 };
950
951 Thread locThread = new Thread() {
952 @Override
953 public void run() {
954 mCellInfoResult = mTelephonyManager.getAllCellInfo();
955 mCellLocationResult = mTelephonyManager.getCellLocation();
956 mNeighboringCellResult = mTelephonyManager.getNeighboringCellInfo();
957
958 mHandler.post(updateAllCellInfoResults);
959 }
960 };
961 locThread.start();
962 }
963
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800964 private final void updatePingState() {
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800965 // Set all to unknown since the threads will take a few secs to update.
Nathan Haroldcea413a2015-11-23 15:48:10 -0800966 mPingHostnameResultV4 = getResources().getString(R.string.radioInfo_unknown);
967 mPingHostnameResultV6 = getResources().getString(R.string.radioInfo_unknown);
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800968 mHttpClientTestResult = getResources().getString(R.string.radioInfo_unknown);
969
Nathan Haroldcea413a2015-11-23 15:48:10 -0800970 mPingHostnameV4.setText(mPingHostnameResultV4);
971 mPingHostnameV6.setText(mPingHostnameResultV6);
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800972 mHttpClientTest.setText(mHttpClientTestResult);
973
974 final Runnable updatePingResults = new Runnable() {
975 public void run() {
Nathan Haroldcea413a2015-11-23 15:48:10 -0800976 mPingHostnameV4.setText(mPingHostnameResultV4);
977 mPingHostnameV6.setText(mPingHostnameResultV6);
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800978 mHttpClientTest.setText(mHttpClientTestResult);
979 }
980 };
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800981
982 Thread hostname = new Thread() {
983 @Override
984 public void run() {
985 pingHostname();
Nathan Haroldcea413a2015-11-23 15:48:10 -0800986 mHandler.post(updatePingResults);
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800987 }
988 };
989 hostname.start();
990
991 Thread httpClient = new Thread() {
992 @Override
993 public void run() {
994 httpClientTest();
Nathan Haroldcea413a2015-11-23 15:48:10 -0800995 mHandler.post(updatePingResults);
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800996 }
997 };
998 httpClient.start();
999 }
1000
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -08001001 private MenuItem.OnMenuItemClickListener mViewADNCallback = new MenuItem.OnMenuItemClickListener() {
1002 public boolean onMenuItemClick(MenuItem item) {
1003 Intent intent = new Intent(Intent.ACTION_VIEW);
1004 // XXX We need to specify the component here because if we don't
1005 // the activity manager will try to resolve the type by calling
1006 // the content provider, which causes it to be loaded in a process
1007 // other than the Dialer process, which causes a lot of stuff to
1008 // break.
1009 intent.setClassName("com.android.phone",
1010 "com.android.phone.SimContacts");
1011 startActivity(intent);
1012 return true;
1013 }
1014 };
1015
1016 private MenuItem.OnMenuItemClickListener mViewFDNCallback = new MenuItem.OnMenuItemClickListener() {
1017 public boolean onMenuItemClick(MenuItem item) {
1018 Intent intent = new Intent(Intent.ACTION_VIEW);
1019 // XXX We need to specify the component here because if we don't
1020 // the activity manager will try to resolve the type by calling
1021 // the content provider, which causes it to be loaded in a process
1022 // other than the Dialer process, which causes a lot of stuff to
1023 // break.
1024 intent.setClassName("com.android.phone",
Andrew Leeda90d682014-10-31 13:12:20 -07001025 "com.android.phone.settings.fdn.FdnList");
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -08001026 startActivity(intent);
1027 return true;
1028 }
1029 };
1030
1031 private MenuItem.OnMenuItemClickListener mViewSDNCallback = new MenuItem.OnMenuItemClickListener() {
1032 public boolean onMenuItemClick(MenuItem item) {
1033 Intent intent = new Intent(
Wink Savillec3886682009-04-02 11:00:56 -07001034 Intent.ACTION_VIEW, Uri.parse("content://icc/sdn"));
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -08001035 // XXX We need to specify the component here because if we don't
1036 // the activity manager will try to resolve the type by calling
1037 // the content provider, which causes it to be loaded in a process
1038 // other than the Dialer process, which causes a lot of stuff to
1039 // break.
1040 intent.setClassName("com.android.phone",
1041 "com.android.phone.ADNList");
1042 startActivity(intent);
1043 return true;
1044 }
1045 };
1046
Tammo Spalinka5f4c8f2009-10-15 20:08:58 +08001047 private MenuItem.OnMenuItemClickListener mGetPdpList = new MenuItem.OnMenuItemClickListener() {
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -08001048 public boolean onMenuItemClick(MenuItem item) {
Nathan Haroldcea413a2015-11-23 15:48:10 -08001049 //FIXME: Replace with a TelephonyManager call
Tammo Spalinka5f4c8f2009-10-15 20:08:58 +08001050 phone.getDataCallList(null);
1051 return true;
1052 }
1053 };
1054
1055 private MenuItem.OnMenuItemClickListener mSelectBandCallback = new MenuItem.OnMenuItemClickListener() {
1056 public boolean onMenuItemClick(MenuItem item) {
1057 Intent intent = new Intent();
1058 intent.setClass(RadioInfo.this, BandMode.class);
1059 startActivity(intent);
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -08001060 return true;
1061 }
1062 };
johnwang342101a2009-09-23 16:22:34 -07001063
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -08001064 private MenuItem.OnMenuItemClickListener mToggleData = new MenuItem.OnMenuItemClickListener() {
1065 public boolean onMenuItemClick(MenuItem item) {
1066 int state = mTelephonyManager.getDataState();
1067 switch (state) {
1068 case TelephonyManager.DATA_CONNECTED:
Nathan Haroldcea413a2015-11-23 15:48:10 -08001069 //FIXME: Replace with a TelephonyManager call
Robert Greenwalt0d4c5002014-05-21 20:02:32 -07001070 phone.setDataEnabled(false);
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -08001071 break;
1072 case TelephonyManager.DATA_DISCONNECTED:
Nathan Haroldcea413a2015-11-23 15:48:10 -08001073 //FIXME: Replace with a TelephonyManager call
Robert Greenwalt0d4c5002014-05-21 20:02:32 -07001074 phone.setDataEnabled(true);
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -08001075 break;
1076 default:
1077 // do nothing
1078 break;
1079 }
1080 return true;
1081 }
1082 };
1083
Nathan Harold2b77d742016-03-19 13:22:10 -07001084 private boolean isRadioOn() {
1085 //FIXME: Replace with a TelephonyManager call
1086 return phone.getServiceState().getState() != ServiceState.STATE_POWER_OFF;
1087 }
1088
1089 private void updateRadioPowerState() {
1090 //delightful hack to prevent on-checked-changed calls from
1091 //actually forcing the radio preference to its transient/current value.
1092 radioPowerOnSwitch.setOnCheckedChangeListener(null);
1093 radioPowerOnSwitch.setChecked(isRadioOn());
1094 radioPowerOnSwitch.setOnCheckedChangeListener(mRadioPowerOnChangeListener);
1095 }
1096
1097 OnCheckedChangeListener mRadioPowerOnChangeListener = new OnCheckedChangeListener() {
1098 @Override
1099 public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
1100 log("toggle radio power: currently " + (isRadioOn()?"on":"off"));
1101 phone.setRadioPower(isChecked);
1102 }
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -08001103 };
1104
Nathan Harold2b77d742016-03-19 13:22:10 -07001105 void setImsVoLteProvisionedState( boolean state ) {
1106 log(String.format("toggle VoLTE provisioned: %s", ((state) ? "on":"off")));
Wink Savillebf471282013-04-05 15:04:05 -07001107
Nathan Harold2b77d742016-03-19 13:22:10 -07001108 if (phone != null && mImsManager != null) {
1109 QueuedWork.singleThreadExecutor().submit(new Runnable() {
1110 public void run() {
1111 try {
1112 mImsManager.getConfigInterface().setProvisionedValue(
1113 ImsConfig.ConfigConstants.VLT_SETTING_ENABLED,
1114 state? 1 : 0);
1115 } catch (ImsException e) {
1116 Log.e(TAG, "setImsVoLteProvisioned() exception:", e);
1117 }
Pavel Zhamaitsiakcb267a62015-01-21 18:25:14 -08001118 }
Nathan Harold2b77d742016-03-19 13:22:10 -07001119 });
Pavel Zhamaitsiakcb267a62015-01-21 18:25:14 -08001120 }
Nathan Harold2b77d742016-03-19 13:22:10 -07001121 }
Pavel Zhamaitsiakcb267a62015-01-21 18:25:14 -08001122
1123 private boolean isImsVoLteProvisioned() {
Nathan Harold2b77d742016-03-19 13:22:10 -07001124 if (phone != null && mImsManager != null) {
1125 return mImsManager.isVolteEnabledByPlatform(phone.getContext())
1126 && mImsManager.isVolteProvisionedOnDevice(phone.getContext());
Pavel Zhamaitsiakcb267a62015-01-21 18:25:14 -08001127 }
1128 return false;
1129 }
1130
Nathan Harold2b77d742016-03-19 13:22:10 -07001131 OnCheckedChangeListener mImsVoLteCheckedChangeListener = new OnCheckedChangeListener() {
Wink Saville426fc662011-09-25 14:39:02 -07001132 @Override
Nathan Harold2b77d742016-03-19 13:22:10 -07001133 public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
1134 setImsVoLteProvisionedState(isChecked);
1135 }
Wink Saville426fc662011-09-25 14:39:02 -07001136 };
1137
Nathan Harold2b77d742016-03-19 13:22:10 -07001138 private void updateImsVoLteProvisionedState() {
1139 log("updateImsVoLteProvisionedState isImsVoLteProvisioned()=" + isImsVoLteProvisioned());
1140 //delightful hack to prevent on-checked-changed calls from
1141 //actually forcing the ims provisioning to its transient/current value.
1142 imsVoLteProvisionedSwitch.setOnCheckedChangeListener(null);
1143 imsVoLteProvisionedSwitch.setChecked(isImsVoLteProvisioned());
1144 imsVoLteProvisionedSwitch.setOnCheckedChangeListener(mImsVoLteCheckedChangeListener);
Wink Saville426fc662011-09-25 14:39:02 -07001145 }
1146
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -08001147 OnClickListener mDnsCheckButtonHandler = new OnClickListener() {
1148 public void onClick(View v) {
Nathan Haroldcea413a2015-11-23 15:48:10 -08001149 //FIXME: Replace with a TelephonyManager call
Wink Savillec3886682009-04-02 11:00:56 -07001150 phone.disableDnsCheck(!phone.isDnsCheckDisabled());
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -08001151 updateDnsCheckState();
1152 }
1153 };
johnwang342101a2009-09-23 16:22:34 -07001154
Tammo Spalinka5f4c8f2009-10-15 20:08:58 +08001155 OnClickListener mOemInfoButtonHandler = new OnClickListener() {
1156 public void onClick(View v) {
1157 Intent intent = new Intent("com.android.settings.OEM_RADIO_INFO");
1158 try {
1159 startActivity(intent);
1160 } catch (android.content.ActivityNotFoundException ex) {
Wink Savillebf471282013-04-05 15:04:05 -07001161 log("OEM-specific Info/Settings Activity Not Found : " + ex);
Tammo Spalinka5f4c8f2009-10-15 20:08:58 +08001162 // If the activity does not exist, there are no OEM
1163 // settings, and so we can just do nothing...
1164 }
1165 }
1166 };
1167
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -08001168 OnClickListener mPingButtonHandler = new OnClickListener() {
1169 public void onClick(View v) {
1170 updatePingState();
1171 }
1172 };
1173
1174 OnClickListener mUpdateSmscButtonHandler = new OnClickListener() {
1175 public void onClick(View v) {
1176 updateSmscButton.setEnabled(false);
jsh21dd4072009-05-12 11:26:55 -07001177 phone.setSmscAddress(smsc.getText().toString(),
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -08001178 mHandler.obtainMessage(EVENT_UPDATE_SMSC_DONE));
1179 }
1180 };
1181
1182 OnClickListener mRefreshSmscButtonHandler = new OnClickListener() {
1183 public void onClick(View v) {
1184 refreshSmsc();
1185 }
1186 };
1187
Nathan Haroldcea413a2015-11-23 15:48:10 -08001188 AdapterView.OnItemSelectedListener mPreferredNetworkHandler =
1189 new AdapterView.OnItemSelectedListener() {
1190
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -08001191 public void onItemSelected(AdapterView parent, View v, int pos, long id) {
Nathan Haroldcea413a2015-11-23 15:48:10 -08001192 if (mPreferredNetworkTypeResult != pos && pos >= 0
1193 && pos <= mPreferredNetworkLabels.length - 2) {
1194 mPreferredNetworkTypeResult = pos;
1195 Message msg = mHandler.obtainMessage(EVENT_SET_PREFERRED_TYPE_DONE);
1196 phone.setPreferredNetworkType(mPreferredNetworkTypeResult, msg);
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -08001197 }
1198 }
1199
1200 public void onNothingSelected(AdapterView parent) {
1201 }
1202 };
1203
Nathan Harold2b77d742016-03-19 13:22:10 -07001204 AdapterView.OnItemSelectedListener mCellInfoRefreshRateHandler =
1205 new AdapterView.OnItemSelectedListener() {
Wink Savillebf471282013-04-05 15:04:05 -07001206
Nathan Harold2b77d742016-03-19 13:22:10 -07001207 public void onItemSelected(AdapterView parent, View v, int pos, long id) {
1208 mCellInfoRefreshRateIndex = pos;
1209 phone.setCellInfoListRate(mCellInfoRefreshRates[pos]);
1210 updateAllCellInfo();
1211 }
1212
1213 public void onNothingSelected(AdapterView parent) {
1214 }
1215 };
1216
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -08001217}