Guest User

Untitled

a guest
Oct 19th, 2017
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 222.52 KB | None | 0 0
  1. package com.android.internal.telephony;
  2.  
  3. import android.content.BroadcastReceiver;
  4. import android.content.Context;
  5. import android.content.Intent;
  6. import android.content.IntentFilter;
  7. import android.hardware.display.DisplayManager;
  8. import android.hardware.display.DisplayManager.DisplayListener;
  9. import android.net.ConnectivityManager;
  10. import android.net.LocalSocket;
  11. import android.net.LocalSocketAddress;
  12. import android.net.LocalSocketAddress.Namespace;
  13. import android.os.AsyncResult;
  14. import android.os.Build;
  15. import android.os.Bundle;
  16. import android.os.Handler;
  17. import android.os.HandlerThread;
  18. import android.os.Looper;
  19. import android.os.Message;
  20. import android.os.Parcel;
  21. import android.os.PowerManager;
  22. import android.os.PowerManager.WakeLock;
  23. import android.os.SystemClock;
  24. import android.os.SystemProperties;
  25. import android.preference.PreferenceManager;
  26. import android.provider.Settings.Global;
  27. import android.provider.Settings.Secure;
  28. import android.provider.Settings.System;
  29. import android.provider.Telephony.Threads;
  30. import android.telephony.CellInfo;
  31. import android.telephony.ModemActivityInfo;
  32. import android.telephony.NeighboringCellInfo;
  33. import android.telephony.PhoneNumberUtils;
  34. import android.telephony.RadioAccessFamily;
  35. import android.telephony.Rlog;
  36. import android.telephony.SignalStrength;
  37. import android.telephony.SmsMessage;
  38. import android.telephony.SubscriptionManager;
  39. import android.telephony.TelephonyManager;
  40. import android.telephony.gsm.CbConfig;
  41. import android.text.TextUtils;
  42. import android.util.Base64;
  43. import android.util.SparseArray;
  44. import android.view.Display;
  45. import com.android.internal.telephony.CommandsInterface.RadioState;
  46. import com.android.internal.telephony.DriverCall.State;
  47. import com.android.internal.telephony.cdma.CdmaCallWaitingNotification;
  48. import com.android.internal.telephony.cdma.CdmaInformationRecords;
  49. import com.android.internal.telephony.cdma.CdmaInformationRecords.CdmaDisplayInfoRec;
  50. import com.android.internal.telephony.cdma.CdmaInformationRecords.CdmaLineControlInfoRec;
  51. import com.android.internal.telephony.cdma.CdmaInformationRecords.CdmaNumberInfoRec;
  52. import com.android.internal.telephony.cdma.CdmaInformationRecords.CdmaRedirectingNumberInfoRec;
  53. import com.android.internal.telephony.cdma.CdmaInformationRecords.CdmaSignalInfoRec;
  54. import com.android.internal.telephony.cdma.CdmaInformationRecords.CdmaT53AudioControlInfoRec;
  55. import com.android.internal.telephony.cdma.CdmaInformationRecords.CdmaT53ClirInfoRec;
  56. import com.android.internal.telephony.cdma.CdmaSmsBroadcastConfigInfo;
  57. import com.android.internal.telephony.dataconnection.DataCallResponse;
  58. import com.android.internal.telephony.dataconnection.DataProfile;
  59. import com.android.internal.telephony.dataconnection.DcFailCause;
  60. import com.android.internal.telephony.gsm.CallFailCause;
  61. import com.android.internal.telephony.gsm.SmsBroadcastConfigInfo;
  62. import com.android.internal.telephony.gsm.SsData;
  63. import com.android.internal.telephony.gsm.SuppServiceNotification;
  64. import com.android.internal.telephony.uicc.AdnRecord;
  65. import com.android.internal.telephony.uicc.IccCardApplicationStatus;
  66. import com.android.internal.telephony.uicc.IccCardStatus;
  67. import com.android.internal.telephony.uicc.IccIoResult;
  68. import com.android.internal.telephony.uicc.IccRefreshResponse;
  69. import com.android.internal.telephony.uicc.IccUtils;
  70. import com.android.internal.telephony.uicc.SimLockInfoResult;
  71. import com.android.internal.telephony.uicc.SimPBEntryResult;
  72. import com.google.android.mms.pdu.CharacterSets;
  73. import com.google.android.mms.pdu.PduPart;
  74. import com.samsung.android.feature.FloatingFeature;
  75. import com.sec.android.app.CscFeature;
  76. import com.sec.android.emergencymode.EmergencyManager;
  77. import java.io.ByteArrayInputStream;
  78. import java.io.DataInputStream;
  79. import java.io.FileDescriptor;
  80. import java.io.IOException;
  81. import java.io.InputStream;
  82. import java.io.PrintWriter;
  83. import java.io.UnsupportedEncodingException;
  84. import java.util.ArrayList;
  85. import java.util.Arrays;
  86. import java.util.Collections;
  87. import java.util.HashSet;
  88. import java.util.Iterator;
  89. import java.util.Set;
  90. import java.util.concurrent.atomic.AtomicBoolean;
  91.  
  92. public class RIL extends BaseCommands implements CommandsInterface {
  93. private static final int CDMA_BROADCAST_SMS_NO_OF_SERVICE_CATEGORIES = 31;
  94. private static final int CDMA_BSI_NO_OF_INTS_STRUCT = 3;
  95. public static final boolean CELL_BROADCAST_ENABLE = true;
  96. private static final int DEFAULT_WAKE_LOCK_TIMEOUT = 60000;
  97. static final String ETWS_TEST = "jp.co.android.softbankCBM.ETWS";
  98. static final int EVENT_SEND = 1;
  99. static final int EVENT_WAKE_LOCK_TIMEOUT = 2;
  100. static final String LOG_LEVEL_PROP = "ro.debug_level";
  101. static final String LOG_LEVEL_PROP_HIGH = "0x4948";
  102. static final String LOG_LEVEL_PROP_LOW = "0x4f4c";
  103. static final String LOG_LEVEL_PROP_MID = "0x494d";
  104. static final int NETTEXT_GSM_SMS_CBMI_LIST_SIZE_MAX = 100;
  105. private static final int OEM_FUNCTION_ID_NETWORK = 2;
  106. private static final int OEM_HIDDEN_MAIN_CMD = 81;
  107. private static final int OEM_NET_GET_MODEM_CAP = 97;
  108. private static final int OEM_NET_UPDATE_SUB_BINDING = 98;
  109. private static final int OEM_SUB_SIM_LOCK_GET = 66;
  110. private static final int OEM_SUB_SIM_LOCK_SET = 65;
  111. static final int RADIO_SCREEN_OFF = 0;
  112. static final int RADIO_SCREEN_ON = 1;
  113. static final int RADIO_SCREEN_UNSET = -1;
  114. static final int RESPONSE_SOLICITED = 0;
  115. static final int RESPONSE_UNSOLICITED = 1;
  116. static final boolean RILJ_LOGD = true;
  117. static final boolean RILJ_LOGV = false;
  118. static final String RILJ_LOG_TAG = "RILJ";
  119. static final int RIL_MAX_COMMAND_BYTES = 8192;
  120. static final boolean SHIP_BUILD = "true".equals(SystemProperties.get("ro.product_ship", "false"));
  121. static final String[] SOCKET_NAME_RIL = new String[]{"rild", "rild2", "rild3"};
  122. static final int SOCKET_OPEN_RETRY_MILLIS = 4000;
  123. static final int USSD_DCS_KS5601 = 148;
  124. static final String WAPPUSH_TEST = "jp.co.android.ETWS_WAPPUSH";
  125. private int initPhoneType;
  126. private final BroadcastReceiver mBatteryStateListener;
  127. Display mDefaultDisplay;
  128. int mDefaultDisplayState;
  129. private final DisplayListener mDisplayListener;
  130. private int mDtmfProgress;
  131. private Integer mInstanceId;
  132. BroadcastReceiver mIntentReceiver;
  133. boolean mIsDevicePlugged;
  134. Object mLastNITZTimeInfo;
  135. int mRadioScreenState;
  136. RILReceiver mReceiver;
  137. Thread mReceiverThread;
  138. SparseArray<RILRequest> mRequestList;
  139. RILSender mSender;
  140. HandlerThread mSenderThread;
  141. LocalSocket mSocket;
  142. AtomicBoolean mTestingEmergencyCall;
  143. WakeLock mWakeLock;
  144. int mWakeLockCount;
  145. final int mWakeLockTimeout;
  146.  
  147. class C00281 extends BroadcastReceiver {
  148. C00281() {
  149. }
  150.  
  151. public void onReceive(Context context, Intent intent) {
  152. if (intent.getAction().equals("com.samsung.intent.action.EMERGENCY_STATE_CHANGED")) {
  153. int state = intent.getIntExtra("reason", 0);
  154. int enterType = intent.getIntExtra("enterType", 0);
  155. if (state == 2 && enterType != 512) {
  156. RIL.this.sendSafemode(true);
  157. } else if (state == 4 && enterType != 512) {
  158. RIL.this.sendSafemode(false);
  159. }
  160. } else if (!intent.getAction().equals(RIL.ETWS_TEST) && !intent.getAction().equals(RIL.WAPPUSH_TEST)) {
  161. Rlog.w(RIL.RILJ_LOG_TAG, "RIL received unexpected Intent: " + intent.getAction());
  162. } else if ("eng".equals(Build.TYPE) && SystemProperties.getBoolean("persist.EarthquakeTestmode", false)) {
  163. Bundle extras = intent.getExtras();
  164. if (extras == null) {
  165. Rlog.d(RIL.RILJ_LOG_TAG, "intent.getExtras() = null");
  166. } else if (intent.getAction().equals(RIL.ETWS_TEST) && RIL.this.mGsmBroadcastSmsRegistrant != null) {
  167. Rlog.d(RIL.RILJ_LOG_TAG, "ETWS_TEST receive");
  168. RIL.this.mGsmBroadcastSmsRegistrant.notifyRegistrant(new AsyncResult(null, extras.get("pdus"), null));
  169. } else if (intent.getAction().equals(RIL.WAPPUSH_TEST) && RIL.this.mGsmSmsRegistrant != null) {
  170. Rlog.d(RIL.RILJ_LOG_TAG, "WAPPUSH_TEST receive");
  171. String[] a = new String[2];
  172. a[1] = (String) extras.get("pdus");
  173. Rlog.d(RIL.RILJ_LOG_TAG, "call newFromCMT");
  174. SmsMessage sms = SmsMessage.newFromCMT(a);
  175. Rlog.d(RIL.RILJ_LOG_TAG, "call mGsmSmsRegistrant notifyRegistrant");
  176. RIL.this.mGsmSmsRegistrant.notifyRegistrant(new AsyncResult(null, sms, null));
  177. }
  178. }
  179. }
  180. }
  181.  
  182. class C00292 implements DisplayListener {
  183. C00292() {
  184. }
  185.  
  186. public void onDisplayAdded(int displayId) {
  187. }
  188.  
  189. public void onDisplayRemoved(int displayId) {
  190. }
  191.  
  192. public void onDisplayChanged(int displayId) {
  193. if (displayId == 0) {
  194. int oldState = RIL.this.mDefaultDisplayState;
  195. if (RIL.this.mDefaultDisplay == null) {
  196. Rlog.e(RIL.RILJ_LOG_TAG, "There is no default display");
  197. return;
  198. }
  199. RIL.this.mDefaultDisplayState = RIL.this.mDefaultDisplay.getState();
  200. if (RIL.this.mDefaultDisplayState != oldState) {
  201. RIL.this.updateScreenState();
  202. }
  203. }
  204. }
  205. }
  206.  
  207. class C00303 extends BroadcastReceiver {
  208. C00303() {
  209. }
  210.  
  211. public void onReceive(Context context, Intent intent) {
  212. boolean z = false;
  213. boolean oldState = RIL.this.mIsDevicePlugged;
  214. RIL ril = RIL.this;
  215. if (intent.getIntExtra("plugged", 0) != 0) {
  216. z = true;
  217. }
  218. ril.mIsDevicePlugged = z;
  219. if (RIL.this.mIsDevicePlugged != oldState) {
  220. RIL.this.updateScreenState();
  221. }
  222. }
  223. }
  224.  
  225. class RILReceiver implements Runnable {
  226. byte[] buffer = new byte[9216];
  227.  
  228. RILReceiver() {
  229. }
  230.  
  231. public void run() {
  232. Throwable tr;
  233. int retryCount = 0;
  234. String rilSocket = "rild";
  235. while (true) {
  236. LocalSocket s = null;
  237. try {
  238. if (RIL.this.mInstanceId == null || RIL.this.mInstanceId.intValue() == 0) {
  239. rilSocket = RIL.SOCKET_NAME_RIL[0];
  240. } else {
  241. rilSocket = RIL.SOCKET_NAME_RIL[RIL.this.mInstanceId.intValue()];
  242. }
  243. try {
  244. LocalSocket s2 = new LocalSocket();
  245. try {
  246. s2.connect(new LocalSocketAddress(rilSocket, Namespace.RESERVED));
  247. retryCount = 0;
  248. RIL.this.mSocket = s2;
  249. Rlog.i(RIL.RILJ_LOG_TAG, "(" + RIL.this.mInstanceId + ") Connected to '" + rilSocket + "' socket");
  250. int length = 0;
  251. try {
  252. InputStream is = RIL.this.mSocket.getInputStream();
  253. while (true) {
  254. length = RIL.readRilMessage(is, this.buffer);
  255. if (length >= 0) {
  256. Parcel p = Parcel.obtain();
  257. p.unmarshall(this.buffer, 0, length);
  258. p.setDataPosition(0);
  259. RIL.this.processResponse(p);
  260. p.recycle();
  261. }
  262. break;
  263. }
  264. } catch (IOException ex) {
  265. Rlog.i(RIL.RILJ_LOG_TAG, "'" + rilSocket + "' socket closed", ex);
  266. } catch (Throwable th) {
  267. tr = th;
  268. s = s2;
  269. }
  270. Rlog.i(RIL.RILJ_LOG_TAG, "(" + RIL.this.mInstanceId + ") Disconnected from '" + rilSocket + "' socket");
  271. RIL.this.setRadioState(RadioState.RADIO_UNAVAILABLE);
  272. try {
  273. RIL.this.mSocket.close();
  274. } catch (IOException e) {
  275. }
  276. RIL.this.mSocket = null;
  277. RILRequest.resetSerial();
  278. RIL.this.clearRequestList(1, false);
  279. } catch (IOException e2) {
  280. s = s2;
  281. if (s != null) {
  282. try {
  283. s.close();
  284. } catch (IOException e3) {
  285. }
  286. }
  287. if (retryCount != 8) {
  288. Rlog.e(RIL.RILJ_LOG_TAG, "Couldn't find '" + rilSocket + "' socket after " + retryCount + " times, continuing to retry silently");
  289. } else if (retryCount >= 0 && retryCount < 8) {
  290. Rlog.i(RIL.RILJ_LOG_TAG, "Couldn't find '" + rilSocket + "' socket; retrying after timeout");
  291. }
  292. try {
  293. Thread.sleep(4000);
  294. } catch (InterruptedException e4) {
  295. }
  296. retryCount++;
  297. }
  298. } catch (IOException e5) {
  299. if (s != null) {
  300. s.close();
  301. }
  302. if (retryCount != 8) {
  303. Rlog.i(RIL.RILJ_LOG_TAG, "Couldn't find '" + rilSocket + "' socket; retrying after timeout");
  304. } else {
  305. Rlog.e(RIL.RILJ_LOG_TAG, "Couldn't find '" + rilSocket + "' socket after " + retryCount + " times, continuing to retry silently");
  306. }
  307. Thread.sleep(4000);
  308. retryCount++;
  309. }
  310. } catch (Throwable th2) {
  311. tr = th2;
  312. }
  313. }
  314. Rlog.e(RIL.RILJ_LOG_TAG, "Uncaught exception", tr);
  315. RIL.this.notifyRegistrantsRilConnectionChanged(-1);
  316. }
  317. }
  318.  
  319. class RILSender extends Handler implements Runnable {
  320. byte[] dataLength = new byte[4];
  321.  
  322. public RILSender(Looper looper) {
  323. super(looper);
  324. }
  325.  
  326. public void run() {
  327. }
  328.  
  329. public void handleMessage(Message msg) {
  330. RILRequest rr = (RILRequest) msg.obj;
  331. switch (msg.what) {
  332. case 1:
  333. try {
  334. LocalSocket s = RIL.this.mSocket;
  335. if (s == null) {
  336. rr.onError(1, null);
  337. rr.release();
  338. RIL.this.decrementWakeLock();
  339. return;
  340. }
  341. synchronized (RIL.this.mRequestList) {
  342. RIL.this.mRequestList.append(rr.mSerial, rr);
  343. }
  344. byte[] data = rr.mParcel.marshall();
  345. rr.mParcel.recycle();
  346. rr.mParcel = null;
  347. if (data.length > 8192) {
  348. throw new RuntimeException("Parcel larger than max bytes allowed! " + data.length);
  349. }
  350. byte[] bArr = this.dataLength;
  351. this.dataLength[1] = (byte) 0;
  352. bArr[0] = (byte) 0;
  353. this.dataLength[2] = (byte) ((data.length >> 8) & 255);
  354. this.dataLength[3] = (byte) (data.length & 255);
  355. s.getOutputStream().write(this.dataLength);
  356. s.getOutputStream().write(data);
  357. return;
  358. } catch (IOException ex) {
  359. Rlog.e(RIL.RILJ_LOG_TAG, "IOException", ex);
  360. if (RIL.this.findAndRemoveRequestFromList(rr.mSerial) != null) {
  361. rr.onError(1, null);
  362. rr.release();
  363. RIL.this.decrementWakeLock();
  364. return;
  365. }
  366. return;
  367. } catch (RuntimeException exc) {
  368. Rlog.e(RIL.RILJ_LOG_TAG, "Uncaught exception ", exc);
  369. if (RIL.this.findAndRemoveRequestFromList(rr.mSerial) != null) {
  370. rr.onError(2, null);
  371. rr.release();
  372. RIL.this.decrementWakeLock();
  373. return;
  374. }
  375. return;
  376. }
  377. case 2:
  378. synchronized (RIL.this.mRequestList) {
  379. if (RIL.this.clearWakeLock()) {
  380. int count = RIL.this.mRequestList.size();
  381. Rlog.d(RIL.RILJ_LOG_TAG, "WAKE_LOCK_TIMEOUT mRequestList=" + count);
  382. for (int i = 0; i < count; i++) {
  383. rr = (RILRequest) RIL.this.mRequestList.valueAt(i);
  384. Rlog.d(RIL.RILJ_LOG_TAG, i + ": [" + rr.mSerial + "] " + RIL.requestToString(rr.mRequest));
  385. }
  386. }
  387. }
  388. return;
  389. default:
  390. return;
  391. }
  392. }
  393. }
  394.  
  395. public final class UnsolOemHookBuffer {
  396. private byte[] mData;
  397. private int mRilInstance;
  398.  
  399. public UnsolOemHookBuffer(int rilInstance, byte[] data) {
  400. this.mRilInstance = rilInstance;
  401. this.mData = data;
  402. }
  403.  
  404. public int getRilInstance() {
  405. return this.mRilInstance;
  406. }
  407.  
  408. public byte[] getUnsolOemHookBuffer() {
  409. return this.mData;
  410. }
  411. }
  412.  
  413. private static int readRilMessage(InputStream is, byte[] buffer) throws IOException {
  414. int offset = 0;
  415. int remaining = 4;
  416. do {
  417. int countRead = is.read(buffer, offset, remaining);
  418. if (countRead < 0) {
  419. Rlog.e(RILJ_LOG_TAG, "Hit EOS reading message length");
  420. return -1;
  421. }
  422. offset += countRead;
  423. remaining -= countRead;
  424. } while (remaining > 0);
  425. int messageLength = ((((buffer[0] & 255) << 24) | ((buffer[1] & 255) << 16)) | ((buffer[2] & 255) << 8)) | (buffer[3] & 255);
  426. offset = 0;
  427. remaining = messageLength;
  428. do {
  429. countRead = is.read(buffer, offset, remaining);
  430. if (countRead < 0) {
  431. Rlog.e(RILJ_LOG_TAG, "Hit EOS reading message. messageLength=" + messageLength + " remaining=" + remaining);
  432. return -1;
  433. }
  434. offset += countRead;
  435. remaining -= countRead;
  436. } while (remaining > 0);
  437. return messageLength;
  438. }
  439.  
  440. public RIL(Context context, int preferredNetworkType, int cdmaSubscription) {
  441. this(context, preferredNetworkType, cdmaSubscription, null);
  442. }
  443.  
  444. public RIL(Context context, int preferredNetworkType, int cdmaSubscription, Integer instanceId) {
  445. super(context);
  446. this.mDefaultDisplayState = 0;
  447. this.mRadioScreenState = -1;
  448. this.mIsDevicePlugged = false;
  449. this.mRequestList = new SparseArray();
  450. this.initPhoneType = 0;
  451. this.mTestingEmergencyCall = new AtomicBoolean(false);
  452. this.mIntentReceiver = new C00281();
  453. this.mDisplayListener = new C00292();
  454. this.mBatteryStateListener = new C00303();
  455. riljLog("RIL(context, preferredNetworkType=" + preferredNetworkType + " cdmaSubscription=" + cdmaSubscription + " instanceId=" + instanceId + ")");
  456. this.mContext = context;
  457. this.mCdmaSubscription = cdmaSubscription;
  458. this.mPreferredNetworkType = preferredNetworkType;
  459. this.mDtmfProgress = 0;
  460. this.mPhoneType = 0;
  461. this.mInstanceId = instanceId;
  462. this.mWakeLock = ((PowerManager) context.getSystemService("power")).newWakeLock(1, RILJ_LOG_TAG + (this.mInstanceId == null ? "" : this.mInstanceId));
  463. this.mWakeLock.setReferenceCounted(false);
  464. this.mWakeLockTimeout = SystemProperties.getInt("ro.ril.wake_lock_timeout", 60000);
  465. this.mWakeLockCount = 0;
  466. this.mSenderThread = new HandlerThread("RILSender" + this.mInstanceId);
  467. this.mSenderThread.start();
  468. this.mSender = new RILSender(this.mSenderThread.getLooper());
  469. if (((ConnectivityManager) context.getSystemService("connectivity")).isNetworkSupported(0)) {
  470. riljLog("Starting RILReceiver" + this.mInstanceId);
  471. this.mReceiver = new RILReceiver();
  472. this.mReceiverThread = new Thread(this.mReceiver, "RILReceiver" + this.mInstanceId);
  473. this.mReceiverThread.start();
  474. IntentFilter sbmExtendFilter = new IntentFilter();
  475. sbmExtendFilter.addAction(ETWS_TEST);
  476. sbmExtendFilter.addAction(WAPPUSH_TEST);
  477. context.registerReceiver(this.mIntentReceiver, sbmExtendFilter);
  478. DisplayManager dm = (DisplayManager) context.getSystemService("display");
  479. this.mDefaultDisplay = dm.getDisplay(0);
  480. dm.registerDisplayListener(this.mDisplayListener, null);
  481. this.mDefaultDisplayState = this.mDefaultDisplay.getState();
  482. Intent batteryStatus = context.registerReceiver(this.mBatteryStateListener, new IntentFilter("android.intent.action.BATTERY_CHANGED"));
  483. if (batteryStatus != null) {
  484. this.mIsDevicePlugged = batteryStatus.getIntExtra("plugged", 0) != 0;
  485. }
  486. } else {
  487. riljLog("Not starting RILReceiver: wifi-only");
  488. }
  489. TelephonyDevController tdc = TelephonyDevController.getInstance();
  490. TelephonyDevController.registerRIL(this);
  491. if (FloatingFeature.getInstance().getEnableStatus("SEC_FLOATING_FEATURE_COMMON_SUPPORT_SAFETYCARE")) {
  492. IntentFilter safetycareFilter = new IntentFilter();
  493. safetycareFilter.addAction("com.samsung.intent.action.EMERGENCY_STATE_CHANGED");
  494. context.registerReceiver(this.mIntentReceiver, safetycareFilter);
  495. }
  496. }
  497.  
  498. public void getVoiceRadioTechnology(Message result) {
  499. RILRequest rr = RILRequest.obtain(108, result);
  500. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  501. send(rr);
  502. }
  503.  
  504. public void getImsRegistrationState(Message result) {
  505. RILRequest rr = RILRequest.obtain(112, result);
  506. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  507. send(rr);
  508. }
  509.  
  510. public void setOnNITZTime(Handler h, int what, Object obj) {
  511. super.setOnNITZTime(h, what, obj);
  512. if (this.mLastNITZTimeInfo != null) {
  513. this.mNITZTimeRegistrant.notifyRegistrant(new AsyncResult(null, this.mLastNITZTimeInfo, null));
  514. }
  515. }
  516.  
  517. public void getIccCardStatus(Message result) {
  518. RILRequest rr = RILRequest.obtain(1, result);
  519. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  520. send(rr);
  521. }
  522.  
  523. public void setUiccSubscription(int slotId, int appIndex, int subId, int subStatus, Message result) {
  524. RILRequest rr = RILRequest.obtain(122, result);
  525. Rlog.i(RILJ_LOG_TAG, "!@Boot_SVC : setUiccSubscription");
  526. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " slot: " + slotId + " appIndex: " + appIndex + " subId: " + subId + " subStatus: " + subStatus);
  527. rr.mParcel.writeInt(slotId);
  528. rr.mParcel.writeInt(appIndex);
  529. rr.mParcel.writeInt(subId);
  530. rr.mParcel.writeInt(subStatus);
  531. send(rr);
  532. }
  533.  
  534. public void setDataAllowed(boolean allowed, Message result) {
  535. int i = 1;
  536. RILRequest rr = RILRequest.obtain(123, result);
  537. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " allowed: " + allowed);
  538. rr.mParcel.writeInt(1);
  539. Parcel parcel = rr.mParcel;
  540. if (!allowed) {
  541. i = 0;
  542. }
  543. parcel.writeInt(i);
  544. send(rr);
  545. }
  546.  
  547. public void supplyIccPin(String pin, Message result) {
  548. supplyIccPinForApp(pin, null, result);
  549. }
  550.  
  551. public void supplyIccPinForApp(String pin, String aid, Message result) {
  552. RILRequest rr = RILRequest.obtain(2, result);
  553. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  554. rr.mParcel.writeInt(2);
  555. rr.mParcel.writeString(pin);
  556. rr.mParcel.writeString(aid);
  557. send(rr);
  558. }
  559.  
  560. public void supplyIccPuk(String puk, String newPin, Message result) {
  561. supplyIccPukForApp(puk, newPin, null, result);
  562. }
  563.  
  564. public void supplyIccPukForApp(String puk, String newPin, String aid, Message result) {
  565. RILRequest rr = RILRequest.obtain(3, result);
  566. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  567. rr.mParcel.writeInt(3);
  568. rr.mParcel.writeString(puk);
  569. rr.mParcel.writeString(newPin);
  570. rr.mParcel.writeString(aid);
  571. send(rr);
  572. }
  573.  
  574. public void supplyIccPin2(String pin, Message result) {
  575. supplyIccPin2ForApp(pin, null, result);
  576. }
  577.  
  578. public void supplyIccPin2ForApp(String pin, String aid, Message result) {
  579. RILRequest rr = RILRequest.obtain(4, result);
  580. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  581. rr.mParcel.writeInt(2);
  582. rr.mParcel.writeString(pin);
  583. rr.mParcel.writeString(aid);
  584. send(rr);
  585. }
  586.  
  587. public void supplyIccPuk2(String puk2, String newPin2, Message result) {
  588. supplyIccPuk2ForApp(puk2, newPin2, null, result);
  589. }
  590.  
  591. public void supplyIccPuk2ForApp(String puk, String newPin2, String aid, Message result) {
  592. RILRequest rr = RILRequest.obtain(5, result);
  593. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  594. rr.mParcel.writeInt(3);
  595. rr.mParcel.writeString(puk);
  596. rr.mParcel.writeString(newPin2);
  597. rr.mParcel.writeString(aid);
  598. send(rr);
  599. }
  600.  
  601. public void changeIccPin(String oldPin, String newPin, Message result) {
  602. changeIccPinForApp(oldPin, newPin, null, result);
  603. }
  604.  
  605. public void changeIccPinForApp(String oldPin, String newPin, String aid, Message result) {
  606. RILRequest rr = RILRequest.obtain(6, result);
  607. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  608. rr.mParcel.writeInt(3);
  609. rr.mParcel.writeString(oldPin);
  610. rr.mParcel.writeString(newPin);
  611. rr.mParcel.writeString(aid);
  612. send(rr);
  613. }
  614.  
  615. public void changeIccPin2(String oldPin2, String newPin2, Message result) {
  616. changeIccPin2ForApp(oldPin2, newPin2, null, result);
  617. }
  618.  
  619. public void changeIccPin2ForApp(String oldPin2, String newPin2, String aid, Message result) {
  620. RILRequest rr = RILRequest.obtain(7, result);
  621. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  622. rr.mParcel.writeInt(3);
  623. rr.mParcel.writeString(oldPin2);
  624. rr.mParcel.writeString(newPin2);
  625. rr.mParcel.writeString(aid);
  626. send(rr);
  627. }
  628.  
  629. public void changeBarringPassword(String facility, String oldPwd, String newPwd, Message result) {
  630. RILRequest rr = RILRequest.obtain(44, result);
  631. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  632. rr.mParcel.writeInt(3);
  633. rr.mParcel.writeString(facility);
  634. rr.mParcel.writeString(oldPwd);
  635. rr.mParcel.writeString(newPwd);
  636. send(rr);
  637. }
  638.  
  639. public void supplyNetworkDepersonalization(String netpin, Message result) {
  640. RILRequest rr = RILRequest.obtain(8, result);
  641. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  642. rr.mParcel.writeInt(1);
  643. rr.mParcel.writeString(netpin);
  644. send(rr);
  645. }
  646.  
  647. public void supplyNetworkDepersonalization(String netpin, int lockState, Message result) {
  648. RILRequest rr = RILRequest.obtain(8, result);
  649. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " Type:" + "PERSOSUBSTATE_SIM_NETWORK");
  650. rr.mParcel.writeInt(lockState);
  651. rr.mParcel.writeString(netpin);
  652. send(rr);
  653. }
  654.  
  655. public void getCurrentCalls(Message result) {
  656. RILRequest rr = RILRequest.obtain(9, result);
  657. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  658. send(rr);
  659. }
  660.  
  661. @Deprecated
  662. public void getPDPContextList(Message result) {
  663. getDataCallList(result);
  664. }
  665.  
  666. public void getDataCallList(Message result) {
  667. RILRequest rr = RILRequest.obtain(57, result);
  668. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  669. send(rr);
  670. }
  671.  
  672. public void dial(String address, int clirMode, Message result) {
  673. dial(address, clirMode, null, result);
  674. }
  675.  
  676. public void dial(String address, int clirMode, UUSInfo uusInfo, Message result) {
  677. dial(address, clirMode, uusInfo, null, result);
  678. }
  679.  
  680. public void dial(String address, int clirMode, UUSInfo uusInfo, CallDetails callDetails, Message result) {
  681. RILRequest rr = RILRequest.obtain(10, result);
  682. rr.mParcel.writeString(address);
  683. rr.mParcel.writeInt(clirMode);
  684. if (callDetails != null) {
  685. rr.mParcel.writeInt(callDetails.call_type);
  686. rr.mParcel.writeInt(callDetails.call_domain);
  687. rr.mParcel.writeString(callDetails.getCsvFromExtras());
  688. } else {
  689. rr.mParcel.writeInt(0);
  690. rr.mParcel.writeInt(1);
  691. rr.mParcel.writeString("");
  692. }
  693. if (uusInfo == null) {
  694. rr.mParcel.writeInt(0);
  695. } else {
  696. rr.mParcel.writeInt(1);
  697. rr.mParcel.writeInt(uusInfo.getType());
  698. rr.mParcel.writeInt(uusInfo.getDcs());
  699. rr.mParcel.writeByteArray(uusInfo.getUserData());
  700. }
  701. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " " + callDetails);
  702. send(rr);
  703. }
  704.  
  705. public void dialEmergencyCall(String address, int clirMode, Message result) {
  706. dialEmergencyCall(address, clirMode, null, result);
  707. }
  708.  
  709. public void dialEmergencyCall(String address, int clirMode, CallDetails callDetails, Message result) {
  710. RILRequest rr = RILRequest.obtain(10001, result);
  711. rr.mParcel.writeString(address);
  712. rr.mParcel.writeInt(clirMode);
  713. if (callDetails != null) {
  714. rr.mParcel.writeInt(callDetails.call_type);
  715. rr.mParcel.writeInt(callDetails.call_domain);
  716. rr.mParcel.writeString("");
  717. } else {
  718. rr.mParcel.writeInt(0);
  719. rr.mParcel.writeInt(3);
  720. rr.mParcel.writeString("");
  721. }
  722. rr.mParcel.writeInt(0);
  723. if (callDetails != null) {
  724. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " " + callDetails);
  725. } else {
  726. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  727. }
  728. send(rr);
  729. }
  730.  
  731. public void deflect(String address, Message result) {
  732. RILRequest rr = RILRequest.obtain(10002, result);
  733. rr.mParcel.writeString(address);
  734. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  735. send(rr);
  736. }
  737.  
  738. public void getPreferredNetworkList(Message response) {
  739. RILRequest rr = RILRequest.obtain(10016, response);
  740. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  741. send(rr);
  742. }
  743.  
  744. public void setPreferredNetworkList(int index, String operator, String plmn, int gsmAct, int gsmCompactAct, int utranAct, int mode, Message response) {
  745. RILRequest rr = RILRequest.obtain(10015, response);
  746. rr.mParcel.writeInt(index);
  747. rr.mParcel.writeString(operator);
  748. rr.mParcel.writeString(plmn);
  749. rr.mParcel.writeInt(gsmAct);
  750. rr.mParcel.writeInt(gsmCompactAct);
  751. rr.mParcel.writeInt(utranAct);
  752. rr.mParcel.writeInt(mode);
  753. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + ", " + index + ", " + operator + ", " + plmn + ", " + gsmAct + "," + gsmCompactAct + ", " + utranAct + ", " + mode);
  754. send(rr);
  755. }
  756.  
  757. public void modifyCallInitiate(CallModify callModify, Message result) {
  758. RILRequest rr = RILRequest.obtain(10003, result);
  759. rr.mParcel.writeInt(callModify.call_index);
  760. rr.mParcel.writeInt(callModify.call_details.call_type);
  761. rr.mParcel.writeInt(callModify.call_details.call_domain);
  762. rr.mParcel.writeString(callModify.call_details.getCsvFromExtras());
  763. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " " + callModify);
  764. send(rr);
  765. }
  766.  
  767. public void modifyCallConfirm(CallModify callModify, Message result) {
  768. RILRequest rr = RILRequest.obtain(10004, result);
  769. rr.mParcel.writeInt(callModify.call_index);
  770. rr.mParcel.writeInt(callModify.call_details.call_type);
  771. rr.mParcel.writeInt(callModify.call_details.call_domain);
  772. rr.mParcel.writeString(callModify.call_details.getCsvFromExtras());
  773. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " " + callModify);
  774. send(rr);
  775. }
  776.  
  777. public void setVoiceDomainPref(int pref, Message result) {
  778. RILRequest rr = RILRequest.obtain(10005, result);
  779. rr.mParcel.writeInt(1);
  780. rr.mParcel.writeInt(pref);
  781. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " " + pref);
  782. send(rr);
  783. }
  784.  
  785. private void sendSafemode(boolean on) {
  786. int i = 1;
  787. RILRequest rr = RILRequest.obtain(10006, null);
  788. rr.mParcel.writeInt(1);
  789. Parcel parcel = rr.mParcel;
  790. if (!on) {
  791. i = 0;
  792. }
  793. parcel.writeInt(i);
  794. rr.mParcel.writeInt(0);
  795. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " " + on);
  796. send(rr);
  797. }
  798.  
  799. public void setTransmitPower(int powerLevel, Message result) {
  800. RILRequest rr = RILRequest.obtain(10007, result);
  801. rr.mParcel.writeInt(1);
  802. rr.mParcel.writeInt(powerLevel);
  803. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " " + powerLevel);
  804. send(rr);
  805. }
  806.  
  807. public void getCbConfig(Message response) {
  808. RILRequest rr = RILRequest.obtain(10008, response);
  809. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  810. send(rr);
  811. }
  812.  
  813. public void setSimPower(int on, Message result) {
  814. RILRequest rr = RILRequest.obtain(10023, result);
  815. rr.mParcel.writeInt(1);
  816. rr.mParcel.writeInt(on);
  817. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " int : " + on);
  818. send(rr);
  819. }
  820.  
  821. public void getIMSI(Message result) {
  822. getIMSIForApp(null, result);
  823. }
  824.  
  825. public void getIMSIForApp(String aid, Message result) {
  826. RILRequest rr = RILRequest.obtain(11, result);
  827. rr.mParcel.writeInt(1);
  828. rr.mParcel.writeString(aid);
  829. String dbgMsg = rr.serialString() + "> getIMSI: " + requestToString(rr.mRequest) + " aid: ";
  830. if (SHIP_BUILD) {
  831. dbgMsg = dbgMsg + "xxx";
  832. } else {
  833. dbgMsg = dbgMsg + aid;
  834. }
  835. riljLog(dbgMsg);
  836. send(rr);
  837. }
  838.  
  839. public void getIMEI(Message result) {
  840. RILRequest rr = RILRequest.obtain(38, result);
  841. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  842. send(rr);
  843. }
  844.  
  845. public void getIMEISV(Message result) {
  846. RILRequest rr = RILRequest.obtain(39, result);
  847. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  848. send(rr);
  849. }
  850.  
  851. public void hangupConnection(int gsmIndex, Message result) {
  852. riljLog("hangupConnection: gsmIndex=" + gsmIndex);
  853. RILRequest rr = RILRequest.obtain(12, result);
  854. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " " + gsmIndex);
  855. rr.mParcel.writeInt(1);
  856. rr.mParcel.writeInt(gsmIndex);
  857. send(rr);
  858. }
  859.  
  860. public void hangupWaitingOrBackground(Message result) {
  861. RILRequest rr = RILRequest.obtain(13, result);
  862. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  863. send(rr);
  864. }
  865.  
  866. public void hangupForegroundResumeBackground(Message result) {
  867. RILRequest rr = RILRequest.obtain(14, result);
  868. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  869. send(rr);
  870. }
  871.  
  872. public void switchWaitingOrHoldingAndActive(Message result) {
  873. RILRequest rr = RILRequest.obtain(15, result);
  874. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  875. send(rr);
  876. }
  877.  
  878. public void conference(Message result) {
  879. RILRequest rr = RILRequest.obtain(16, result);
  880. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  881. send(rr);
  882. }
  883.  
  884. public void setPreferredVoicePrivacy(boolean enable, Message result) {
  885. int i = 1;
  886. RILRequest rr = RILRequest.obtain(82, result);
  887. rr.mParcel.writeInt(1);
  888. Parcel parcel = rr.mParcel;
  889. if (!enable) {
  890. i = 0;
  891. }
  892. parcel.writeInt(i);
  893. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " " + enable);
  894. send(rr);
  895. }
  896.  
  897. public void getPreferredVoicePrivacy(Message result) {
  898. RILRequest rr = RILRequest.obtain(83, result);
  899. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  900. send(rr);
  901. }
  902.  
  903. public void separateConnection(int gsmIndex, Message result) {
  904. RILRequest rr = RILRequest.obtain(52, result);
  905. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " " + gsmIndex);
  906. rr.mParcel.writeInt(1);
  907. rr.mParcel.writeInt(gsmIndex);
  908. send(rr);
  909. }
  910.  
  911. public void acceptCall(Message result) {
  912. acceptCall(0, result);
  913. }
  914.  
  915. public void acceptCall(int type, Message result) {
  916. RILRequest rr = RILRequest.obtain(40, result);
  917. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " " + type);
  918. rr.mParcel.writeInt(1);
  919. rr.mParcel.writeInt(type);
  920. send(rr);
  921. }
  922.  
  923. public void rejectCall(Message result) {
  924. RILRequest rr = RILRequest.obtain(17, result);
  925. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  926. send(rr);
  927. }
  928.  
  929. public void explicitCallTransfer(Message result) {
  930. RILRequest rr = RILRequest.obtain(72, result);
  931. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  932. send(rr);
  933. }
  934.  
  935. public void explicitCallTransfer(String number, Message result) {
  936. RILRequest rr = RILRequest.obtain(72, result);
  937. rr.mParcel.writeString(number);
  938. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " BLIND");
  939. send(rr);
  940. }
  941.  
  942. public void getLastCallFailCause(Message result) {
  943. RILRequest rr = RILRequest.obtain(18, result);
  944. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  945. send(rr);
  946. }
  947.  
  948. @Deprecated
  949. public void getLastPdpFailCause(Message result) {
  950. getLastDataCallFailCause(result);
  951. }
  952.  
  953. public void getLastDataCallFailCause(Message result) {
  954. RILRequest rr = RILRequest.obtain(56, result);
  955. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  956. send(rr);
  957. }
  958.  
  959. public void setMute(boolean enableMute, Message response) {
  960. int i = 1;
  961. RILRequest rr = RILRequest.obtain(53, response);
  962. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " " + enableMute);
  963. rr.mParcel.writeInt(1);
  964. Parcel parcel = rr.mParcel;
  965. if (!enableMute) {
  966. i = 0;
  967. }
  968. parcel.writeInt(i);
  969. send(rr);
  970. }
  971.  
  972. public void getMute(Message response) {
  973. RILRequest rr = RILRequest.obtain(54, response);
  974. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  975. send(rr);
  976. }
  977.  
  978. public void getSignalStrength(Message result) {
  979. RILRequest rr = RILRequest.obtain(19, result);
  980. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  981. send(rr);
  982. }
  983.  
  984. public void getVoiceRegistrationState(Message result) {
  985. RILRequest rr = RILRequest.obtain(20, result);
  986. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  987. send(rr);
  988. }
  989.  
  990. public void getDataRegistrationState(Message result) {
  991. RILRequest rr = RILRequest.obtain(21, result);
  992. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  993. send(rr);
  994. }
  995.  
  996. public void getOperator(Message result) {
  997. RILRequest rr = RILRequest.obtain(22, result);
  998. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  999. send(rr);
  1000. }
  1001.  
  1002. public void getHardwareConfig(Message result) {
  1003. RILRequest rr = RILRequest.obtain(124, result);
  1004. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  1005. send(rr);
  1006. }
  1007.  
  1008. public void sendDtmf(char c, Message result) {
  1009. RILRequest rr = RILRequest.obtain(24, result);
  1010. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  1011. rr.mParcel.writeString(Character.toString(c));
  1012. send(rr);
  1013. }
  1014.  
  1015. public void startDtmf(char c, Message result) {
  1016. if (this.mDtmfProgress >= PduPart.P_CONTENT_TRANSFER_ENCODING) {
  1017. riljLog("DTMF request warning.Fixed Count=" + this.mDtmfProgress);
  1018. this.mContext.sendBroadcast(new Intent("com.samsung.intent.action.ACTION_DTMF_BUSY"));
  1019. return;
  1020. }
  1021. RILRequest rr = RILRequest.obtain(49, result);
  1022. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  1023. rr.mParcel.writeString(Character.toString(c));
  1024. send(rr);
  1025. this.mDtmfProgress++;
  1026. }
  1027.  
  1028. public void stopDtmf(Message result) {
  1029. RILRequest rr = RILRequest.obtain(50, result);
  1030. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  1031. send(rr);
  1032. this.mDtmfProgress++;
  1033. }
  1034.  
  1035. public void sendBurstDtmf(String dtmfString, int on, int off, Message result) {
  1036. RILRequest rr = RILRequest.obtain(85, result);
  1037. rr.mParcel.writeInt(3);
  1038. rr.mParcel.writeString(dtmfString);
  1039. rr.mParcel.writeString(Integer.toString(on));
  1040. rr.mParcel.writeString(Integer.toString(off));
  1041. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " : " + dtmfString);
  1042. send(rr);
  1043. }
  1044.  
  1045. private void constructGsmSendSmsRilRequest(RILRequest rr, String smscPDU, String pdu) {
  1046. rr.mParcel.writeInt(2);
  1047. rr.mParcel.writeString(smscPDU);
  1048. rr.mParcel.writeString(pdu);
  1049. }
  1050.  
  1051. public void sendSMS(String smscPDU, String pdu, Message result) {
  1052. RILRequest rr = RILRequest.obtain(25, result);
  1053. constructGsmSendSmsRilRequest(rr, smscPDU, pdu);
  1054. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  1055. send(rr);
  1056. }
  1057.  
  1058. public void sendSMSExpectMore(String smscPDU, String pdu, Message result) {
  1059. RILRequest rr = RILRequest.obtain(26, result);
  1060. constructGsmSendSmsRilRequest(rr, smscPDU, pdu);
  1061. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  1062. send(rr);
  1063. }
  1064.  
  1065. private void constructCdmaSendSmsRilRequest(RILRequest rr, byte[] pdu) {
  1066. DataInputStream dis = new DataInputStream(new ByteArrayInputStream(pdu));
  1067. try {
  1068. int i;
  1069. rr.mParcel.writeInt(dis.readInt());
  1070. rr.mParcel.writeByte((byte) dis.readInt());
  1071. rr.mParcel.writeInt(dis.readInt());
  1072. rr.mParcel.writeInt(dis.read());
  1073. rr.mParcel.writeInt(dis.read());
  1074. rr.mParcel.writeInt(dis.read());
  1075. rr.mParcel.writeInt(dis.read());
  1076. int address_nbr_of_digits = (byte) dis.read();
  1077. rr.mParcel.writeByte((byte) address_nbr_of_digits);
  1078. for (i = 0; i < address_nbr_of_digits; i++) {
  1079. rr.mParcel.writeByte(dis.readByte());
  1080. }
  1081. rr.mParcel.writeInt(dis.read());
  1082. rr.mParcel.writeByte((byte) dis.read());
  1083. int subaddr_nbr_of_digits = (byte) dis.read();
  1084. rr.mParcel.writeByte((byte) subaddr_nbr_of_digits);
  1085. for (i = 0; i < subaddr_nbr_of_digits; i++) {
  1086. rr.mParcel.writeByte(dis.readByte());
  1087. }
  1088. int bearerDataLength = dis.read();
  1089. rr.mParcel.writeInt(bearerDataLength);
  1090. for (i = 0; i < bearerDataLength; i++) {
  1091. rr.mParcel.writeByte(dis.readByte());
  1092. }
  1093. } catch (IOException ex) {
  1094. riljLog("sendSmsCdma: conversion from input stream to object failed: " + ex);
  1095. }
  1096. }
  1097.  
  1098. public void sendCdmaSms(byte[] pdu, Message result) {
  1099. RILRequest rr = RILRequest.obtain(87, result);
  1100. constructCdmaSendSmsRilRequest(rr, pdu);
  1101. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  1102. send(rr);
  1103. }
  1104.  
  1105. public void sendImsGsmSms(String smscPDU, String pdu, int retry, int messageRef, Message result) {
  1106. RILRequest rr = RILRequest.obtain(113, result);
  1107. rr.mParcel.writeInt(1);
  1108. rr.mParcel.writeByte((byte) retry);
  1109. rr.mParcel.writeInt(messageRef);
  1110. constructGsmSendSmsRilRequest(rr, smscPDU, pdu);
  1111. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  1112. send(rr);
  1113. }
  1114.  
  1115. public void sendImsCdmaSms(byte[] pdu, int retry, int messageRef, Message result) {
  1116. RILRequest rr = RILRequest.obtain(113, result);
  1117. rr.mParcel.writeInt(2);
  1118. rr.mParcel.writeByte((byte) retry);
  1119. rr.mParcel.writeInt(messageRef);
  1120. constructCdmaSendSmsRilRequest(rr, pdu);
  1121. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  1122. send(rr);
  1123. }
  1124.  
  1125. public void deleteSmsOnSim(int index, Message response) {
  1126. RILRequest rr = RILRequest.obtain(64, response);
  1127. rr.mParcel.writeInt(1);
  1128. rr.mParcel.writeInt(index);
  1129. send(rr);
  1130. }
  1131.  
  1132. public void deleteSmsOnRuim(int index, Message response) {
  1133. RILRequest rr = RILRequest.obtain(OEM_NET_GET_MODEM_CAP, response);
  1134. rr.mParcel.writeInt(1);
  1135. rr.mParcel.writeInt(index);
  1136. send(rr);
  1137. }
  1138.  
  1139. public void writeSmsToSim(int status, String smsc, String pdu, Message response) {
  1140. status = translateStatus(status);
  1141. RILRequest rr = RILRequest.obtain(63, response);
  1142. rr.mParcel.writeInt(status);
  1143. rr.mParcel.writeString(pdu);
  1144. rr.mParcel.writeString(smsc);
  1145. send(rr);
  1146. }
  1147.  
  1148. public void writeSmsToRuim(int status, String pdu, Message response) {
  1149. status = translateStatus(status);
  1150. RILRequest rr = RILRequest.obtain(96, response);
  1151. rr.mParcel.writeInt(status);
  1152. if (CscFeature.getInstance().getEnableStatus("CscFeature_RIL_SmsCdmaCopyToRuim")) {
  1153. constructCdmaSendSmsRilRequest(rr, IccUtils.hexStringToBytes(pdu));
  1154. } else {
  1155. rr.mParcel.writeString(pdu);
  1156. }
  1157. send(rr);
  1158. }
  1159.  
  1160. private int translateStatus(int status) {
  1161. switch (status & 7) {
  1162. case 3:
  1163. return 0;
  1164. case 5:
  1165. return 3;
  1166. case 7:
  1167. return 2;
  1168. default:
  1169. return 1;
  1170. }
  1171. }
  1172.  
  1173. public void setupDataCall(String radioTechnology, String profile, String apn, String user, String password, String authType, String protocol, Message result) {
  1174. RILRequest rr = RILRequest.obtain(27, result);
  1175. rr.mParcel.writeInt(7);
  1176. rr.mParcel.writeString(radioTechnology);
  1177. rr.mParcel.writeString(profile);
  1178. rr.mParcel.writeString(apn);
  1179. rr.mParcel.writeString(user);
  1180. rr.mParcel.writeString(password);
  1181. rr.mParcel.writeString(authType);
  1182. rr.mParcel.writeString(protocol);
  1183. Rlog.i(RILJ_LOG_TAG, "!@Boot_SVC : setupDataCall");
  1184. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " " + radioTechnology + " " + profile + " " + apn + " " + user + " " + password + " " + authType + " " + protocol);
  1185. send(rr);
  1186. }
  1187.  
  1188. public void deactivateDataCall(int cid, int reason, Message result) {
  1189. RILRequest rr = RILRequest.obtain(41, result);
  1190. rr.mParcel.writeInt(2);
  1191. rr.mParcel.writeString(Integer.toString(cid));
  1192. rr.mParcel.writeString(Integer.toString(reason));
  1193. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " " + cid + " " + reason);
  1194. send(rr);
  1195. }
  1196.  
  1197. public void setRadioPower(boolean on, Message result) {
  1198. int i = 1;
  1199. RILRequest rr = RILRequest.obtain(23, result);
  1200. rr.mParcel.writeInt(1);
  1201. Parcel parcel = rr.mParcel;
  1202. if (!on) {
  1203. i = 0;
  1204. }
  1205. parcel.writeInt(i);
  1206. if (on) {
  1207. Rlog.i(RILJ_LOG_TAG, "!@Boot_SVC : setRadioPower on");
  1208. }
  1209. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + (on ? " on" : " off"));
  1210. send(rr);
  1211. }
  1212.  
  1213. public void requestShutdown(Message result) {
  1214. RILRequest rr = RILRequest.obtain(129, result);
  1215. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  1216. send(rr);
  1217. }
  1218.  
  1219. public void setSuppServiceNotifications(boolean enable, Message result) {
  1220. int i = 1;
  1221. RILRequest rr = RILRequest.obtain(62, result);
  1222. rr.mParcel.writeInt(1);
  1223. Parcel parcel = rr.mParcel;
  1224. if (!enable) {
  1225. i = 0;
  1226. }
  1227. parcel.writeInt(i);
  1228. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  1229. send(rr);
  1230. }
  1231.  
  1232. public void acknowledgeLastIncomingGsmSms(boolean success, int cause, Message result) {
  1233. RILRequest rr = RILRequest.obtain(37, result);
  1234. rr.mParcel.writeInt(2);
  1235. rr.mParcel.writeInt(success ? 1 : 0);
  1236. rr.mParcel.writeInt(cause);
  1237. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " " + success + " " + cause);
  1238. send(rr);
  1239. }
  1240.  
  1241. public void acknowledgeLastIncomingCdmaSms(boolean success, int cause, Message result) {
  1242. RILRequest rr = RILRequest.obtain(88, result);
  1243. rr.mParcel.writeInt(success ? 0 : 1);
  1244. rr.mParcel.writeInt(cause);
  1245. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " " + success + " " + cause);
  1246. send(rr);
  1247. }
  1248.  
  1249. public void acknowledgeIncomingGsmSmsWithPdu(boolean success, String ackPdu, Message result) {
  1250. RILRequest rr = RILRequest.obtain(106, result);
  1251. rr.mParcel.writeInt(2);
  1252. rr.mParcel.writeString(success ? "1" : "0");
  1253. rr.mParcel.writeString(ackPdu);
  1254. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + ' ' + success + " [" + ackPdu + ']');
  1255. send(rr);
  1256. }
  1257.  
  1258. public void iccIO(int command, int fileid, String path, int p1, int p2, int p3, String data, String pin2, Message result) {
  1259. iccIOForApp(command, fileid, path, p1, p2, p3, data, pin2, null, result);
  1260. }
  1261.  
  1262. public void iccIOForApp(int command, int fileid, String path, int p1, int p2, int p3, String data, String pin2, String aid, Message result) {
  1263. RILRequest rr = RILRequest.obtain(28, result);
  1264. rr.mParcel.writeInt(command);
  1265. rr.mParcel.writeInt(fileid);
  1266. rr.mParcel.writeString(path);
  1267. rr.mParcel.writeInt(p1);
  1268. rr.mParcel.writeInt(p2);
  1269. rr.mParcel.writeInt(p3);
  1270. rr.mParcel.writeString(data);
  1271. rr.mParcel.writeString(pin2);
  1272. rr.mParcel.writeString(aid);
  1273. String dbgMsg = rr.serialString() + "> iccIO: " + requestToString(rr.mRequest) + " 0x" + Integer.toHexString(command) + " 0x" + Integer.toHexString(fileid) + " " + " path: " + path + "," + p1 + "," + p2 + "," + p3 + " aid: ";
  1274. if (SHIP_BUILD) {
  1275. dbgMsg = dbgMsg + "xxx";
  1276. } else {
  1277. dbgMsg = dbgMsg + aid;
  1278. }
  1279. riljLog(dbgMsg);
  1280. send(rr);
  1281. }
  1282.  
  1283. public void getCLIR(Message result) {
  1284. RILRequest rr = RILRequest.obtain(31, result);
  1285. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  1286. send(rr);
  1287. }
  1288.  
  1289. public void setCLIR(int clirMode, Message result) {
  1290. RILRequest rr = RILRequest.obtain(32, result);
  1291. rr.mParcel.writeInt(1);
  1292. rr.mParcel.writeInt(clirMode);
  1293. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " " + clirMode);
  1294. send(rr);
  1295. }
  1296.  
  1297. public void queryCallWaiting(int serviceClass, Message response) {
  1298. RILRequest rr = RILRequest.obtain(35, response);
  1299. rr.mParcel.writeInt(1);
  1300. rr.mParcel.writeInt(serviceClass);
  1301. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " " + serviceClass);
  1302. send(rr);
  1303. }
  1304.  
  1305. public void setCallWaiting(boolean enable, int serviceClass, Message response) {
  1306. RILRequest rr = RILRequest.obtain(36, response);
  1307. rr.mParcel.writeInt(2);
  1308. rr.mParcel.writeInt(enable ? 1 : 0);
  1309. rr.mParcel.writeInt(serviceClass);
  1310. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " " + enable + ", " + serviceClass);
  1311. send(rr);
  1312. }
  1313.  
  1314. public void setNetworkSelectionModeAutomatic(Message response) {
  1315. RILRequest rr = RILRequest.obtain(46, response);
  1316. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  1317. send(rr);
  1318. }
  1319.  
  1320. public void setNetworkSelectionModeManual(String operatorNumeric, Message response) {
  1321. RILRequest rr = RILRequest.obtain(47, response);
  1322. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " " + operatorNumeric);
  1323. rr.mParcel.writeString(operatorNumeric);
  1324. send(rr);
  1325. }
  1326.  
  1327. public void getNetworkSelectionMode(Message response) {
  1328. RILRequest rr = RILRequest.obtain(45, response);
  1329. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  1330. send(rr);
  1331. }
  1332.  
  1333. public void getAvailableNetworks(Message response) {
  1334. RILRequest rr = RILRequest.obtain(48, response);
  1335. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  1336. send(rr);
  1337. }
  1338.  
  1339. public void setCallForward(int action, int cfReason, int serviceClass, String number, int timeSeconds, Message response) {
  1340. setCallForward(action, cfReason, serviceClass, number, timeSeconds, null, null, response);
  1341. }
  1342.  
  1343. public void setCallForward(int action, int cfReason, int serviceClass, String number, int timeSeconds, String startTime, String endTime, Message response) {
  1344. RILRequest rr = RILRequest.obtain(34, response);
  1345. rr.mParcel.writeInt(action);
  1346. rr.mParcel.writeInt(cfReason);
  1347. rr.mParcel.writeInt(serviceClass);
  1348. rr.mParcel.writeInt(PhoneNumberUtils.toaFromString(number));
  1349. rr.mParcel.writeString(number);
  1350. rr.mParcel.writeInt(timeSeconds);
  1351. if (startTime == null || !startTime.contains(":")) {
  1352. startTime = null;
  1353. } else {
  1354. if (startTime.split(":").length == 2) {
  1355. startTime = String.format("%02d:%02d", new Object[]{Integer.valueOf(Integer.parseInt(startTime.split(":")[0])), Integer.valueOf(Integer.parseInt(startTime.split(":")[1]))});
  1356. } else {
  1357. startTime = null;
  1358. }
  1359. }
  1360. if (endTime == null || !endTime.contains(":")) {
  1361. endTime = null;
  1362. } else {
  1363. if (endTime.split(":").length == 2) {
  1364. endTime = String.format("%02d:%02d", new Object[]{Integer.valueOf(Integer.parseInt(endTime.split(":")[0])), Integer.valueOf(Integer.parseInt(endTime.split(":")[1]))});
  1365. } else {
  1366. endTime = null;
  1367. }
  1368. }
  1369. rr.mParcel.writeString(startTime);
  1370. rr.mParcel.writeString(endTime);
  1371. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " " + action + " " + cfReason + " " + serviceClass + " " + timeSeconds + " " + startTime + " - " + endTime);
  1372. send(rr);
  1373. }
  1374.  
  1375. public void queryCallForwardStatus(int cfReason, int serviceClass, String number, Message response) {
  1376. RILRequest rr = RILRequest.obtain(33, response);
  1377. rr.mParcel.writeInt(2);
  1378. rr.mParcel.writeInt(cfReason);
  1379. rr.mParcel.writeInt(serviceClass);
  1380. rr.mParcel.writeInt(PhoneNumberUtils.toaFromString(number));
  1381. rr.mParcel.writeString(number);
  1382. rr.mParcel.writeInt(0);
  1383. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " " + cfReason + " " + serviceClass);
  1384. send(rr);
  1385. }
  1386.  
  1387. public void queryCLIP(Message response) {
  1388. RILRequest rr = RILRequest.obtain(55, response);
  1389. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  1390. send(rr);
  1391. }
  1392.  
  1393. public void queryCNAP(Message response) {
  1394. RILRequest rr = RILRequest.obtain(10029, response);
  1395. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  1396. send(rr);
  1397. }
  1398.  
  1399. public void getBasebandVersion(Message response) {
  1400. RILRequest rr = RILRequest.obtain(51, response);
  1401. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  1402. send(rr);
  1403. }
  1404.  
  1405. public void queryFacilityLock(String facility, String password, int serviceClass, Message response) {
  1406. queryFacilityLockForApp(facility, password, serviceClass, null, response);
  1407. }
  1408.  
  1409. public void queryFacilityLockForApp(String facility, String password, int serviceClass, String appId, Message response) {
  1410. RILRequest rr = RILRequest.obtain(42, response);
  1411. String dbgMsg = rr.serialString() + "> " + requestToString(rr.mRequest);
  1412. if (!SHIP_BUILD) {
  1413. dbgMsg = dbgMsg + " [" + facility + " " + password + " " + serviceClass + " " + appId + "]";
  1414. }
  1415. riljLog(dbgMsg);
  1416. rr.mParcel.writeInt(4);
  1417. rr.mParcel.writeString(facility);
  1418. rr.mParcel.writeString(password);
  1419. rr.mParcel.writeString(Integer.toString(serviceClass));
  1420. rr.mParcel.writeString(appId);
  1421. send(rr);
  1422. }
  1423.  
  1424. public void setFacilityLock(String facility, boolean lockState, String password, int serviceClass, Message response) {
  1425. setFacilityLockForApp(facility, lockState, password, serviceClass, null, response);
  1426. }
  1427.  
  1428. public void setFacilityLockForApp(String facility, boolean lockState, String password, int serviceClass, String appId, Message response) {
  1429. RILRequest rr = RILRequest.obtain(43, response);
  1430. String dbgMsg = rr.serialString() + "> " + requestToString(rr.mRequest) + " [" + facility + " " + lockState + " " + serviceClass + " ";
  1431. if (!SHIP_BUILD) {
  1432. dbgMsg = dbgMsg + appId;
  1433. }
  1434. riljLog(dbgMsg + "]");
  1435. rr.mParcel.writeInt(5);
  1436. rr.mParcel.writeString(facility);
  1437. rr.mParcel.writeString(lockState ? "1" : "0");
  1438. rr.mParcel.writeString(password);
  1439. rr.mParcel.writeString(Integer.toString(serviceClass));
  1440. rr.mParcel.writeString(appId);
  1441. send(rr);
  1442. }
  1443.  
  1444. public void sendUSSD(String ussdString, Message response) {
  1445. RILRequest rr = RILRequest.obtain(29, response);
  1446. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " " + "*******");
  1447. rr.mParcel.writeString(ussdString);
  1448. send(rr);
  1449. }
  1450.  
  1451. public void cancelPendingUssd(Message response) {
  1452. RILRequest rr = RILRequest.obtain(30, response);
  1453. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  1454. send(rr);
  1455. }
  1456.  
  1457. public void resetRadio(Message result) {
  1458. RILRequest rr = RILRequest.obtain(58, result);
  1459. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  1460. send(rr);
  1461. }
  1462.  
  1463. /* JADX WARNING: inconsistent code. */
  1464. /* Code decompiled incorrectly, please refer to instructions dump. */
  1465. public void getModemCapability(android.os.Message r6) {
  1466. /*
  1467. r5 = this;
  1468. r0 = new java.io.ByteArrayOutputStream;
  1469. r0.<init>();
  1470. r1 = new java.io.DataOutputStream;
  1471. r1.<init>(r0);
  1472. r3 = "RILJ";
  1473. r4 = "getModemCapability";
  1474. android.telephony.Rlog.d(r3, r4);
  1475. r3 = 2;
  1476. r1.writeByte(r3); Catch:{ IOException -> 0x0029, all -> 0x0030 }
  1477. r3 = 97;
  1478. r1.writeByte(r3); Catch:{ IOException -> 0x0029, all -> 0x0030 }
  1479. r3 = 4;
  1480. r1.writeShort(r3); Catch:{ IOException -> 0x0029, all -> 0x0030 }
  1481. r1.close(); Catch:{ Exception -> 0x0035 }
  1482. L_0x0021:
  1483. r3 = r0.toByteArray();
  1484. r5.invokeOemRilRequestRaw(r3, r6);
  1485. L_0x0028:
  1486. return;
  1487. L_0x0029:
  1488. r2 = move-exception;
  1489. r1.close(); Catch:{ Exception -> 0x002e }
  1490. goto L_0x0028;
  1491. L_0x002e:
  1492. r3 = move-exception;
  1493. goto L_0x0028;
  1494. L_0x0030:
  1495. r3 = move-exception;
  1496. r1.close(); Catch:{ Exception -> 0x0037 }
  1497. L_0x0034:
  1498. throw r3;
  1499. L_0x0035:
  1500. r3 = move-exception;
  1501. goto L_0x0021;
  1502. L_0x0037:
  1503. r4 = move-exception;
  1504. goto L_0x0034;
  1505. */
  1506. throw new UnsupportedOperationException("Method not decompiled: com.android.internal.telephony.RIL.getModemCapability(android.os.Message):void");
  1507. }
  1508.  
  1509. /* JADX WARNING: inconsistent code. */
  1510. /* Code decompiled incorrectly, please refer to instructions dump. */
  1511. public void updateStackBinding(int r6, int r7, android.os.Message r8) {
  1512. /*
  1513. r5 = this;
  1514. r0 = new java.io.ByteArrayOutputStream;
  1515. r0.<init>();
  1516. r1 = new java.io.DataOutputStream;
  1517. r1.<init>(r0);
  1518. r3 = "RILJ";
  1519. r4 = "updateStackBinding";
  1520. android.telephony.Rlog.d(r3, r4);
  1521. r3 = 2;
  1522. r1.writeByte(r3); Catch:{ IOException -> 0x002f, all -> 0x0036 }
  1523. r3 = 98;
  1524. r1.writeByte(r3); Catch:{ IOException -> 0x002f, all -> 0x0036 }
  1525. r3 = 6;
  1526. r1.writeShort(r3); Catch:{ IOException -> 0x002f, all -> 0x0036 }
  1527. r1.writeByte(r6); Catch:{ IOException -> 0x002f, all -> 0x0036 }
  1528. r1.writeByte(r7); Catch:{ IOException -> 0x002f, all -> 0x0036 }
  1529. r1.close(); Catch:{ Exception -> 0x003b }
  1530. L_0x0027:
  1531. r3 = r0.toByteArray();
  1532. r5.invokeOemRilRequestRaw(r3, r8);
  1533. L_0x002e:
  1534. return;
  1535. L_0x002f:
  1536. r2 = move-exception;
  1537. r1.close(); Catch:{ Exception -> 0x0034 }
  1538. goto L_0x002e;
  1539. L_0x0034:
  1540. r3 = move-exception;
  1541. goto L_0x002e;
  1542. L_0x0036:
  1543. r3 = move-exception;
  1544. r1.close(); Catch:{ Exception -> 0x003d }
  1545. L_0x003a:
  1546. throw r3;
  1547. L_0x003b:
  1548. r3 = move-exception;
  1549. goto L_0x0027;
  1550. L_0x003d:
  1551. r4 = move-exception;
  1552. goto L_0x003a;
  1553. */
  1554. throw new UnsupportedOperationException("Method not decompiled: com.android.internal.telephony.RIL.updateStackBinding(int, int, android.os.Message):void");
  1555. }
  1556.  
  1557. public void invokeOemRilRequestRaw(byte[] data, Message response) {
  1558. RILRequest rr = RILRequest.obtain(59, response);
  1559. if ((data[0] == (byte) 81 && data[1] == (byte) 66) || (data[0] == (byte) 81 && data[1] == (byte) 65)) {
  1560. rr.onError(1, null);
  1561. rr.release();
  1562. return;
  1563. }
  1564. String dbgMsg = IccUtils.bytesToHexString(data);
  1565. if (SHIP_BUILD) {
  1566. if ("15".equals(dbgMsg.substring(0, 2))) {
  1567. dbgMsg = "****";
  1568. } else if ("1627".equals(dbgMsg.substring(0, 4)) && "KOREA".equals(SystemProperties.get("ro.csc.country_code"))) {
  1569. dbgMsg = "****";
  1570. }
  1571. }
  1572. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + "[" + dbgMsg + "]");
  1573. rr.mParcel.writeByteArray(data);
  1574. send(rr);
  1575. }
  1576.  
  1577. public void invokeOemRilRequestStrings(String[] strings, Message response) {
  1578. RILRequest rr = RILRequest.obtain(60, response);
  1579. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  1580. rr.mParcel.writeStringArray(strings);
  1581. send(rr);
  1582. }
  1583.  
  1584. public void setBandMode(int bandMode, Message response) {
  1585. RILRequest rr = RILRequest.obtain(65, response);
  1586. rr.mParcel.writeInt(1);
  1587. rr.mParcel.writeInt(bandMode);
  1588. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " " + bandMode);
  1589. send(rr);
  1590. }
  1591.  
  1592. public void queryAvailableBandMode(Message response) {
  1593. RILRequest rr = RILRequest.obtain(66, response);
  1594. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  1595. send(rr);
  1596. }
  1597.  
  1598. public void sendTerminalResponse(String contents, Message response) {
  1599. RILRequest rr = RILRequest.obtain(70, response);
  1600. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  1601. rr.mParcel.writeString(contents);
  1602. send(rr);
  1603. }
  1604.  
  1605. public void sendEnvelope(String contents, Message response) {
  1606. RILRequest rr = RILRequest.obtain(69, response);
  1607. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  1608. rr.mParcel.writeString(contents);
  1609. send(rr);
  1610. }
  1611.  
  1612. public void sendEnvelopeWithStatus(String contents, Message response) {
  1613. RILRequest rr = RILRequest.obtain(107, response);
  1614. if (SHIP_BUILD) {
  1615. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  1616. } else {
  1617. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + '[' + contents + ']');
  1618. }
  1619. rr.mParcel.writeString(contents);
  1620. send(rr);
  1621. }
  1622.  
  1623. public void handleCallSetupRequestFromSim(boolean accept, Message response) {
  1624. int i = 1;
  1625. riljLog("handleCallSetupRequestFromSim");
  1626. RILRequest rr = RILRequest.obtain(71, response);
  1627. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  1628. int[] param = new int[1];
  1629. if (!accept) {
  1630. i = 0;
  1631. }
  1632. param[0] = i;
  1633. rr.mParcel.writeIntArray(param);
  1634. send(rr);
  1635. }
  1636.  
  1637. public void setPreferredNetworkType(int networkType, Message response) {
  1638. RILRequest rr = RILRequest.obtain(73, response);
  1639. rr.mParcel.writeInt(1);
  1640. rr.mParcel.writeInt(networkType);
  1641. setInitialPhoneType(networkType);
  1642. this.mPreferredNetworkType = networkType;
  1643. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " : " + networkType);
  1644. send(rr);
  1645. }
  1646.  
  1647. public void getPreferredNetworkType(Message response) {
  1648. RILRequest rr = RILRequest.obtain(74, response);
  1649. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  1650. send(rr);
  1651. }
  1652.  
  1653. public void getNeighboringCids(Message response) {
  1654. RILRequest rr = RILRequest.obtain(75, response);
  1655. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  1656. send(rr);
  1657. }
  1658.  
  1659. public void setLocationUpdates(boolean enable, Message response) {
  1660. int i = 1;
  1661. RILRequest rr = RILRequest.obtain(76, response);
  1662. rr.mParcel.writeInt(1);
  1663. Parcel parcel = rr.mParcel;
  1664. if (!enable) {
  1665. i = 0;
  1666. }
  1667. parcel.writeInt(i);
  1668. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + ": " + enable);
  1669. send(rr);
  1670. }
  1671.  
  1672. public void getSmscAddress(Message result) {
  1673. RILRequest rr = RILRequest.obtain(100, result);
  1674. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  1675. send(rr);
  1676. }
  1677.  
  1678. public void setSmscAddress(String address, Message result) {
  1679. RILRequest rr = RILRequest.obtain(Threads.ALERT_EXTREME_THREAD, result);
  1680. rr.mParcel.writeString(address);
  1681. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " : " + address);
  1682. send(rr);
  1683. }
  1684.  
  1685. public void reportSmsMemoryStatus(boolean available, Message result) {
  1686. int i = 1;
  1687. RILRequest rr = RILRequest.obtain(Threads.ALERT_SEVERE_THREAD, result);
  1688. rr.mParcel.writeInt(1);
  1689. Parcel parcel = rr.mParcel;
  1690. if (!available) {
  1691. i = 0;
  1692. }
  1693. parcel.writeInt(i);
  1694. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + ": " + available);
  1695. send(rr);
  1696. }
  1697.  
  1698. public void reportStkServiceIsRunning(Message result) {
  1699. RILRequest rr = RILRequest.obtain(Threads.ALERT_AMBER_THREAD, result);
  1700. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  1701. send(rr);
  1702. }
  1703.  
  1704. public void getGsmBroadcastConfig(Message response) {
  1705. RILRequest rr = RILRequest.obtain(89, response);
  1706. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  1707. send(rr);
  1708. }
  1709.  
  1710. public void setGsmBroadcastConfig(SmsBroadcastConfigInfo[] config, Message response) {
  1711. RILRequest rr = RILRequest.obtain(90, response);
  1712. rr.mParcel.writeInt(numOfConfig);
  1713. for (int i = 0; i < numOfConfig; i++) {
  1714. int i2;
  1715. rr.mParcel.writeInt(config[i].getFromServiceId());
  1716. rr.mParcel.writeInt(config[i].getToServiceId());
  1717. rr.mParcel.writeInt(config[i].getFromCodeScheme());
  1718. rr.mParcel.writeInt(config[i].getToCodeScheme());
  1719. Parcel parcel = rr.mParcel;
  1720. if (config[i].isSelected()) {
  1721. i2 = 1;
  1722. } else {
  1723. i2 = 0;
  1724. }
  1725. parcel.writeInt(i2);
  1726. }
  1727. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " with " + numOfConfig + " configs : ");
  1728. for (SmsBroadcastConfigInfo smsBroadcastConfigInfo : config) {
  1729. riljLog(smsBroadcastConfigInfo.toString());
  1730. }
  1731. send(rr);
  1732. }
  1733.  
  1734. public void setGsmBroadcastActivation(boolean activate, Message response) {
  1735. int i = 1;
  1736. RILRequest rr = RILRequest.obtain(91, response);
  1737. rr.mParcel.writeInt(1);
  1738. Parcel parcel = rr.mParcel;
  1739. if (activate) {
  1740. i = 0;
  1741. }
  1742. parcel.writeInt(i);
  1743. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  1744. send(rr);
  1745. }
  1746.  
  1747. private void updateScreenState() {
  1748. boolean z = true;
  1749. int oldState = this.mRadioScreenState;
  1750. this.mRadioScreenState = this.mDefaultDisplayState == 2 ? 1 : 0;
  1751. if (this.mRadioScreenState != oldState) {
  1752. if (this.mRadioScreenState != 1) {
  1753. z = false;
  1754. }
  1755. sendScreenState(z);
  1756. }
  1757. }
  1758.  
  1759. private void sendScreenState(boolean on) {
  1760. int i = 1;
  1761. RILRequest rr = RILRequest.obtain(61, null);
  1762. rr.mParcel.writeInt(1);
  1763. Parcel parcel = rr.mParcel;
  1764. if (!on) {
  1765. i = 0;
  1766. }
  1767. parcel.writeInt(i);
  1768. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + ": " + on);
  1769. send(rr);
  1770. }
  1771.  
  1772. protected void onRadioAvailable() {
  1773. if (this.mDefaultDisplay == null) {
  1774. riljLog("Get default display because DefaultDisplay is null");
  1775. this.mDefaultDisplay = ((DisplayManager) this.mContext.getSystemService("display")).getDisplay(0);
  1776. }
  1777. if (this.mDefaultDisplay != null) {
  1778. this.mDefaultDisplayState = this.mDefaultDisplay.getState();
  1779. } else {
  1780. riljLog("Can't get default display");
  1781. }
  1782. updateScreenState();
  1783. if (FloatingFeature.getInstance().getEnableStatus("SEC_FLOATING_FEATURE_COMMON_SUPPORT_SAFETYCARE")) {
  1784. EmergencyManager em = EmergencyManager.getInstance(this.mContext);
  1785. if (em.isEmergencyMode() && !em.checkModeType(512)) {
  1786. sendSafemode(true);
  1787. } else if (System.getInt(this.mContext.getContentResolver(), "emergency_mode", 0) != 1 || System.getInt(this.mContext.getContentResolver(), "ultra_powersaving_mode", 0) == 1) {
  1788. sendSafemode(false);
  1789. } else {
  1790. riljLog("EMERGENCY_MODE");
  1791. sendSafemode(true);
  1792. }
  1793. }
  1794. }
  1795.  
  1796. private RadioState getRadioStateFromInt(int stateInt) {
  1797. switch (stateInt) {
  1798. case 0:
  1799. return RadioState.RADIO_OFF;
  1800. case 1:
  1801. return RadioState.RADIO_UNAVAILABLE;
  1802. case 10:
  1803. return RadioState.RADIO_ON;
  1804. default:
  1805. throw new RuntimeException("Unrecognized RIL_RadioState: " + stateInt);
  1806. }
  1807. }
  1808.  
  1809. private void switchToRadioState(RadioState newState) {
  1810. RadioState oldState = getRadioState();
  1811. setRadioState(newState);
  1812. String salesCode = SystemProperties.get("ro.csc.sales_code");
  1813. String isBpmFirstTime = SystemProperties.get("persist.sys.bpmsetting.default", "FirstTime");
  1814. if (salesCode != null && "COL".equals(salesCode) && isBpmFirstTime != null && "FirstTime".equals(isBpmFirstTime)) {
  1815. SystemProperties.set("persist.sys.bpmsetting.enable", "1");
  1816. SystemProperties.set("persist.sys.bpmsetting.default", "1");
  1817. }
  1818. if (TelephonyManager.getDefault().getPhoneCount() <= 1) {
  1819. return;
  1820. }
  1821. if (("CHN".equals(salesCode) || "CHC".equals(salesCode) || "CHU".equals(salesCode) || "CHM".equals(salesCode) || "CTC".equals(salesCode) || "BRI".equals(salesCode) || "TGY".equals(salesCode) || "CWT".equals(salesCode) || "FET".equals(salesCode) || "TWM".equals(salesCode) || "CHZ".equals(salesCode)) && "Combination".equals("Combination") && getRadioState().isOn() && !oldState.isOn()) {
  1822. byte[] RAW_HOOK_OEM_CMD_BPM_ENABLE_QC_EVOLUTION = new byte[]{(byte) 2, (byte) 96, (byte) 0, (byte) 5, (byte) 5};
  1823. String isBpminit = SystemProperties.get("persist.sys.bpmsetting.enable", "X");
  1824. if (isBpminit == null || !"X".equals(isBpminit)) {
  1825. riljLog("init Bpm before set : " + isBpminit);
  1826. return;
  1827. }
  1828. riljLog("init Bpm");
  1829. SystemProperties.set("persist.sys.bpmsetting.enable", "1");
  1830. invokeOemRilRequestRaw(RAW_HOOK_OEM_CMD_BPM_ENABLE_QC_EVOLUTION, null);
  1831. }
  1832. }
  1833.  
  1834. private void acquireWakeLock() {
  1835. synchronized (this.mWakeLock) {
  1836. this.mWakeLock.acquire();
  1837. this.mWakeLockCount++;
  1838. this.mSender.removeMessages(2);
  1839. this.mSender.sendMessageDelayed(this.mSender.obtainMessage(2), (long) this.mWakeLockTimeout);
  1840. }
  1841. }
  1842.  
  1843. private void decrementWakeLock() {
  1844. synchronized (this.mWakeLock) {
  1845. if (this.mWakeLockCount > 1) {
  1846. this.mWakeLockCount--;
  1847. } else {
  1848. this.mWakeLockCount = 0;
  1849. this.mWakeLock.release();
  1850. this.mSender.removeMessages(2);
  1851. }
  1852. }
  1853. }
  1854.  
  1855. private boolean clearWakeLock() {
  1856. boolean z = false;
  1857. synchronized (this.mWakeLock) {
  1858. if (this.mWakeLockCount != 0 || this.mWakeLock.isHeld()) {
  1859. Rlog.d(RILJ_LOG_TAG, "NOTE: mWakeLockCount is " + this.mWakeLockCount + "at time of clearing");
  1860. this.mWakeLockCount = 0;
  1861. this.mWakeLock.release();
  1862. this.mSender.removeMessages(2);
  1863. z = true;
  1864. }
  1865. }
  1866. return z;
  1867. }
  1868.  
  1869. protected void send(RILRequest rr) {
  1870. if (this.mSocket == null) {
  1871. rr.onError(1, null);
  1872. rr.release();
  1873. return;
  1874. }
  1875. Message msg = this.mSender.obtainMessage(1, rr);
  1876. acquireWakeLock();
  1877. msg.sendToTarget();
  1878. }
  1879.  
  1880. private void processResponse(Parcel p) {
  1881. int type = p.readInt();
  1882. if (type == 1) {
  1883. processUnsolicited(p);
  1884. } else if (type == 0) {
  1885. RILRequest rr = processSolicited(p);
  1886. if (rr != null) {
  1887. rr.release();
  1888. decrementWakeLock();
  1889. }
  1890. }
  1891. }
  1892.  
  1893. private void clearRequestList(int error, boolean loggable) {
  1894. synchronized (this.mRequestList) {
  1895. int count = this.mRequestList.size();
  1896. if (loggable) {
  1897. Rlog.d(RILJ_LOG_TAG, "clearRequestList mWakeLockCount=" + this.mWakeLockCount + " mRequestList=" + count);
  1898. }
  1899. for (int i = 0; i < count; i++) {
  1900. RILRequest rr = (RILRequest) this.mRequestList.valueAt(i);
  1901. if (loggable) {
  1902. Rlog.d(RILJ_LOG_TAG, i + ": [" + rr.mSerial + "] " + requestToString(rr.mRequest));
  1903. }
  1904. rr.onError(error, null);
  1905. rr.release();
  1906. decrementWakeLock();
  1907. }
  1908. this.mRequestList.clear();
  1909. }
  1910. }
  1911.  
  1912. private RILRequest findAndRemoveRequestFromList(int serial) {
  1913. RILRequest rr;
  1914. synchronized (this.mRequestList) {
  1915. rr = (RILRequest) this.mRequestList.get(serial);
  1916. if (rr != null) {
  1917. this.mRequestList.remove(serial);
  1918. }
  1919. }
  1920. return rr;
  1921. }
  1922.  
  1923. protected RILRequest processSolicited(Parcel p) {
  1924. String salesCode = SystemProperties.get("ro.csc.sales_code");
  1925. int serial = p.readInt();
  1926. int error = p.readInt();
  1927. RILRequest rr = findAndRemoveRequestFromList(serial);
  1928. if (rr == null) {
  1929. Rlog.w(RILJ_LOG_TAG, "Unexpected solicited response! sn: " + serial + " error: " + error);
  1930. return null;
  1931. }
  1932. Object obj = null;
  1933. if (error == 0 || p.dataAvail() > 0) {
  1934. try {
  1935. switch (rr.mRequest) {
  1936. case 1:
  1937. obj = responseIccCardStatus(p);
  1938. break;
  1939. case 2:
  1940. obj = responseInts(p);
  1941. break;
  1942. case 3:
  1943. obj = responseInts(p);
  1944. break;
  1945. case 4:
  1946. obj = responseInts(p);
  1947. break;
  1948. case 5:
  1949. obj = responseInts(p);
  1950. break;
  1951. case 6:
  1952. obj = responseInts(p);
  1953. break;
  1954. case 7:
  1955. obj = responseInts(p);
  1956. break;
  1957. case 8:
  1958. obj = responseInts(p);
  1959. break;
  1960. case 9:
  1961. obj = responseCallList(p);
  1962. break;
  1963. case 10:
  1964. obj = responseVoid(p);
  1965. break;
  1966. case 11:
  1967. obj = responseString(p);
  1968. break;
  1969. case 12:
  1970. obj = responseVoid(p);
  1971. break;
  1972. case 13:
  1973. obj = responseVoid(p);
  1974. break;
  1975. case 14:
  1976. if (this.mTestingEmergencyCall.getAndSet(false) && this.mEmergencyCallbackModeRegistrant != null) {
  1977. riljLog("testing emergency call, notify ECM Registrants");
  1978. this.mEmergencyCallbackModeRegistrant.notifyRegistrant();
  1979. }
  1980. obj = responseVoid(p);
  1981. break;
  1982. case 15:
  1983. obj = responseVoid(p);
  1984. break;
  1985. case 16:
  1986. obj = responseVoid(p);
  1987. break;
  1988. case 17:
  1989. obj = responseVoid(p);
  1990. break;
  1991. case 18:
  1992. obj = responseFailCause(p);
  1993. break;
  1994. case 19:
  1995. obj = responseSignalStrength(p);
  1996. break;
  1997. case 20:
  1998. obj = responseStrings(p);
  1999. break;
  2000. case 21:
  2001. obj = responseStrings(p);
  2002. break;
  2003. case 22:
  2004. obj = responseStrings(p);
  2005. break;
  2006. case 23:
  2007. obj = responseVoid(p);
  2008. break;
  2009. case 24:
  2010. obj = responseVoid(p);
  2011. break;
  2012. case 25:
  2013. obj = responseSMS(p);
  2014. break;
  2015. case 26:
  2016. obj = responseSMS(p);
  2017. break;
  2018. case WspTypeDecoder.WSP_HEADER_IF_UNMODIFIED_SINCE /*27*/:
  2019. obj = responseSetupDataCall(p);
  2020. break;
  2021. case WspTypeDecoder.WSP_HEADER_LOCATION /*28*/:
  2022. obj = responseICC_IO(p);
  2023. break;
  2024. case WspTypeDecoder.WSP_HEADER_LAST_MODIFIED /*29*/:
  2025. obj = responseVoid(p);
  2026. break;
  2027. case 30:
  2028. obj = responseVoid(p);
  2029. break;
  2030. case 31:
  2031. obj = responseInts(p);
  2032. break;
  2033. case 32:
  2034. obj = responseVoid(p);
  2035. break;
  2036. case 33:
  2037. obj = responseCallForward(p);
  2038. break;
  2039. case 34:
  2040. obj = responseVoid(p);
  2041. break;
  2042. case 35:
  2043. obj = responseInts(p);
  2044. break;
  2045. case 36:
  2046. obj = responseVoid(p);
  2047. break;
  2048. case 37:
  2049. obj = responseVoid(p);
  2050. break;
  2051. case 38:
  2052. obj = responseString(p);
  2053. break;
  2054. case 39:
  2055. obj = responseString(p);
  2056. break;
  2057. case 40:
  2058. obj = responseVoid(p);
  2059. break;
  2060. case 41:
  2061. obj = responseVoid(p);
  2062. break;
  2063. case 42:
  2064. obj = responseInts(p);
  2065. break;
  2066. case 43:
  2067. obj = responseInts(p);
  2068. break;
  2069. case 44:
  2070. obj = responseVoid(p);
  2071. break;
  2072. case WspTypeDecoder.WSP_HEADER_WWW_AUTHENTICATE /*45*/:
  2073. obj = responseInts(p);
  2074. break;
  2075. case 46:
  2076. obj = responseVoid(p);
  2077. break;
  2078. case 47:
  2079. obj = responseVoid(p);
  2080. break;
  2081. case 48:
  2082. obj = responseOperatorInfos(p);
  2083. break;
  2084. case 49:
  2085. obj = responseVoid(p);
  2086. if (this.mDtmfProgress > 0) {
  2087. this.mDtmfProgress--;
  2088. break;
  2089. }
  2090. break;
  2091. case 50:
  2092. obj = responseVoid(p);
  2093. if (this.mDtmfProgress > 0) {
  2094. this.mDtmfProgress--;
  2095. break;
  2096. }
  2097. break;
  2098. case 51:
  2099. obj = responseString(p);
  2100. break;
  2101. case 52:
  2102. obj = responseVoid(p);
  2103. break;
  2104. case 53:
  2105. obj = responseVoid(p);
  2106. break;
  2107. case 54:
  2108. obj = responseInts(p);
  2109. break;
  2110. case 55:
  2111. obj = responseInts(p);
  2112. break;
  2113. case 56:
  2114. obj = responseInts(p);
  2115. break;
  2116. case 57:
  2117. obj = responseDataCallList(p);
  2118. break;
  2119. case 58:
  2120. obj = responseVoid(p);
  2121. break;
  2122. case 59:
  2123. obj = responseRaw(p);
  2124. break;
  2125. case WspTypeDecoder.WSP_HEADER_ACCEPT_ENCODING2 /*60*/:
  2126. obj = responseStrings(p);
  2127. break;
  2128. case WspTypeDecoder.WSP_HEADER_CACHE_CONTROL2 /*61*/:
  2129. obj = responseVoid(p);
  2130. break;
  2131. case 62:
  2132. obj = responseVoid(p);
  2133. break;
  2134. case 63:
  2135. obj = responseInts(p);
  2136. break;
  2137. case 64:
  2138. obj = responseVoid(p);
  2139. break;
  2140. case 65:
  2141. obj = responseVoid(p);
  2142. break;
  2143. case 66:
  2144. obj = responseInts(p);
  2145. break;
  2146. case 67:
  2147. obj = responseString(p);
  2148. break;
  2149. case 68:
  2150. obj = responseVoid(p);
  2151. break;
  2152. case WspTypeDecoder.WSP_HEADER_CONTENT_DISPOSITION2 /*69*/:
  2153. obj = responseString(p);
  2154. break;
  2155. case 70:
  2156. obj = responseVoid(p);
  2157. break;
  2158. case 71:
  2159. obj = responseInts(p);
  2160. break;
  2161. case 72:
  2162. obj = responseVoid(p);
  2163. break;
  2164. case 73:
  2165. obj = responseVoid(p);
  2166. break;
  2167. case 74:
  2168. obj = responseGetPreferredNetworkType(p);
  2169. break;
  2170. case 75:
  2171. obj = responseCellList(p);
  2172. break;
  2173. case RadioNVItems.RIL_NV_LTE_SCAN_PRIORITY_41 /*76*/:
  2174. obj = responseVoid(p);
  2175. break;
  2176. case RadioNVItems.RIL_NV_LTE_HIDDEN_BAND_PRIORITY_25 /*77*/:
  2177. obj = responseVoid(p);
  2178. break;
  2179. case 78:
  2180. obj = responseVoid(p);
  2181. break;
  2182. case RadioNVItems.RIL_NV_LTE_HIDDEN_BAND_PRIORITY_41 /*79*/:
  2183. obj = responseInts(p);
  2184. break;
  2185. case RadioNVItems.RIL_NV_LTE_NEXT_SCAN /*80*/:
  2186. obj = responseVoid(p);
  2187. break;
  2188. case 81:
  2189. obj = responseInts(p);
  2190. break;
  2191. case RadioNVItems.RIL_NV_LTE_BSR_MAX_TIME /*82*/:
  2192. obj = responseVoid(p);
  2193. break;
  2194. case 83:
  2195. obj = responseInts(p);
  2196. break;
  2197. case 84:
  2198. obj = responseVoid(p);
  2199. break;
  2200. case 85:
  2201. obj = responseVoid(p);
  2202. break;
  2203. case 86:
  2204. obj = responseVoid(p);
  2205. break;
  2206. case 87:
  2207. obj = responseSMS(p);
  2208. break;
  2209. case 88:
  2210. obj = responseVoid(p);
  2211. break;
  2212. case 89:
  2213. obj = responseGmsBroadcastConfig(p);
  2214. break;
  2215. case 90:
  2216. obj = responseVoid(p);
  2217. break;
  2218. case 91:
  2219. obj = responseVoid(p);
  2220. break;
  2221. case 92:
  2222. obj = responseCdmaBroadcastConfig(p);
  2223. break;
  2224. case 93:
  2225. obj = responseVoid(p);
  2226. break;
  2227. case 94:
  2228. obj = responseVoid(p);
  2229. break;
  2230. case 95:
  2231. obj = responseStrings(p);
  2232. break;
  2233. case CommandsInterface.CDMA_SMS_FAIL_CAUSE_ENCODING_PROBLEM /*96*/:
  2234. obj = responseInts(p);
  2235. break;
  2236. case OEM_NET_GET_MODEM_CAP /*97*/:
  2237. obj = responseVoid(p);
  2238. break;
  2239. case OEM_NET_UPDATE_SUB_BINDING /*98*/:
  2240. obj = responseStrings(p);
  2241. break;
  2242. case 99:
  2243. obj = responseVoid(p);
  2244. break;
  2245. case 100:
  2246. obj = responseString(p);
  2247. break;
  2248. case Threads.ALERT_EXTREME_THREAD /*101*/:
  2249. obj = responseVoid(p);
  2250. break;
  2251. case Threads.ALERT_SEVERE_THREAD /*102*/:
  2252. obj = responseVoid(p);
  2253. break;
  2254. case Threads.ALERT_AMBER_THREAD /*103*/:
  2255. obj = responseVoid(p);
  2256. break;
  2257. case Threads.ALERT_TEST_MESSAGE_THREAD /*104*/:
  2258. obj = responseInts(p);
  2259. break;
  2260. case 105:
  2261. obj = responseString(p);
  2262. break;
  2263. case 106:
  2264. obj = responseVoid(p);
  2265. break;
  2266. case 107:
  2267. obj = responseICC_IO(p);
  2268. break;
  2269. case 108:
  2270. obj = responseInts(p);
  2271. break;
  2272. case 109:
  2273. obj = responseCellInfoList(p);
  2274. break;
  2275. case Threads.ALERTS_ALL_ONE_THREAD /*110*/:
  2276. obj = responseVoid(p);
  2277. break;
  2278. case 111:
  2279. obj = responseVoid(p);
  2280. break;
  2281. case 112:
  2282. obj = responseInts(p);
  2283. break;
  2284. case 113:
  2285. obj = responseSMS(p);
  2286. break;
  2287. case CallFailCause.KTF_FAIL_CAUSE_114 /*114*/:
  2288. obj = responseICC_IO(p);
  2289. break;
  2290. case CallFailCause.KTF_FAIL_CAUSE_115 /*115*/:
  2291. obj = responseInts(p);
  2292. break;
  2293. case CallFailCause.KTF_FAIL_CAUSE_116 /*116*/:
  2294. obj = responseVoid(p);
  2295. break;
  2296. case 117:
  2297. obj = responseICC_IO(p);
  2298. break;
  2299. case 118:
  2300. obj = responseString(p);
  2301. break;
  2302. case 119:
  2303. obj = responseVoid(p);
  2304. break;
  2305. case 120:
  2306. obj = responseVoid(p);
  2307. break;
  2308. case 121:
  2309. obj = responseVoid(p);
  2310. break;
  2311. case 122:
  2312. obj = responseVoid(p);
  2313. break;
  2314. case 123:
  2315. obj = responseVoid(p);
  2316. break;
  2317. case 124:
  2318. obj = responseHardwareConfig(p);
  2319. break;
  2320. case 125:
  2321. obj = responseICC_IO(p);
  2322. break;
  2323. case 128:
  2324. obj = responseVoid(p);
  2325. break;
  2326. case 129:
  2327. obj = responseVoid(p);
  2328. break;
  2329. case 130:
  2330. obj = responseRadioCapability(p);
  2331. break;
  2332. case 131:
  2333. obj = responseRadioCapability(p);
  2334. break;
  2335. case 132:
  2336. obj = responseLceStatus(p);
  2337. break;
  2338. case 133:
  2339. obj = responseLceStatus(p);
  2340. break;
  2341. case 134:
  2342. obj = responseLceData(p);
  2343. break;
  2344. case 135:
  2345. obj = responseActivityData(p);
  2346. break;
  2347. case 10001:
  2348. obj = responseVoid(p);
  2349. break;
  2350. case 10002:
  2351. obj = responseVoid(p);
  2352. break;
  2353. case 10003:
  2354. obj = responseFailCause(p);
  2355. break;
  2356. case 10004:
  2357. obj = responseVoid(p);
  2358. break;
  2359. case 10005:
  2360. obj = responseVoid(p);
  2361. break;
  2362. case 10006:
  2363. obj = responseVoid(p);
  2364. break;
  2365. case 10007:
  2366. obj = responseVoid(p);
  2367. break;
  2368. case 10008:
  2369. obj = responseCbSettings(p);
  2370. break;
  2371. case 10009:
  2372. obj = responseInts(p);
  2373. break;
  2374. case 10010:
  2375. obj = responseSIM_PB(p);
  2376. break;
  2377. case 10011:
  2378. obj = responseInts(p);
  2379. break;
  2380. case 10012:
  2381. obj = responseInts(p);
  2382. break;
  2383. case 10013:
  2384. obj = responseSIM_LockInfo(p);
  2385. break;
  2386. case 10014:
  2387. obj = responseVoid(p);
  2388. break;
  2389. case 10015:
  2390. obj = responseVoid(p);
  2391. break;
  2392. case 10016:
  2393. obj = responsePreferredNetworkList(p);
  2394. break;
  2395. case 10017:
  2396. obj = responseInts(p);
  2397. break;
  2398. case 10018:
  2399. obj = responseInts(p);
  2400. break;
  2401. case 10019:
  2402. obj = responseVoid(p);
  2403. break;
  2404. case 10020:
  2405. obj = responseSMS(p);
  2406. break;
  2407. case 10021:
  2408. obj = responseVoid(p);
  2409. break;
  2410. case 10022:
  2411. obj = responseVoid(p);
  2412. break;
  2413. case 10023:
  2414. obj = responseSimPowerDone(p);
  2415. break;
  2416. case 10025:
  2417. obj = responseBootstrap(p);
  2418. break;
  2419. case 10026:
  2420. obj = responseNaf(p);
  2421. break;
  2422. case 10027:
  2423. obj = responseString(p);
  2424. break;
  2425. case 10028:
  2426. obj = responseVoid(p);
  2427. break;
  2428. case 10029:
  2429. obj = responseInts(p);
  2430. break;
  2431. case 10030:
  2432. obj = responseVoid(p);
  2433. break;
  2434. case 10031:
  2435. obj = responseInts(p);
  2436. break;
  2437. case 10032:
  2438. obj = responseVoid(p);
  2439. break;
  2440. case 10033:
  2441. obj = responseVoid(p);
  2442. break;
  2443. default:
  2444. throw new RuntimeException("Unrecognized solicited response: " + rr.mRequest);
  2445. }
  2446. } catch (Throwable tr) {
  2447. Rlog.w(RILJ_LOG_TAG, rr.serialString() + "< " + requestToString(rr.mRequest) + " exception, possible invalid RIL response", tr);
  2448. if (rr.mResult == null) {
  2449. return rr;
  2450. }
  2451. AsyncResult.forMessage(rr.mResult, null, tr);
  2452. rr.mResult.sendToTarget();
  2453. return rr;
  2454. }
  2455. }
  2456. if (rr.mRequest == 129) {
  2457. riljLog("Response to RIL_REQUEST_SHUTDOWN received. Error is " + error + " Setting Radio State to Unavailable regardless of error.");
  2458. setRadioState(RadioState.RADIO_UNAVAILABLE);
  2459. if ("DCGS".equals("") && "1".equals(SystemProperties.get("sys.deviceOffReq", "0"))) {
  2460. if (this.mInstanceId.intValue() == 0) {
  2461. SystemProperties.set("ril.deviceOffRes", "1");
  2462. } else if (this.mInstanceId.intValue() == 1) {
  2463. SystemProperties.set("ril.deviceOffRes2", "1");
  2464. }
  2465. }
  2466. }
  2467. switch (rr.mRequest) {
  2468. case 3:
  2469. case 5:
  2470. if (this.mIccStatusChangedRegistrants != null) {
  2471. riljLog("ON enter sim puk fakeSimStatusChanged: reg count=" + this.mIccStatusChangedRegistrants.size());
  2472. this.mIccStatusChangedRegistrants.notifyRegistrants();
  2473. break;
  2474. }
  2475. break;
  2476. }
  2477. if (error != 0) {
  2478. switch (rr.mRequest) {
  2479. case 2:
  2480. case 4:
  2481. case 6:
  2482. case 7:
  2483. case 43:
  2484. if (this.mIccStatusChangedRegistrants != null) {
  2485. riljLog("ON some errors fakeSimStatusChanged: reg count=" + this.mIccStatusChangedRegistrants.size());
  2486. this.mIccStatusChangedRegistrants.notifyRegistrants();
  2487. break;
  2488. }
  2489. break;
  2490. case 130:
  2491. if (6 != error && 2 != error) {
  2492. obj = makeStaticRadioCapability();
  2493. error = 0;
  2494. break;
  2495. }
  2496. obj = makeStaticRadioCapability();
  2497. error = 0;
  2498. break;
  2499. case 135:
  2500. obj = new ModemActivityInfo(0, 0, 0, new int[5], 0, 0);
  2501. error = 0;
  2502. break;
  2503. }
  2504. if (error != 0) {
  2505. rr.onError(error, obj);
  2506. }
  2507. }
  2508. if (error != 0) {
  2509. return rr;
  2510. }
  2511. if ("CTC".equals(salesCode) && rr.mRequest == 73) {
  2512. if (this.mPreferredNetworkType < 8 || this.mPreferredNetworkType > 12) {
  2513. System.putInt(this.mContext.getContentResolver(), "lte_mode_switch", 0);
  2514. Rlog.d(RILJ_LOG_TAG, "Set LTE_MODE_SWITCH off");
  2515. } else {
  2516. System.putInt(this.mContext.getContentResolver(), "lte_mode_switch", 1);
  2517. Rlog.d(RILJ_LOG_TAG, "Set LTE_MODE_SWITCH on");
  2518. }
  2519. }
  2520. riljLog(rr.serialString() + "< " + requestToString(rr.mRequest) + " " + retToString(rr.mRequest, obj));
  2521. if (rr.mResult == null) {
  2522. return rr;
  2523. }
  2524. AsyncResult.forMessage(rr.mResult, obj, null);
  2525. rr.mResult.sendToTarget();
  2526. return rr;
  2527. }
  2528.  
  2529. private RadioCapability makeStaticRadioCapability() {
  2530. int raf = 1;
  2531. String rafString = this.mContext.getResources().getString(17039447);
  2532. if (!TextUtils.isEmpty(rafString)) {
  2533. raf = RadioAccessFamily.rafTypeFromString(rafString);
  2534. }
  2535. RadioCapability rc = new RadioCapability(this.mInstanceId.intValue(), 0, 0, raf, "", 1);
  2536. riljLog("Faking RIL_REQUEST_GET_RADIO_CAPABILITY response using " + raf);
  2537. return rc;
  2538. }
  2539.  
  2540. static String retToString(int req, Object ret) {
  2541. if (ret == null) {
  2542. return "";
  2543. }
  2544. switch (req) {
  2545. case 11:
  2546. case 38:
  2547. case 39:
  2548. case CallFailCause.KTF_FAIL_CAUSE_115 /*115*/:
  2549. case 117:
  2550. return "";
  2551. case 22:
  2552. if (SHIP_BUILD) {
  2553. return "{xx,xx,xx,xx}";
  2554. }
  2555. break;
  2556. case 95:
  2557. break;
  2558. case OEM_NET_UPDATE_SUB_BINDING /*98*/:
  2559. if (SHIP_BUILD) {
  2560. return "{xx,xx,xx,xx,xx}";
  2561. }
  2562. break;
  2563. case 105:
  2564. case 109:
  2565. case 1013:
  2566. case 1014:
  2567. case CharacterSets.UTF_16 /*1015*/:
  2568. case 1027:
  2569. if (SHIP_BUILD) {
  2570. return "";
  2571. }
  2572. break;
  2573. }
  2574. if (SHIP_BUILD) {
  2575. return "{xx,xx,xx,xx,xx}";
  2576. }
  2577. int length;
  2578. StringBuilder stringBuilder;
  2579. int i;
  2580. int i2;
  2581. if (ret instanceof int[]) {
  2582. int[] intArray = (int[]) ret;
  2583. length = intArray.length;
  2584. stringBuilder = new StringBuilder("{");
  2585. if (length > 0) {
  2586. i = 0 + 1;
  2587. stringBuilder.append(intArray[0]);
  2588. while (i < length) {
  2589. i2 = i + 1;
  2590. stringBuilder.append(", ").append(intArray[i]);
  2591. i = i2;
  2592. }
  2593. }
  2594. stringBuilder.append("}");
  2595. return stringBuilder.toString();
  2596. } else if (ret instanceof String[]) {
  2597. String[] strings = (String[]) ret;
  2598. length = strings.length;
  2599. stringBuilder = new StringBuilder("{");
  2600. if (length > 0) {
  2601. i = 0 + 1;
  2602. stringBuilder.append(strings[0]);
  2603. while (i < length) {
  2604. i2 = i + 1;
  2605. stringBuilder.append(", ").append(strings[i]);
  2606. i = i2;
  2607. }
  2608. }
  2609. stringBuilder.append("}");
  2610. return stringBuilder.toString();
  2611. } else if (req == 9) {
  2612. ArrayList<DriverCall> calls = (ArrayList) ret;
  2613. stringBuilder = new StringBuilder("{");
  2614. i$ = calls.iterator();
  2615. while (i$.hasNext()) {
  2616. stringBuilder.append("[").append((DriverCall) i$.next()).append("] ");
  2617. }
  2618. stringBuilder.append("}");
  2619. return stringBuilder.toString();
  2620. } else if (req == 75) {
  2621. ArrayList<NeighboringCellInfo> cells = (ArrayList) ret;
  2622. stringBuilder = new StringBuilder("{");
  2623. i$ = cells.iterator();
  2624. while (i$.hasNext()) {
  2625. stringBuilder.append("[").append((NeighboringCellInfo) i$.next()).append("] ");
  2626. }
  2627. stringBuilder.append("}");
  2628. return stringBuilder.toString();
  2629. } else if (req == 33) {
  2630. stringBuilder = new StringBuilder("{");
  2631. for (Object append : (CallForwardInfo[]) ret) {
  2632. stringBuilder.append("[").append(append).append("] ");
  2633. }
  2634. stringBuilder.append("}");
  2635. return stringBuilder.toString();
  2636. } else if (req == 124) {
  2637. ArrayList<HardwareConfig> hwcfgs = (ArrayList) ret;
  2638. stringBuilder = new StringBuilder(" ");
  2639. i$ = hwcfgs.iterator();
  2640. while (i$.hasNext()) {
  2641. stringBuilder.append("[").append((HardwareConfig) i$.next()).append("] ");
  2642. }
  2643. return stringBuilder.toString();
  2644. } else if (req == 59) {
  2645. String s = ret.toString();
  2646. if (!SHIP_BUILD || s.length() <= 5) {
  2647. return s;
  2648. }
  2649. return s.substring(0, 5) + "...";
  2650. } else if (req != 33) {
  2651. return ret.toString();
  2652. } else {
  2653. CallForwardInfo[] CFinfos = (CallForwardInfo[]) ret;
  2654. length = CFinfos.length;
  2655. stringBuilder = new StringBuilder("[");
  2656. if (SHIP_BUILD) {
  2657. if (length > 0) {
  2658. i = 0 + 1;
  2659. if (CFinfos[0].status == 1) {
  2660. stringBuilder.append(" active ");
  2661. } else {
  2662. stringBuilder.append(" not active ");
  2663. }
  2664. while (i < length) {
  2665. i2 = i + 1;
  2666. if (CFinfos[i].status == 1) {
  2667. stringBuilder.append("] [").append(" active ");
  2668. i = i2;
  2669. } else {
  2670. stringBuilder.append("] [").append(" not active ");
  2671. i = i2;
  2672. }
  2673. }
  2674. }
  2675. } else if (length > 0) {
  2676. i = 0 + 1;
  2677. stringBuilder.append(CFinfos[0].toString());
  2678. while (i < length) {
  2679. i2 = i + 1;
  2680. stringBuilder.append("] [").append(CFinfos[i].toString());
  2681. i = i2;
  2682. }
  2683. }
  2684. stringBuilder.append("]");
  2685. return stringBuilder.toString();
  2686. }
  2687. }
  2688.  
  2689. protected void processUnsolicited(Parcel p) {
  2690. String responseVoid;
  2691. int response = p.readInt();
  2692. switch (response) {
  2693. case 1000:
  2694. responseVoid = responseVoid(p);
  2695. break;
  2696. case com.android.internal.telephony.cdma.CallFailCause.CDMA_DROP /*1001*/:
  2697. this.mDtmfProgress = 0;
  2698. responseVoid = responseVoid(p);
  2699. break;
  2700. case com.android.internal.telephony.cdma.CallFailCause.CDMA_INTERCEPT /*1002*/:
  2701. responseVoid = responseVoid(p);
  2702. break;
  2703. case com.android.internal.telephony.cdma.CallFailCause.CDMA_REORDER /*1003*/:
  2704. responseVoid = responseString(p);
  2705. break;
  2706. case com.android.internal.telephony.cdma.CallFailCause.CDMA_SO_REJECT /*1004*/:
  2707. responseVoid = responseString(p);
  2708. break;
  2709. case com.android.internal.telephony.cdma.CallFailCause.CDMA_RETRY_ORDER /*1005*/:
  2710. responseVoid = responseInts(p);
  2711. break;
  2712. case com.android.internal.telephony.cdma.CallFailCause.CDMA_ACCESS_FAILURE /*1006*/:
  2713. responseVoid = responseStrings(p);
  2714. break;
  2715. case com.android.internal.telephony.cdma.CallFailCause.CDMA_NOT_EMERGENCY /*1008*/:
  2716. responseVoid = responseString(p);
  2717. break;
  2718. case 1009:
  2719. responseVoid = responseSignalStrength(p);
  2720. break;
  2721. case 1010:
  2722. responseVoid = responseDataCallList(p);
  2723. break;
  2724. case 1011:
  2725. responseVoid = responseSuppServiceNotification(p);
  2726. break;
  2727. case 1012:
  2728. responseVoid = responseVoid(p);
  2729. break;
  2730. case 1013:
  2731. responseVoid = responseString(p);
  2732. break;
  2733. case 1014:
  2734. responseVoid = responseString(p);
  2735. break;
  2736. case CharacterSets.UTF_16 /*1015*/:
  2737. responseVoid = responseInts(p);
  2738. break;
  2739. case 1016:
  2740. responseVoid = responseVoid(p);
  2741. break;
  2742. case 1017:
  2743. responseVoid = responseSimRefresh(p);
  2744. break;
  2745. case 1018:
  2746. responseVoid = responseCallRing(p);
  2747. break;
  2748. case 1019:
  2749. responseVoid = responseVoid(p);
  2750. break;
  2751. case 1020:
  2752. responseVoid = responseCdmaSms(p);
  2753. break;
  2754. case 1021:
  2755. responseVoid = responseRaw(p);
  2756. break;
  2757. case 1022:
  2758. responseVoid = responseVoid(p);
  2759. break;
  2760. case 1023:
  2761. responseVoid = responseInts(p);
  2762. break;
  2763. case 1024:
  2764. responseVoid = responseVoid(p);
  2765. break;
  2766. case 1025:
  2767. responseVoid = responseCdmaCallWaiting(p);
  2768. break;
  2769. case 1026:
  2770. responseVoid = responseInts(p);
  2771. break;
  2772. case 1027:
  2773. responseVoid = responseCdmaInformationRecord(p);
  2774. break;
  2775. case 1028:
  2776. responseVoid = responseRaw(p);
  2777. break;
  2778. case 1029:
  2779. responseVoid = responseInts(p);
  2780. break;
  2781. case 1030:
  2782. responseVoid = responseVoid(p);
  2783. break;
  2784. case 1031:
  2785. responseVoid = responseInts(p);
  2786. break;
  2787. case 1032:
  2788. responseVoid = responseInts(p);
  2789. break;
  2790. case 1033:
  2791. responseVoid = responseVoid(p);
  2792. break;
  2793. case 1034:
  2794. responseVoid = responseInts(p);
  2795. break;
  2796. case 1035:
  2797. responseVoid = responseInts(p);
  2798. break;
  2799. case 1036:
  2800. responseVoid = responseCellInfoList(p);
  2801. break;
  2802. case 1037:
  2803. responseVoid = responseVoid(p);
  2804. break;
  2805. case 1038:
  2806. responseVoid = responseInts(p);
  2807. break;
  2808. case 1039:
  2809. responseVoid = responseInts(p);
  2810. break;
  2811. case 1040:
  2812. responseVoid = responseHardwareConfig(p);
  2813. break;
  2814. case 1042:
  2815. responseVoid = responseRadioCapability(p);
  2816. break;
  2817. case 1043:
  2818. responseVoid = responseSsData(p);
  2819. break;
  2820. case 1044:
  2821. responseVoid = responseString(p);
  2822. break;
  2823. case 1045:
  2824. responseVoid = responseLceData(p);
  2825. break;
  2826. case 11001:
  2827. responseVoid = responseSSReleaseCompleteNotification(p);
  2828. break;
  2829. case 11002:
  2830. responseVoid = responseInts(p);
  2831. break;
  2832. case 11003:
  2833. responseVoid = responseString(p);
  2834. break;
  2835. case 11008:
  2836. responseVoid = responseVoid(p);
  2837. break;
  2838. case 11009:
  2839. responseVoid = responseVoid(p);
  2840. break;
  2841. case 11010:
  2842. responseVoid = responseString(p);
  2843. break;
  2844. case 11013:
  2845. responseVoid = responseRaw(p);
  2846. break;
  2847. case 11020:
  2848. responseVoid = responseRaw(p);
  2849. break;
  2850. case 11021:
  2851. responseVoid = responseVoid(p);
  2852. break;
  2853. case 11024:
  2854. responseVoid = responseRaw(p);
  2855. break;
  2856. case 11027:
  2857. responseVoid = responseInts(p);
  2858. break;
  2859. case 11028:
  2860. responseVoid = responseCallModify(p);
  2861. break;
  2862. case 11030:
  2863. responseVoid = responseInts(p);
  2864. break;
  2865. case 11032:
  2866. responseVoid = responseInts(p);
  2867. break;
  2868. case 11034:
  2869. responseVoid = responseVoid(p);
  2870. break;
  2871. case 11035:
  2872. responseVoid = responseVoid(p);
  2873. break;
  2874. case 11037:
  2875. responseVoid = responseVoid(p);
  2876. break;
  2877. case 11043:
  2878. responseVoid = responseVoid(p);
  2879. break;
  2880. case 11054:
  2881. responseVoid = responseInts(p);
  2882. break;
  2883. case 11056:
  2884. responseVoid = responseRaw(p);
  2885. break;
  2886. case 11057:
  2887. responseVoid = responseInts(p);
  2888. break;
  2889. case 11058:
  2890. responseVoid = responseInts(p);
  2891. break;
  2892. case 11060:
  2893. responseVoid = responseStrings(p);
  2894. break;
  2895. case 11061:
  2896. responseVoid = responseInts(p);
  2897. break;
  2898. case 11062:
  2899. responseVoid = responseInts(p);
  2900. break;
  2901. case 11064:
  2902. responseVoid = responseInts(p);
  2903. break;
  2904. case 11066:
  2905. responseVoid = responseString(p);
  2906. break;
  2907. default:
  2908. try {
  2909. throw new RuntimeException("Unrecognized unsol response: " + response);
  2910. } catch (Throwable tr) {
  2911. Rlog.e(RILJ_LOG_TAG, "Exception processing unsol response: " + response + "Exception:" + tr.toString());
  2912. return;
  2913. }
  2914. }
  2915. SmsMessage sms;
  2916. switch (response) {
  2917. case 1000:
  2918. RadioState newState = getRadioStateFromInt(p.readInt());
  2919. unsljLogMore(response, newState.toString());
  2920. switchToRadioState(newState);
  2921. return;
  2922. case com.android.internal.telephony.cdma.CallFailCause.CDMA_DROP /*1001*/:
  2923. unsljLog(response);
  2924. this.mCallStateRegistrants.notifyRegistrants(new AsyncResult(null, null, null));
  2925. return;
  2926. case com.android.internal.telephony.cdma.CallFailCause.CDMA_INTERCEPT /*1002*/:
  2927. unsljLog(response);
  2928. this.mVoiceNetworkStateRegistrants.notifyRegistrants(new AsyncResult(null, null, null));
  2929. return;
  2930. case com.android.internal.telephony.cdma.CallFailCause.CDMA_REORDER /*1003*/:
  2931. unsljLog(response);
  2932. String[] a = new String[2];
  2933. a[1] = responseVoid;
  2934. sms = SmsMessage.newFromCMT(a);
  2935. if (this.mGsmSmsRegistrant != null) {
  2936. this.mGsmSmsRegistrant.notifyRegistrant(new AsyncResult(null, sms, null));
  2937. }
  2938. if (SystemProperties.getBoolean("persist.EarthquakeTestmode", false)) {
  2939. testingETWS(sms);
  2940. return;
  2941. }
  2942. return;
  2943. case com.android.internal.telephony.cdma.CallFailCause.CDMA_SO_REJECT /*1004*/:
  2944. unsljLogRet(response, responseVoid);
  2945. if (this.mSmsStatusRegistrant != null) {
  2946. this.mSmsStatusRegistrant.notifyRegistrant(new AsyncResult(null, responseVoid, null));
  2947. return;
  2948. }
  2949. return;
  2950. case com.android.internal.telephony.cdma.CallFailCause.CDMA_RETRY_ORDER /*1005*/:
  2951. unsljLogRet(response, responseVoid);
  2952. Object smsIndex = (int[]) responseVoid;
  2953. if (smsIndex.length != 1) {
  2954. riljLog(" NEW_SMS_ON_SIM ERROR with wrong length " + smsIndex.length);
  2955. return;
  2956. } else if (this.mSmsOnSimRegistrant != null) {
  2957. this.mSmsOnSimRegistrant.notifyRegistrant(new AsyncResult(null, smsIndex, null));
  2958. return;
  2959. } else {
  2960. return;
  2961. }
  2962. case com.android.internal.telephony.cdma.CallFailCause.CDMA_ACCESS_FAILURE /*1006*/:
  2963. Object resp = (String[]) responseVoid;
  2964. if (resp.length < 2) {
  2965. resp = new String[]{((String[]) responseVoid)[0], null};
  2966. }
  2967. unsljLogMore(response, resp[0]);
  2968. if (this.mUSSDRegistrant != null) {
  2969. this.mUSSDRegistrant.notifyRegistrant(new AsyncResult(null, resp, null));
  2970. return;
  2971. }
  2972. return;
  2973. case com.android.internal.telephony.cdma.CallFailCause.CDMA_NOT_EMERGENCY /*1008*/:
  2974. unsljLogRet(response, responseVoid);
  2975. long nitzReceiveTime = p.readLong();
  2976. Object result = new Object[]{responseVoid, Long.valueOf(nitzReceiveTime)};
  2977. if (SystemProperties.getBoolean("telephony.test.ignore.nitz", false)) {
  2978. riljLog("ignoring UNSOL_NITZ_TIME_RECEIVED");
  2979. return;
  2980. }
  2981. if (this.mNITZTimeRegistrant != null) {
  2982. this.mNITZTimeRegistrant.notifyRegistrant(new AsyncResult(null, result, null));
  2983. }
  2984. this.mLastNITZTimeInfo = result;
  2985. return;
  2986. case 1009:
  2987. if (this.mSignalStrengthRegistrant != null) {
  2988. this.mSignalStrengthRegistrant.notifyRegistrant(new AsyncResult(null, responseVoid, null));
  2989. return;
  2990. }
  2991. return;
  2992. case 1010:
  2993. unsljLogRet(response, responseVoid);
  2994. this.mDataNetworkStateRegistrants.notifyRegistrants(new AsyncResult(null, responseVoid, null));
  2995. return;
  2996. case 1011:
  2997. unsljLogRet(response, responseVoid);
  2998. if (this.mSsnRegistrant != null) {
  2999. this.mSsnRegistrant.notifyRegistrant(new AsyncResult(null, responseVoid, null));
  3000. return;
  3001. }
  3002. return;
  3003. case 1012:
  3004. unsljLog(response);
  3005. if (this.mCatSessionEndRegistrant != null) {
  3006. this.mCatSessionEndRegistrant.notifyRegistrant(new AsyncResult(null, responseVoid, null));
  3007. return;
  3008. }
  3009. return;
  3010. case 1013:
  3011. unsljLog(response);
  3012. if (this.mCatProCmdRegistrant != null) {
  3013. this.mCatProCmdRegistrant.notifyRegistrant(new AsyncResult(null, responseVoid, null));
  3014. return;
  3015. }
  3016. return;
  3017. case 1014:
  3018. unsljLog(response);
  3019. if (this.mCatEventRegistrant != null) {
  3020. this.mCatEventRegistrant.notifyRegistrant(new AsyncResult(null, responseVoid, null));
  3021. return;
  3022. }
  3023. return;
  3024. case CharacterSets.UTF_16 /*1015*/:
  3025. unsljLogRet(response, responseVoid);
  3026. if (this.mCatCallSetUpRegistrant != null) {
  3027. this.mCatCallSetUpRegistrant.notifyRegistrant(new AsyncResult(null, responseVoid, null));
  3028. return;
  3029. }
  3030. return;
  3031. case 1016:
  3032. unsljLog(response);
  3033. if (this.mIccSmsFullRegistrant != null) {
  3034. this.mIccSmsFullRegistrant.notifyRegistrant();
  3035. return;
  3036. }
  3037. return;
  3038. case 1017:
  3039. unsljLogRet(response, responseVoid);
  3040. if (this.mIccRefreshRegistrants != null) {
  3041. this.mIccRefreshRegistrants.notifyRegistrants(new AsyncResult(null, responseVoid, null));
  3042. return;
  3043. }
  3044. return;
  3045. case 1018:
  3046. unsljLogRet(response, responseVoid);
  3047. if (this.mRingRegistrant != null) {
  3048. this.mRingRegistrant.notifyRegistrant(new AsyncResult(null, responseVoid, null));
  3049. return;
  3050. }
  3051. return;
  3052. case 1019:
  3053. unsljLog(response);
  3054. if (this.mIccStatusChangedRegistrants != null) {
  3055. this.mIccStatusChangedRegistrants.notifyRegistrants();
  3056. return;
  3057. }
  3058. return;
  3059. case 1020:
  3060. unsljLog(response);
  3061. sms = (SmsMessage) responseVoid;
  3062. if (this.mCdmaSmsRegistrant != null) {
  3063. this.mCdmaSmsRegistrant.notifyRegistrant(new AsyncResult(null, sms, null));
  3064. return;
  3065. }
  3066. return;
  3067. case 1021:
  3068. unsljLogvRet(response, IccUtils.bytesToHexString((byte[]) responseVoid));
  3069. if (this.mGsmBroadcastSmsRegistrant != null) {
  3070. this.mGsmBroadcastSmsRegistrant.notifyRegistrant(new AsyncResult(null, responseVoid, null));
  3071. return;
  3072. }
  3073. return;
  3074. case 1022:
  3075. unsljLog(response);
  3076. if (this.mIccSmsFullRegistrant != null) {
  3077. this.mIccSmsFullRegistrant.notifyRegistrant();
  3078. return;
  3079. }
  3080. return;
  3081. case 1023:
  3082. unsljLogvRet(response, responseVoid);
  3083. if (this.mRestrictedStateRegistrant != null) {
  3084. this.mRestrictedStateRegistrant.notifyRegistrant(new AsyncResult(null, responseVoid, null));
  3085. return;
  3086. }
  3087. return;
  3088. case 1024:
  3089. unsljLog(response);
  3090. if (this.mEmergencyCallbackModeRegistrant != null) {
  3091. this.mEmergencyCallbackModeRegistrant.notifyRegistrant();
  3092. return;
  3093. }
  3094. return;
  3095. case 1025:
  3096. unsljLogRet(response, responseVoid);
  3097. if (this.mCallWaitingInfoRegistrants != null) {
  3098. this.mCallWaitingInfoRegistrants.notifyRegistrants(new AsyncResult(null, responseVoid, null));
  3099. return;
  3100. }
  3101. return;
  3102. case 1026:
  3103. unsljLogRet(response, responseVoid);
  3104. if (this.mOtaProvisionRegistrants != null) {
  3105. this.mOtaProvisionRegistrants.notifyRegistrants(new AsyncResult(null, responseVoid, null));
  3106. return;
  3107. }
  3108. return;
  3109. case 1027:
  3110. try {
  3111. Iterator i$ = ((ArrayList) responseVoid).iterator();
  3112. while (i$.hasNext()) {
  3113. CdmaInformationRecords rec = (CdmaInformationRecords) i$.next();
  3114. unsljLogRet(response, rec);
  3115. notifyRegistrantsCdmaInfoRec(rec);
  3116. }
  3117. return;
  3118. } catch (ClassCastException e) {
  3119. Rlog.e(RILJ_LOG_TAG, "Unexpected exception casting to listInfoRecs", e);
  3120. return;
  3121. }
  3122. case 1028:
  3123. unsljLogvRet(response, IccUtils.bytesToHexString((byte[]) responseVoid));
  3124. if (this.mUnsolOemHookRawRegistrant != null) {
  3125. this.mUnsolOemHookRawRegistrant.notifyRegistrant(new AsyncResult(null, responseVoid, null));
  3126. return;
  3127. }
  3128. return;
  3129. case 1029:
  3130. unsljLogvRet(response, responseVoid);
  3131. if (this.mRingbackToneRegistrants != null) {
  3132. this.mRingbackToneRegistrants.notifyRegistrants(new AsyncResult(null, Boolean.valueOf(((int[]) ((int[]) responseVoid))[0] == 1), null));
  3133. return;
  3134. }
  3135. return;
  3136. case 1030:
  3137. unsljLogRet(response, responseVoid);
  3138. if (this.mResendIncallMuteRegistrants != null) {
  3139. this.mResendIncallMuteRegistrants.notifyRegistrants(new AsyncResult(null, responseVoid, null));
  3140. return;
  3141. }
  3142. return;
  3143. case 1031:
  3144. unsljLogRet(response, responseVoid);
  3145. if (this.mCdmaSubscriptionChangedRegistrants != null) {
  3146. this.mCdmaSubscriptionChangedRegistrants.notifyRegistrants(new AsyncResult(null, responseVoid, null));
  3147. return;
  3148. }
  3149. return;
  3150. case 1032:
  3151. unsljLogRet(response, responseVoid);
  3152. if (this.mCdmaPrlChangedRegistrants != null) {
  3153. this.mCdmaPrlChangedRegistrants.notifyRegistrants(new AsyncResult(null, responseVoid, null));
  3154. return;
  3155. }
  3156. return;
  3157. case 1033:
  3158. unsljLogRet(response, responseVoid);
  3159. if (this.mExitEmergencyCallbackModeRegistrants != null) {
  3160. this.mExitEmergencyCallbackModeRegistrants.notifyRegistrants(new AsyncResult(null, null, null));
  3161. return;
  3162. }
  3163. return;
  3164. case 1034:
  3165. Rlog.i(RILJ_LOG_TAG, "!@Boot_SVC : RIL_UNSOL_RIL_CONNECTED");
  3166. unsljLogRet(response, responseVoid);
  3167. if ("DCGG".equals("")) {
  3168. Rlog.d(RILJ_LOG_TAG, "do not power off radio");
  3169. } else if ("DGG".equals("") && this.mInstanceId.intValue() == 1) {
  3170. Rlog.d(RILJ_LOG_TAG, "do not power off radio");
  3171. } else if ("DCGGS".equals("")) {
  3172. String cg_switch = SystemProperties.get("ril.rildreset", "");
  3173. if ("8".equals(cg_switch)) {
  3174. String isRildReady = SystemProperties.get("ril.RildInit", "");
  3175. int reTryTimes = 1;
  3176. while (!"1".equals(isRildReady) && reTryTimes < 8) {
  3177. Rlog.d(RILJ_LOG_TAG, "Rild is not ready, reTry " + reTryTimes + "times");
  3178. try {
  3179. Thread.sleep(500);
  3180. } catch (InterruptedException e2) {
  3181. }
  3182. isRildReady = SystemProperties.get("ril.RildInit", "");
  3183. reTryTimes++;
  3184. }
  3185. Rlog.d(RILJ_LOG_TAG, "[CGG] Notify ril connected event to CP!");
  3186. setSimPower(9, null);
  3187. }
  3188. if ("8".equals(cg_switch) || "9".equals(cg_switch)) {
  3189. Rlog.d(RILJ_LOG_TAG, "[CGG] rildreset property value set as zero!");
  3190. SystemProperties.set("ril.rildreset", "0");
  3191. }
  3192. } else if (TelephonyManager.getDefault().getPhoneCount() <= 1 || this.mInstanceId.intValue() != 1) {
  3193. setRadioPower(false, null);
  3194. } else {
  3195. Rlog.d(RILJ_LOG_TAG, "Do not power off radio for slot2");
  3196. }
  3197. setCellInfoListRate(Integer.MAX_VALUE, null);
  3198. notifyRegistrantsRilConnectionChanged(((int[]) responseVoid)[0]);
  3199. return;
  3200. case 1035:
  3201. unsljLogRet(response, responseVoid);
  3202. if (this.mVoiceRadioTechChangedRegistrants != null) {
  3203. this.mVoiceRadioTechChangedRegistrants.notifyRegistrants(new AsyncResult(null, responseVoid, null));
  3204. return;
  3205. }
  3206. return;
  3207. case 1036:
  3208. unsljLogRet(response, responseVoid);
  3209. if (this.mRilCellInfoListRegistrants != null) {
  3210. this.mRilCellInfoListRegistrants.notifyRegistrants(new AsyncResult(null, responseVoid, null));
  3211. return;
  3212. }
  3213. return;
  3214. case 1037:
  3215. unsljLog(response);
  3216. this.mImsNetworkStateChangedRegistrants.notifyRegistrants(new AsyncResult(null, null, null));
  3217. return;
  3218. case 1038:
  3219. unsljLogRet(response, responseVoid);
  3220. if (this.mSubscriptionStatusRegistrants != null) {
  3221. this.mSubscriptionStatusRegistrants.notifyRegistrants(new AsyncResult(null, responseVoid, null));
  3222. return;
  3223. }
  3224. return;
  3225. case 1039:
  3226. unsljLogRet(response, responseVoid);
  3227. if (this.mSrvccStateRegistrants != null) {
  3228. this.mSrvccStateRegistrants.notifyRegistrants(new AsyncResult(null, responseVoid, null));
  3229. return;
  3230. }
  3231. return;
  3232. case 1040:
  3233. unsljLogRet(response, responseVoid);
  3234. if (this.mHardwareConfigChangeRegistrants != null) {
  3235. this.mHardwareConfigChangeRegistrants.notifyRegistrants(new AsyncResult(null, responseVoid, null));
  3236. return;
  3237. }
  3238. return;
  3239. case 1042:
  3240. unsljLogRet(response, responseVoid);
  3241. if (this.mPhoneRadioCapabilityChangedRegistrants != null) {
  3242. this.mPhoneRadioCapabilityChangedRegistrants.notifyRegistrants(new AsyncResult(null, responseVoid, null));
  3243. return;
  3244. }
  3245. return;
  3246. case 1043:
  3247. unsljLogRet(response, responseVoid);
  3248. if (this.mSsRegistrant != null) {
  3249. this.mSsRegistrant.notifyRegistrant(new AsyncResult(null, responseVoid, null));
  3250. return;
  3251. }
  3252. return;
  3253. case 1044:
  3254. unsljLogRet(response, responseVoid);
  3255. if (this.mCatCcAlphaRegistrant != null) {
  3256. this.mCatCcAlphaRegistrant.notifyRegistrant(new AsyncResult(null, responseVoid, null));
  3257. return;
  3258. }
  3259. return;
  3260. case 1045:
  3261. unsljLogRet(response, responseVoid);
  3262. if (this.mLceInfoRegistrant != null) {
  3263. this.mLceInfoRegistrant.notifyRegistrant(new AsyncResult(null, responseVoid, null));
  3264. return;
  3265. }
  3266. return;
  3267. case 11001:
  3268. unsljLog(response);
  3269. if (this.mReleaseCompleteMessageRegistrant != null) {
  3270. this.mReleaseCompleteMessageRegistrant.notifyRegistrant(new AsyncResult(null, responseVoid, null));
  3271. return;
  3272. }
  3273. return;
  3274. case 11002:
  3275. unsljLogRet(response, responseVoid);
  3276. if (this.mCatSendSmsResultRegistrant != null) {
  3277. this.mCatSendSmsResultRegistrant.notifyRegistrant(new AsyncResult(null, responseVoid, null));
  3278. return;
  3279. }
  3280. return;
  3281. case 11003:
  3282. unsljLogRet(response, responseVoid);
  3283. if (this.mCatCallControlResultRegistrant != null) {
  3284. this.mCatCallControlResultRegistrant.notifyRegistrant(new AsyncResult(null, responseVoid, null));
  3285. return;
  3286. }
  3287. return;
  3288. case 11008:
  3289. unsljLog(response);
  3290. if (this.mSmsDeviceReadyRegistrant != null) {
  3291. this.mSmsDeviceReadyRegistrant.notifyRegistrant(new AsyncResult(null, responseVoid, null));
  3292. return;
  3293. }
  3294. return;
  3295. case 11010:
  3296. String str = responseVoid;
  3297. Rlog.d(RILJ_LOG_TAG, "Executing Am " + str);
  3298. Am.main(str.split(" "));
  3299. return;
  3300. case 11013:
  3301. unsljLogRet(response, responseVoid);
  3302. if (this.mSapRegistant != null) {
  3303. this.mSapRegistant.notifyRegistrant(new AsyncResult(null, responseVoid, null));
  3304. return;
  3305. }
  3306. return;
  3307. case 11021:
  3308. unsljLogRet(response, responseVoid);
  3309. if (this.mSimPbReadyRegistrant != null) {
  3310. this.mSimPbReadyRegistrant.notifyRegistrant(new AsyncResult(null, null, null));
  3311. return;
  3312. }
  3313. return;
  3314. case 11027:
  3315. unsljLogvRet(response, responseVoid);
  3316. if (this.mImsRegistrationStateChangedRegistrants != null) {
  3317. this.mImsRegistrationStateChangedRegistrants.notifyRegistrants(new AsyncResult(null, responseVoid, null));
  3318. return;
  3319. }
  3320. return;
  3321. case 11028:
  3322. unsljLogvRet(response, responseVoid);
  3323. if (this.mModifyCallRegistrants != null) {
  3324. this.mModifyCallRegistrants.notifyRegistrants(new AsyncResult(null, responseVoid, null));
  3325. return;
  3326. }
  3327. return;
  3328. case 11030:
  3329. unsljLogRet(response, responseVoid);
  3330. if (this.mCsFallbackRegistant != null) {
  3331. this.mCsFallbackRegistant.notifyRegistrant(new AsyncResult(null, responseVoid, null));
  3332. return;
  3333. }
  3334. return;
  3335. case 11032:
  3336. unsljLogvRet(response, responseVoid);
  3337. if (this.mVoiceSystemIdRegistrant != null) {
  3338. this.mVoiceSystemIdRegistrant.notifyRegistrant(new AsyncResult(null, responseVoid, null));
  3339. return;
  3340. }
  3341. return;
  3342. case 11034:
  3343. unsljLog(response);
  3344. Rlog.d(RILJ_LOG_TAG, "RIL_UNSOL_IMS_RETRYOVER");
  3345. if (this.mImsRegistrationRetryOver != null) {
  3346. this.mImsRegistrationRetryOver.notifyRegistrants(new AsyncResult(null, null, null));
  3347. return;
  3348. }
  3349. return;
  3350. case 11035:
  3351. unsljLogRet(response, responseVoid);
  3352. if (this.mPbInitCompleteRegistrant != null) {
  3353. this.mPbInitCompleteRegistrant.notifyRegistrant(new AsyncResult(null, null, null));
  3354. return;
  3355. }
  3356. return;
  3357. case 11037:
  3358. unsljLogRet(response, responseVoid);
  3359. if (this.mHysteresisDCNRegistant != null) {
  3360. this.mHysteresisDCNRegistant.notifyRegistrant(new AsyncResult(null, responseVoid, null));
  3361. return;
  3362. }
  3363. return;
  3364. case 11043:
  3365. unsljLog(response);
  3366. if (this.mHomeNetworkRegistant != null) {
  3367. this.mHomeNetworkRegistant.notifyRegistrant();
  3368. return;
  3369. }
  3370. return;
  3371. case 11054:
  3372. unsljLogRet(response, responseVoid);
  3373. if (this.mStkSetupCallStatus != null) {
  3374. this.mStkSetupCallStatus.notifyRegistrant(new AsyncResult(null, responseVoid, null));
  3375. return;
  3376. }
  3377. return;
  3378. case 11056:
  3379. unsljLogRet(response, responseVoid);
  3380. Rlog.d(RILJ_LOG_TAG, "UNSOL_MODEM_CAPABILITY = mInstanceId" + this.mInstanceId);
  3381. notifyModemCap((byte[]) responseVoid, this.mInstanceId);
  3382. return;
  3383. case 11057:
  3384. unsljLogRet(response, responseVoid);
  3385. Rlog.d(RILJ_LOG_TAG, "RIL_UNSOL_SIM_SWAP_STATE_CHANGED");
  3386. this.mSimSwapRegistrants.notifyRegistrants(new AsyncResult(null, responseVoid, null));
  3387. return;
  3388. case 11058:
  3389. unsljLogRet(response, responseVoid);
  3390. Rlog.d(RILJ_LOG_TAG, "RIL_UNSOL_SIM_COUNT_MISMATCHED");
  3391. this.mSimCountMismatchRegistrants.notifyRegistrants(new AsyncResult(null, responseVoid, null));
  3392. return;
  3393. case 11060:
  3394. unsljLogRet(response, responseVoid);
  3395. if (this.mDunStateChangedRegistrant == null) {
  3396. return;
  3397. }
  3398. return;
  3399. case 11061:
  3400. unsljLogRet(response, responseVoid);
  3401. if (this.mImsPrefNotiRegistrant != null) {
  3402. this.mImsPrefNotiRegistrant.notifyRegistrant(new AsyncResult(null, responseVoid, null));
  3403. return;
  3404. }
  3405. return;
  3406. case 11062:
  3407. unsljLogRet(response, responseVoid);
  3408. if (this.mIccAppRefreshRegistrant != null) {
  3409. this.mIccAppRefreshRegistrant.notifyRegistrant(new AsyncResult(null, responseVoid, null));
  3410. return;
  3411. }
  3412. return;
  3413. case 11064:
  3414. unsljLogRet(response, responseVoid);
  3415. Rlog.d(RILJ_LOG_TAG, "RIL_UNSOL_VOICE_RADIO_BEARER_HO_STATUS");
  3416. this.mVoiceRadioBearerHoStateRegistrant.notifyRegistrant(new AsyncResult(null, responseVoid, null));
  3417. return;
  3418. case 11066:
  3419. unsljLog(response);
  3420. if (this.mSimIccIdNotiRegistrants != null) {
  3421. this.mSimIccIdNotiRegistrants.notifyRegistrants(new AsyncResult(null, responseVoid, null));
  3422. return;
  3423. }
  3424. return;
  3425. default:
  3426. return;
  3427. }
  3428. }
  3429.  
  3430. private void notifyRegistrantsRilConnectionChanged(int rilVer) {
  3431. this.mRilVersion = rilVer;
  3432. if (this.mRilConnectedRegistrants != null) {
  3433. this.mRilConnectedRegistrants.notifyRegistrants(new AsyncResult(null, new Integer(rilVer), null));
  3434. }
  3435. }
  3436.  
  3437. private Object responseInts(Parcel p) {
  3438. int numInts = p.readInt();
  3439. int[] response = new int[numInts];
  3440. for (int i = 0; i < numInts; i++) {
  3441. response[i] = p.readInt();
  3442. }
  3443. return response;
  3444. }
  3445.  
  3446. private Object responseFailCause(Parcel p) {
  3447. LastCallFailCause failCause = new LastCallFailCause();
  3448. failCause.causeCode = p.readInt();
  3449. if (p.dataAvail() > 0) {
  3450. failCause.vendorCause = p.readString();
  3451. }
  3452. return failCause;
  3453. }
  3454.  
  3455. private Object responseVoid(Parcel p) {
  3456. return null;
  3457. }
  3458.  
  3459. private Object responseCallForward(Parcel p) {
  3460. int numInfos = p.readInt();
  3461. CallForwardInfo[] infos = new CallForwardInfo[numInfos];
  3462. for (int i = 0; i < numInfos; i++) {
  3463. infos[i] = new CallForwardInfo();
  3464. infos[i].status = p.readInt();
  3465. infos[i].reason = p.readInt();
  3466. infos[i].serviceClass = p.readInt();
  3467. infos[i].toa = p.readInt();
  3468. infos[i].number = p.readString();
  3469. infos[i].timeSeconds = p.readInt();
  3470. String startTime = p.readString();
  3471. CallForwardInfo callForwardInfo = infos[i];
  3472. if (startTime == null) {
  3473. startTime = "";
  3474. }
  3475. callForwardInfo.startTime = startTime;
  3476. String endTime = p.readString();
  3477. callForwardInfo = infos[i];
  3478. if (endTime == null) {
  3479. endTime = "";
  3480. }
  3481. callForwardInfo.endTime = endTime;
  3482. }
  3483. return infos;
  3484. }
  3485.  
  3486. private Object responseSuppServiceNotification(Parcel p) {
  3487. SuppServiceNotification notification = new SuppServiceNotification();
  3488. notification.notificationType = p.readInt();
  3489. notification.code = p.readInt();
  3490. notification.index = p.readInt();
  3491. notification.type = p.readInt();
  3492. notification.mtConference = 0;
  3493. if (CscFeature.getInstance().getEnableStatus("CscFeature_RIL_SupportVolte") && ((CscFeature.getInstance().getString("CscFeature_RIL_ConfigNetworkTypeCapability").startsWith("VZW-") || CscFeature.getInstance().getString("CscFeature_RIL_ConfigNetworkTypeCapability").startsWith("ATT-")) && notification.code == 3)) {
  3494. notification.mtConference = p.readInt();
  3495. }
  3496. notification.number = p.readString();
  3497. return notification;
  3498. }
  3499.  
  3500. private Object responseCdmaSms(Parcel p) {
  3501. return SmsMessage.newFromParcel(p);
  3502. }
  3503.  
  3504. private Object responseString(Parcel p) {
  3505. return p.readString();
  3506. }
  3507.  
  3508. private Object responseStrings(Parcel p) {
  3509. return p.readStringArray();
  3510. }
  3511.  
  3512. private Object responseRaw(Parcel p) {
  3513. return p.createByteArray();
  3514. }
  3515.  
  3516. private Object responseSMS(Parcel p) {
  3517. int messageRef = p.readInt();
  3518. String ackPDU = p.readString();
  3519. int errorCode = p.readInt();
  3520. if (CscFeature.getInstance().getEnableStatus("CscFeature_RIL_SmsErrorClassRetry")) {
  3521. return new SmsResponse(messageRef, ackPDU, errorCode, p.readInt());
  3522. }
  3523. return new SmsResponse(messageRef, ackPDU, errorCode);
  3524. }
  3525.  
  3526. private Object responseICC_IO(Parcel p) {
  3527. int sw1 = p.readInt();
  3528. int sw2 = p.readInt();
  3529. String s = p.readString();
  3530. String dbgMsg = "< iccIO: 0x" + Integer.toHexString(sw1) + " 0x" + Integer.toHexString(sw2) + " ";
  3531. if (!SHIP_BUILD) {
  3532. dbgMsg = dbgMsg + s;
  3533. }
  3534. return new IccIoResult(sw1, sw2, s);
  3535. }
  3536.  
  3537. private Object responseICC_IOBase64(Parcel p) {
  3538. int sw1 = p.readInt();
  3539. int sw2 = p.readInt();
  3540. String s = p.readString();
  3541. return new IccIoResult(sw1, sw2, s != null ? Base64.decode(s, 0) : (byte[]) null);
  3542. }
  3543.  
  3544. private Object responseIccCardStatus(Parcel p) {
  3545. IccCardStatus cardStatus = new IccCardStatus();
  3546. cardStatus.setCardState(p.readInt());
  3547. cardStatus.setUniversalPinState(p.readInt());
  3548. cardStatus.mGsmUmtsSubscriptionAppIndex = p.readInt();
  3549. cardStatus.mCdmaSubscriptionAppIndex = p.readInt();
  3550. cardStatus.mImsSubscriptionAppIndex = p.readInt();
  3551. int numApplications = p.readInt();
  3552. if (numApplications > 8) {
  3553. numApplications = 8;
  3554. }
  3555. cardStatus.mApplications = new IccCardApplicationStatus[numApplications];
  3556. for (int i = 0; i < numApplications; i++) {
  3557. IccCardApplicationStatus appStatus = new IccCardApplicationStatus();
  3558. appStatus.app_type = appStatus.AppTypeFromRILInt(p.readInt());
  3559. appStatus.app_state = appStatus.AppStateFromRILInt(p.readInt());
  3560. appStatus.perso_substate = appStatus.PersoSubstateFromRILInt(p.readInt());
  3561. appStatus.aid = p.readString();
  3562. appStatus.app_label = p.readString();
  3563. appStatus.pin1_replaced = p.readInt();
  3564. appStatus.pin1 = appStatus.PinStateFromRILInt(p.readInt());
  3565. appStatus.pin2 = appStatus.PinStateFromRILInt(p.readInt());
  3566. appStatus.pin1_num_retries = p.readInt();
  3567. appStatus.puk1_num_retries = p.readInt();
  3568. appStatus.pin2_num_retries = p.readInt();
  3569. appStatus.puk2_num_retries = p.readInt();
  3570. appStatus.perso_unblock_retries = p.readInt();
  3571. cardStatus.mApplications[i] = appStatus;
  3572. }
  3573. return cardStatus;
  3574. }
  3575.  
  3576. private Object responseSimRefresh(Parcel p) {
  3577. IccRefreshResponse response = new IccRefreshResponse();
  3578. response.refreshResult = p.readInt();
  3579. response.efId = p.readInt();
  3580. return response;
  3581. }
  3582.  
  3583. protected Object responseCallList(Parcel p) {
  3584. int num = p.readInt();
  3585. ArrayList<DriverCall> response = new ArrayList(num);
  3586. for (int i = 0; i < num; i++) {
  3587. boolean z;
  3588. DriverCall dc = new DriverCall();
  3589. dc.state = DriverCall.stateFromCLCC(p.readInt());
  3590. dc.index = p.readInt();
  3591. dc.id = (dc.index >> 8) & 255;
  3592. dc.index &= 255;
  3593. dc.TOA = p.readInt();
  3594. dc.isMpty = p.readInt() != 0;
  3595. dc.isMT = p.readInt() != 0;
  3596. dc.als = p.readInt();
  3597. if (p.readInt() == 0) {
  3598. z = false;
  3599. } else {
  3600. z = true;
  3601. }
  3602. dc.isVoice = z;
  3603. int type = p.readInt();
  3604. int domain = p.readInt();
  3605. String extras = p.readString();
  3606. dc.callDetails = new CallDetails(type, domain, null);
  3607. dc.callDetails.setExtrasFromCsv(extras);
  3608. Rlog.d(RILJ_LOG_TAG, "dc.index " + dc.index + " dc.id " + dc.id + " dc.callDetails " + dc.callDetails);
  3609. dc.isVoicePrivacy = p.readInt() != 0;
  3610. dc.number = p.readString();
  3611. dc.numberPresentation = DriverCall.presentationFromCLIP(p.readInt());
  3612. dc.name = p.readString();
  3613. Rlog.d(RILJ_LOG_TAG, "responseCallList dc.name" + dc.name);
  3614. dc.namePresentation = DriverCall.presentationFromCLIP(p.readInt());
  3615. if (p.readInt() == 1) {
  3616. dc.uusInfo = new UUSInfo();
  3617. dc.uusInfo.setType(p.readInt());
  3618. dc.uusInfo.setDcs(p.readInt());
  3619. dc.uusInfo.setUserData(p.createByteArray());
  3620. riljLogv(String.format("Incoming UUS : type=%d, dcs=%d, length=%d", new Object[]{Integer.valueOf(dc.uusInfo.getType()), Integer.valueOf(dc.uusInfo.getDcs()), Integer.valueOf(dc.uusInfo.getUserData().length)}));
  3621. riljLogv("Incoming UUS : data (string)=" + new String(dc.uusInfo.getUserData()));
  3622. riljLogv("Incoming UUS : data (hex): " + IccUtils.bytesToHexString(dc.uusInfo.getUserData()));
  3623. } else {
  3624. riljLogv("Incoming UUS : NOT present!");
  3625. }
  3626. dc.number = PhoneNumberUtils.stringFromStringAndTOA(dc.number, dc.TOA);
  3627. if (TelephonyFeature.alwaysTerminalbasedCW()) {
  3628. int cw;
  3629. if (this.mInstanceId.intValue() == 1) {
  3630. cw = System.getInt(this.mContext.getContentResolver(), "volte_call_waiting_slot2", 1);
  3631. } else {
  3632. cw = System.getInt(this.mContext.getContentResolver(), "volte_call_waiting", 1);
  3633. }
  3634. if (cw == 0) {
  3635. riljLogv("T/B_CALL_WAITING - hangupWaitingOrBackground");
  3636. if (dc.state == State.WAITING) {
  3637. hangupWaitingOrBackground(null);
  3638. break;
  3639. }
  3640. }
  3641. }
  3642. response.add(dc);
  3643. if (dc.isVoicePrivacy) {
  3644. this.mVoicePrivacyOnRegistrants.notifyRegistrants();
  3645. riljLog("InCall VoicePrivacy is enabled");
  3646. } else {
  3647. this.mVoicePrivacyOffRegistrants.notifyRegistrants();
  3648. riljLog("InCall VoicePrivacy is disabled");
  3649. }
  3650. }
  3651. Collections.sort(response);
  3652. if (num == 0 && this.mTestingEmergencyCall.getAndSet(false) && this.mEmergencyCallbackModeRegistrant != null) {
  3653. riljLog("responseCallList: call ended, testing emergency call, notify ECM Registrants");
  3654. this.mEmergencyCallbackModeRegistrant.notifyRegistrant();
  3655. }
  3656. return response;
  3657. }
  3658.  
  3659. private DataCallResponse getDataCallResponse(Parcel p, int version) {
  3660. DataCallResponse dataCall = new DataCallResponse();
  3661. dataCall.version = version;
  3662. String addresses;
  3663. if (version < 5) {
  3664. dataCall.cid = p.readInt();
  3665. dataCall.active = p.readInt();
  3666. dataCall.type = p.readString();
  3667. addresses = p.readString();
  3668. if (!TextUtils.isEmpty(addresses)) {
  3669. dataCall.addresses = addresses.split(" ");
  3670. }
  3671. } else {
  3672. dataCall.status = p.readInt();
  3673. dataCall.suggestedRetryTime = p.readInt();
  3674. dataCall.cid = p.readInt();
  3675. dataCall.active = p.readInt();
  3676. dataCall.type = p.readString();
  3677. dataCall.ifname = p.readString();
  3678. if (dataCall.status == DcFailCause.NONE.getErrorCode() && TextUtils.isEmpty(dataCall.ifname)) {
  3679. throw new RuntimeException("getDataCallResponse, no ifname");
  3680. }
  3681. addresses = p.readString();
  3682. if (!TextUtils.isEmpty(addresses)) {
  3683. dataCall.addresses = addresses.split(" ");
  3684. }
  3685. String dnses = p.readString();
  3686. if (!TextUtils.isEmpty(dnses)) {
  3687. dataCall.dnses = dnses.split(" ");
  3688. }
  3689. if (CscFeature.getInstance().getEnableStatus("CscFeature_RIL_ExtDevCdmaPacketAccessSupport") && dataCall.type.equals("IP")) {
  3690. dataCall.dnses = modifyDnsByCpa(dnses, dataCall.ifname).split(" ");
  3691. }
  3692. String gateways = p.readString();
  3693. if (!TextUtils.isEmpty(gateways)) {
  3694. dataCall.gateways = gateways.split(" ");
  3695. }
  3696. if (version >= 10) {
  3697. String pcscf = p.readString();
  3698. if (!TextUtils.isEmpty(pcscf)) {
  3699. dataCall.pcscf = pcscf.split(" ");
  3700. }
  3701. }
  3702. if (version >= 11) {
  3703. dataCall.mtu = p.readInt();
  3704. }
  3705. }
  3706. return dataCall;
  3707. }
  3708.  
  3709. private Object responseDataCallList(Parcel p) {
  3710. int ver = p.readInt();
  3711. int num = p.readInt();
  3712. riljLog("responseDataCallList ver=" + ver + " num=" + num);
  3713. ArrayList<DataCallResponse> response = new ArrayList(num);
  3714. for (int i = 0; i < num; i++) {
  3715. response.add(getDataCallResponse(p, ver));
  3716. }
  3717. return response;
  3718. }
  3719.  
  3720. protected Object responseSetupDataCall(Parcel p) {
  3721. int ver = p.readInt();
  3722. int num = p.readInt();
  3723. if (ver < 5) {
  3724. DataCallResponse dataCall = new DataCallResponse();
  3725. dataCall.version = ver;
  3726. dataCall.cid = Integer.parseInt(p.readString());
  3727. dataCall.ifname = p.readString();
  3728. if (TextUtils.isEmpty(dataCall.ifname)) {
  3729. throw new RuntimeException("RIL_REQUEST_SETUP_DATA_CALL response, no ifname");
  3730. }
  3731. String addresses = p.readString();
  3732. if (!TextUtils.isEmpty(addresses)) {
  3733. dataCall.addresses = addresses.split(" ");
  3734. }
  3735. if (num >= 4) {
  3736. String dnses = p.readString();
  3737. riljLog("responseSetupDataCall got dnses=" + dnses);
  3738. if (!TextUtils.isEmpty(dnses)) {
  3739. dataCall.dnses = dnses.split(" ");
  3740. }
  3741. }
  3742. if (num >= 5) {
  3743. String gateways = p.readString();
  3744. riljLog("responseSetupDataCall got gateways=" + gateways);
  3745. if (!TextUtils.isEmpty(gateways)) {
  3746. dataCall.gateways = gateways.split(" ");
  3747. }
  3748. }
  3749. if (num < 6) {
  3750. return dataCall;
  3751. }
  3752. String pcscf = p.readString();
  3753. riljLog("responseSetupDataCall got pcscf=" + pcscf);
  3754. if (TextUtils.isEmpty(pcscf)) {
  3755. return dataCall;
  3756. }
  3757. dataCall.pcscf = pcscf.split(" ");
  3758. return dataCall;
  3759. } else if (num == 1) {
  3760. return getDataCallResponse(p, ver);
  3761. } else {
  3762. throw new RuntimeException("RIL_REQUEST_SETUP_DATA_CALL response expecting 1 RIL_Data_Call_response_v5 got " + num);
  3763. }
  3764. }
  3765.  
  3766. private Object responseOperatorInfos(Parcel p) {
  3767. ArrayList<OperatorInfo> ret;
  3768. String[] strings = (String[]) responseStrings(p);
  3769. int i;
  3770. if (CscFeature.getInstance().getEnableStatus("CscFeature_RIL_NetworkInfoRat") || CscFeature.getInstance().getEnableStatus("CscFeature_RIL_UseRatInfoDuringPlmnSelection") || CscFeature.getInstance().getEnableStatus("CscFeature_RIL_OperatorNameRuleForDcm") || CscFeature.getInstance().getEnableStatus("CscFeature_RIL_DisplayRatInfoInManualNetSearchList")) {
  3771. if (strings.length % 6 != 0) {
  3772. throw new RuntimeException("RIL_REQUEST_QUERY_AVAILABLE_NETWORKS: invalid response. Got " + strings.length + " strings, expected multible of 6");
  3773. }
  3774. ret = new ArrayList(strings.length / 6);
  3775. for (i = 0; i < strings.length; i += 6) {
  3776. ret.add(new OperatorInfo(strings[i + 0], strings[i + 1], strings[i + 2], strings[i + 3], strings[i + 4], strings[i + 5]));
  3777. Rlog.d(RILJ_LOG_TAG, "Add OperatorInfo is:" + strings[i + 0] + " " + strings[i + 1] + " " + strings[i + 2] + " " + strings[i + 3] + " " + strings[i + 4] + " " + strings[i + 5] + " ");
  3778. }
  3779. } else if (strings.length % 6 != 0) {
  3780. throw new RuntimeException("RIL_REQUEST_QUERY_AVAILABLE_NETWORKS: invalid response. Got " + strings.length + " strings, expected multible of 6");
  3781. } else {
  3782. ret = new ArrayList(strings.length / 6);
  3783. Set<String> mccmnc = new HashSet(strings.length / 6);
  3784. String sim_numeric = TelephonyManager.getTelephonyProperty(this.mInstanceId.intValue(), "gsm.sim.operator.numeric", "");
  3785. String spn = TelephonyManager.getTelephonyProperty(this.mInstanceId.intValue(), "gsm.sim.operator.alpha", "");
  3786. String isRoaming = TelephonyManager.getTelephonyProperty(this.mInstanceId.intValue(), "gsm.operator.isroaming", "");
  3787. i = 0;
  3788. while (i < strings.length) {
  3789. if (!mccmnc.contains(strings[i + 2])) {
  3790. mccmnc.add(strings[i + 2]);
  3791. if ("45400".equals(strings[i + 2]) || "45402".equals(strings[i + 2]) || "45410".equals(strings[i + 2]) || ("45418".equals(strings[i + 2]) && "false".equals(isRoaming))) {
  3792. Rlog.d(RILJ_LOG_TAG, "CSL Network, SPN sholud be displayed instead of PLMN : " + sim_numeric + "SPN : " + spn);
  3793. if ("45400".equals(sim_numeric) || "45402".equals(sim_numeric) || "45410".equals(sim_numeric) || "45418".equals(sim_numeric)) {
  3794. strings[i + 0] = spn;
  3795. strings[i + 1] = strings[i + 0];
  3796. }
  3797. }
  3798. if ("45416".equals(strings[i + 2]) || ("45419".equals(strings[i + 2]) && "false".equals(isRoaming))) {
  3799. Rlog.d(RILJ_LOG_TAG, "PCCW-HKT Network, SPN sholud be displayed instead of PLMN : " + sim_numeric + "SPN : " + spn);
  3800. if ("45416".equals(sim_numeric) || "45419".equals(sim_numeric)) {
  3801. strings[i + 0] = spn;
  3802. strings[i + 1] = strings[i + 0];
  3803. }
  3804. }
  3805. if ("46697".equals(strings[i + 2]) && "false".equals(isRoaming)) {
  3806. Rlog.d(RILJ_LOG_TAG, "APT Network, SPN sholud be displayed instead of PLMN : " + sim_numeric + "SPN : " + spn);
  3807. if ("46605".equals(sim_numeric)) {
  3808. strings[i + 0] = spn;
  3809. strings[i + 1] = strings[i + 0];
  3810. }
  3811. }
  3812. ret.add(new OperatorInfo(strings[i + 0], strings[i + 1], strings[i + 2], strings[i + 3], strings[i + 4], strings[i + 5]));
  3813. Rlog.d(RILJ_LOG_TAG, "Add OperatorInfo is:" + strings[i + 0] + " " + strings[i + 1] + " " + strings[i + 2] + " " + strings[i + 3] + " " + strings[i + 4] + " " + strings[i + 5] + " ");
  3814. }
  3815. i += 6;
  3816. }
  3817. }
  3818. return ret;
  3819. }
  3820.  
  3821. private Object responseCellList(Parcel p) {
  3822. int num = p.readInt();
  3823. ArrayList<NeighboringCellInfo> response = new ArrayList();
  3824. int radioType = ((TelephonyManager) this.mContext.getSystemService("phone")).getDataNetworkType(SubscriptionManager.getSubId(this.mInstanceId.intValue())[0]);
  3825. if (radioType != 0) {
  3826. for (int i = 0; i < num; i++) {
  3827. response.add(new NeighboringCellInfo(p.readInt(), p.readString(), radioType));
  3828. }
  3829. }
  3830. return response;
  3831. }
  3832.  
  3833. private Object responseGetPreferredNetworkType(Parcel p) {
  3834. int[] response = (int[]) responseInts(p);
  3835. if (response.length >= 1) {
  3836. this.mPreferredNetworkType = response[0];
  3837. setInitialPhoneType(this.mPreferredNetworkType);
  3838. }
  3839. return response;
  3840. }
  3841.  
  3842. private Object responseGmsBroadcastConfig(Parcel p) {
  3843. int num = p.readInt();
  3844. ArrayList<SmsBroadcastConfigInfo> response = new ArrayList(num);
  3845. for (int i = 0; i < num; i++) {
  3846. response.add(new SmsBroadcastConfigInfo(p.readInt(), p.readInt(), p.readInt(), p.readInt(), p.readInt() == 1));
  3847. }
  3848. return response;
  3849. }
  3850.  
  3851. private Object responseCdmaBroadcastConfig(Parcel p) {
  3852. int[] response;
  3853. int numServiceCategories = p.readInt();
  3854. int i;
  3855. if (numServiceCategories == 0) {
  3856. response = new int[94];
  3857. response[0] = 31;
  3858. for (i = 1; i < 94; i += 3) {
  3859. response[i + 0] = i / 3;
  3860. response[i + 1] = 1;
  3861. response[i + 2] = 0;
  3862. }
  3863. } else {
  3864. int numInts = (numServiceCategories * 3) + 1;
  3865. response = new int[numInts];
  3866. response[0] = numServiceCategories;
  3867. for (i = 1; i < numInts; i++) {
  3868. response[i] = p.readInt();
  3869. }
  3870. }
  3871. return response;
  3872. }
  3873.  
  3874. private Object responseSignalStrength(Parcel p) {
  3875. return SignalStrength.makeSignalStrengthFromRilParcel(p);
  3876. }
  3877.  
  3878. private ArrayList<CdmaInformationRecords> responseCdmaInformationRecord(Parcel p) {
  3879. int numberOfInfoRecs = p.readInt();
  3880. ArrayList<CdmaInformationRecords> response = new ArrayList(numberOfInfoRecs);
  3881. for (int i = 0; i < numberOfInfoRecs; i++) {
  3882. response.add(new CdmaInformationRecords(p));
  3883. }
  3884. return response;
  3885. }
  3886.  
  3887. protected Object responseCdmaCallWaiting(Parcel p) {
  3888. CdmaCallWaitingNotification notification = new CdmaCallWaitingNotification();
  3889. notification.number = p.readString();
  3890. notification.numberPresentation = CdmaCallWaitingNotification.presentationFromCLIP(p.readInt());
  3891. notification.name = p.readString();
  3892. notification.namePresentation = notification.numberPresentation;
  3893. notification.isPresent = p.readInt();
  3894. notification.signalType = p.readInt();
  3895. notification.alertPitch = p.readInt();
  3896. notification.signal = p.readInt();
  3897. notification.numberType = p.readInt();
  3898. notification.numberPlan = p.readInt();
  3899. return notification;
  3900. }
  3901.  
  3902. private Object responseCallRing(Parcel p) {
  3903. return new char[]{(char) p.readInt(), (char) p.readInt(), (char) p.readInt(), (char) p.readInt()};
  3904. }
  3905.  
  3906. private void notifyRegistrantsCdmaInfoRec(CdmaInformationRecords infoRec) {
  3907. if (infoRec.record instanceof CdmaDisplayInfoRec) {
  3908. if (this.mDisplayInfoRegistrants != null) {
  3909. unsljLogRet(1027, infoRec.record);
  3910. this.mDisplayInfoRegistrants.notifyRegistrants(new AsyncResult(null, infoRec.record, null));
  3911. }
  3912. } else if (infoRec.record instanceof CdmaSignalInfoRec) {
  3913. if (this.mSignalInfoRegistrants != null) {
  3914. unsljLogRet(1027, infoRec.record);
  3915. this.mSignalInfoRegistrants.notifyRegistrants(new AsyncResult(null, infoRec.record, null));
  3916. }
  3917. } else if (infoRec.record instanceof CdmaNumberInfoRec) {
  3918. if (this.mNumberInfoRegistrants != null) {
  3919. unsljLogRet(1027, infoRec.record);
  3920. this.mNumberInfoRegistrants.notifyRegistrants(new AsyncResult(null, infoRec.record, null));
  3921. }
  3922. } else if (infoRec.record instanceof CdmaRedirectingNumberInfoRec) {
  3923. if (this.mRedirNumInfoRegistrants != null) {
  3924. unsljLogRet(1027, infoRec.record);
  3925. this.mRedirNumInfoRegistrants.notifyRegistrants(new AsyncResult(null, infoRec.record, null));
  3926. }
  3927. } else if (infoRec.record instanceof CdmaLineControlInfoRec) {
  3928. if (this.mLineControlInfoRegistrants != null) {
  3929. unsljLogRet(1027, infoRec.record);
  3930. this.mLineControlInfoRegistrants.notifyRegistrants(new AsyncResult(null, infoRec.record, null));
  3931. }
  3932. } else if (infoRec.record instanceof CdmaT53ClirInfoRec) {
  3933. if (this.mT53ClirInfoRegistrants != null) {
  3934. unsljLogRet(1027, infoRec.record);
  3935. this.mT53ClirInfoRegistrants.notifyRegistrants(new AsyncResult(null, infoRec.record, null));
  3936. }
  3937. } else if ((infoRec.record instanceof CdmaT53AudioControlInfoRec) && this.mT53AudCntrlInfoRegistrants != null) {
  3938. unsljLogRet(1027, infoRec.record);
  3939. this.mT53AudCntrlInfoRegistrants.notifyRegistrants(new AsyncResult(null, infoRec.record, null));
  3940. }
  3941. }
  3942.  
  3943. private ArrayList<CellInfo> responseCellInfoList(Parcel p) {
  3944. int numberOfInfoRecs = p.readInt();
  3945. ArrayList<CellInfo> response = new ArrayList(numberOfInfoRecs);
  3946. for (int i = 0; i < numberOfInfoRecs; i++) {
  3947. response.add((CellInfo) CellInfo.CREATOR.createFromParcel(p));
  3948. }
  3949. return response;
  3950. }
  3951.  
  3952. private Object responseHardwareConfig(Parcel p) {
  3953. int num = p.readInt();
  3954. ArrayList<HardwareConfig> response = new ArrayList(num);
  3955. for (int i = 0; i < num; i++) {
  3956. HardwareConfig hw;
  3957. int type = p.readInt();
  3958. switch (type) {
  3959. case 0:
  3960. hw = new HardwareConfig(type);
  3961. hw.assignModem(p.readString(), p.readInt(), p.readInt(), p.readInt(), p.readInt(), p.readInt(), p.readInt());
  3962. break;
  3963. case 1:
  3964. hw = new HardwareConfig(type);
  3965. hw.assignSim(p.readString(), p.readInt(), p.readString());
  3966. break;
  3967. default:
  3968. throw new RuntimeException("RIL_REQUEST_GET_HARDWARE_CONFIG invalid hardward type:" + type);
  3969. }
  3970. response.add(hw);
  3971. }
  3972. return response;
  3973. }
  3974.  
  3975. private Object responseRadioCapability(Parcel p) {
  3976. int version = p.readInt();
  3977. int session = p.readInt();
  3978. int phase = p.readInt();
  3979. int rat = p.readInt();
  3980. String logicModemUuid = p.readString();
  3981. int status = p.readInt();
  3982. riljLog("responseRadioCapability: version= " + version + ", session=" + session + ", phase=" + phase + ", rat=" + rat + ", logicModemUuid=" + logicModemUuid + ", status=" + status);
  3983. return new RadioCapability(this.mInstanceId.intValue(), session, phase, rat, logicModemUuid, status);
  3984. }
  3985.  
  3986. private Object responseLceData(Parcel p) {
  3987. ArrayList<Integer> capacityResponse = new ArrayList();
  3988. int capacityDownKbps = p.readInt();
  3989. int confidenceLevel = p.readByte();
  3990. int lceSuspended = p.readByte();
  3991. riljLog("LCE capacity information received: capacity=" + capacityDownKbps + " confidence=" + confidenceLevel + " lceSuspended=" + lceSuspended);
  3992. capacityResponse.add(Integer.valueOf(capacityDownKbps));
  3993. capacityResponse.add(Integer.valueOf(confidenceLevel));
  3994. capacityResponse.add(Integer.valueOf(lceSuspended));
  3995. return capacityResponse;
  3996. }
  3997.  
  3998. private Object responseLceStatus(Parcel p) {
  3999. ArrayList<Integer> statusResponse = new ArrayList();
  4000. int lceStatus = p.readByte();
  4001. int actualInterval = p.readInt();
  4002. riljLog("LCE status information received: lceStatus=" + lceStatus + " actualInterval=" + actualInterval);
  4003. statusResponse.add(Integer.valueOf(lceStatus));
  4004. statusResponse.add(Integer.valueOf(actualInterval));
  4005. return statusResponse;
  4006. }
  4007.  
  4008. private Object responseActivityData(Parcel p) {
  4009. int sleepModeTimeMs = p.readInt();
  4010. int idleModeTimeMs = p.readInt();
  4011. int[] txModeTimeMs = new int[5];
  4012. for (int i = 0; i < 5; i++) {
  4013. txModeTimeMs[i] = p.readInt();
  4014. }
  4015. int rxModeTimeMs = p.readInt();
  4016. riljLog("Modem activity info received: sleepModeTimeMs=" + sleepModeTimeMs + " idleModeTimeMs=" + idleModeTimeMs + " txModeTimeMs[]=" + Arrays.toString(txModeTimeMs) + " rxModeTimeMs=" + rxModeTimeMs);
  4017. return new ModemActivityInfo(SystemClock.elapsedRealtime(), sleepModeTimeMs, idleModeTimeMs, txModeTimeMs, rxModeTimeMs, 0);
  4018. }
  4019.  
  4020. private Object responseCbSettings(Parcel P) {
  4021. byte[] Cbmid_List;
  4022. int j = 0;
  4023. CbConfig cb = new CbConfig();
  4024. Rlog.d(RILJ_LOG_TAG, "responseCbSettings");
  4025. int Enabled = P.readInt();
  4026. if (Enabled == 1) {
  4027. cb.bCBEnabled = true;
  4028. } else if (Enabled == 2) {
  4029. cb.bCBEnabled = false;
  4030. }
  4031. cb.selectedId = (char) P.readInt();
  4032. cb.msgIdMaxCount = (char) P.readInt();
  4033. cb.msgIdCount = P.readInt();
  4034. if (cb.msgIdMaxCount > '\u0000') {
  4035. Cbmid_List = new byte[(cb.msgIdMaxCount * 2)];
  4036. } else {
  4037. Cbmid_List = new byte[100];
  4038. }
  4039. if (cb.msgIdCount > 100) {
  4040. Rlog.d(RILJ_LOG_TAG, "No of CBMID Exceeded ");
  4041. }
  4042. cb.msgIDs = new short[cb.msgIdCount];
  4043. String Cbmid_Str = P.readString();
  4044. Rlog.d(RILJ_LOG_TAG, "ENABLED:" + cb.bCBEnabled + ", selectedId:" + cb.selectedId + ", msgIdCount:" + cb.msgIdCount + ", msgIdMaxCount:" + cb.msgIdMaxCount);
  4045. if (Cbmid_Str == null) {
  4046. Rlog.d(RILJ_LOG_TAG, "MessageIDs String is NULL");
  4047. } else {
  4048. Rlog.d(RILJ_LOG_TAG, ", MessageIDs:" + Cbmid_Str);
  4049. Cbmid_List = IccUtils.hexStringToBytes(Cbmid_Str);
  4050. for (int i = 0; i < cb.msgIdCount; i++) {
  4051. int msb = Cbmid_List[j + 1] & 255;
  4052. cb.msgIDs[i] = (short) (((Cbmid_List[j] & 255) << 8) | msb);
  4053. j += 2;
  4054. }
  4055. }
  4056. return cb;
  4057. }
  4058.  
  4059. private Object responseCallModify(Parcel p) {
  4060. CallModify response = new CallModify();
  4061. response.call_index = p.readInt();
  4062. int type = p.readInt();
  4063. int domain = p.readInt();
  4064. String extras = p.readString();
  4065. response.call_details = new CallDetails(type, domain, null);
  4066. response.call_details.setExtrasFromCsv(extras);
  4067. return response;
  4068. }
  4069.  
  4070. private Object responsePreferredNetworkList(Parcel p) {
  4071. int num = p.readInt();
  4072. Rlog.d(RILJ_LOG_TAG, "number of network list = " + num);
  4073. ArrayList<PreferredNetworkListInfo> response = new ArrayList(num);
  4074. for (int i = 0; i < num; i++) {
  4075. PreferredNetworkListInfo preferredNetwork = new PreferredNetworkListInfo();
  4076. preferredNetwork.mIndex = p.readInt();
  4077. preferredNetwork.mOperator = p.readString();
  4078. preferredNetwork.mPlmn = p.readString();
  4079. preferredNetwork.mGsmAct = p.readInt();
  4080. preferredNetwork.mGsmCompactAct = p.readInt();
  4081. preferredNetwork.mUtranAct = p.readInt();
  4082. preferredNetwork.mMode = p.readInt();
  4083. response.add(preferredNetwork);
  4084. }
  4085. return response;
  4086. }
  4087.  
  4088. static String requestToString(int request) {
  4089. switch (request) {
  4090. case 1:
  4091. return "GET_SIM_STATUS";
  4092. case 2:
  4093. return "ENTER_SIM_PIN";
  4094. case 3:
  4095. return "ENTER_SIM_PUK";
  4096. case 4:
  4097. return "ENTER_SIM_PIN2";
  4098. case 5:
  4099. return "ENTER_SIM_PUK2";
  4100. case 6:
  4101. return "CHANGE_SIM_PIN";
  4102. case 7:
  4103. return "CHANGE_SIM_PIN2";
  4104. case 8:
  4105. return "ENTER_NETWORK_DEPERSONALIZATION";
  4106. case 9:
  4107. return "GET_CURRENT_CALLS";
  4108. case 10:
  4109. return "DIAL";
  4110. case 11:
  4111. return "GET_IMSI";
  4112. case 12:
  4113. return "HANGUP";
  4114. case 13:
  4115. return "HANGUP_WAITING_OR_BACKGROUND";
  4116. case 14:
  4117. return "HANGUP_FOREGROUND_RESUME_BACKGROUND";
  4118. case 15:
  4119. return "REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE";
  4120. case 16:
  4121. return "CONFERENCE";
  4122. case 17:
  4123. return "UDUB";
  4124. case 18:
  4125. return "LAST_CALL_FAIL_CAUSE";
  4126. case 19:
  4127. return "SIGNAL_STRENGTH";
  4128. case 20:
  4129. return "VOICE_REGISTRATION_STATE";
  4130. case 21:
  4131. return "DATA_REGISTRATION_STATE";
  4132. case 22:
  4133. return "OPERATOR";
  4134. case 23:
  4135. return "RADIO_POWER";
  4136. case 24:
  4137. return "DTMF";
  4138. case 25:
  4139. return "SEND_SMS";
  4140. case 26:
  4141. return "SEND_SMS_EXPECT_MORE";
  4142. case WspTypeDecoder.WSP_HEADER_IF_UNMODIFIED_SINCE /*27*/:
  4143. return "SETUP_DATA_CALL";
  4144. case WspTypeDecoder.WSP_HEADER_LOCATION /*28*/:
  4145. return "SIM_IO";
  4146. case WspTypeDecoder.WSP_HEADER_LAST_MODIFIED /*29*/:
  4147. return "SEND_USSD";
  4148. case 30:
  4149. return "CANCEL_USSD";
  4150. case 31:
  4151. return "GET_CLIR";
  4152. case 32:
  4153. return "SET_CLIR";
  4154. case 33:
  4155. return "QUERY_CALL_FORWARD_STATUS";
  4156. case 34:
  4157. return "SET_CALL_FORWARD";
  4158. case 35:
  4159. return "QUERY_CALL_WAITING";
  4160. case 36:
  4161. return "SET_CALL_WAITING";
  4162. case 37:
  4163. return "SMS_ACKNOWLEDGE";
  4164. case 38:
  4165. return "GET_IMEI";
  4166. case 39:
  4167. return "GET_IMEISV";
  4168. case 40:
  4169. return "ANSWER";
  4170. case 41:
  4171. return "DEACTIVATE_DATA_CALL";
  4172. case 42:
  4173. return "QUERY_FACILITY_LOCK";
  4174. case 43:
  4175. return "SET_FACILITY_LOCK";
  4176. case 44:
  4177. return "CHANGE_BARRING_PASSWORD";
  4178. case WspTypeDecoder.WSP_HEADER_WWW_AUTHENTICATE /*45*/:
  4179. return "QUERY_NETWORK_SELECTION_MODE";
  4180. case 46:
  4181. return "SET_NETWORK_SELECTION_AUTOMATIC";
  4182. case 47:
  4183. return "SET_NETWORK_SELECTION_MANUAL";
  4184. case 48:
  4185. return "QUERY_AVAILABLE_NETWORKS ";
  4186. case 49:
  4187. return "DTMF_START";
  4188. case 50:
  4189. return "DTMF_STOP";
  4190. case 51:
  4191. return "BASEBAND_VERSION";
  4192. case 52:
  4193. return "SEPARATE_CONNECTION";
  4194. case 53:
  4195. return "SET_MUTE";
  4196. case 54:
  4197. return "GET_MUTE";
  4198. case 55:
  4199. return "QUERY_CLIP";
  4200. case 56:
  4201. return "LAST_DATA_CALL_FAIL_CAUSE";
  4202. case 57:
  4203. return "DATA_CALL_LIST";
  4204. case 58:
  4205. return "RESET_RADIO";
  4206. case 59:
  4207. return "OEM_HOOK_RAW";
  4208. case WspTypeDecoder.WSP_HEADER_ACCEPT_ENCODING2 /*60*/:
  4209. return "OEM_HOOK_STRINGS";
  4210. case WspTypeDecoder.WSP_HEADER_CACHE_CONTROL2 /*61*/:
  4211. return "SCREEN_STATE";
  4212. case 62:
  4213. return "SET_SUPP_SVC_NOTIFICATION";
  4214. case 63:
  4215. return "WRITE_SMS_TO_SIM";
  4216. case 64:
  4217. return "DELETE_SMS_ON_SIM";
  4218. case 65:
  4219. return "SET_BAND_MODE";
  4220. case 66:
  4221. return "QUERY_AVAILABLE_BAND_MODE";
  4222. case 67:
  4223. return "REQUEST_STK_GET_PROFILE";
  4224. case 68:
  4225. return "REQUEST_STK_SET_PROFILE";
  4226. case WspTypeDecoder.WSP_HEADER_CONTENT_DISPOSITION2 /*69*/:
  4227. return "REQUEST_STK_SEND_ENVELOPE_COMMAND";
  4228. case 70:
  4229. return "REQUEST_STK_SEND_TERMINAL_RESPONSE";
  4230. case 71:
  4231. return "REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM";
  4232. case 72:
  4233. return "REQUEST_EXPLICIT_CALL_TRANSFER";
  4234. case 73:
  4235. return "REQUEST_SET_PREFERRED_NETWORK_TYPE";
  4236. case 74:
  4237. return "REQUEST_GET_PREFERRED_NETWORK_TYPE";
  4238. case 75:
  4239. return "REQUEST_GET_NEIGHBORING_CELL_IDS";
  4240. case RadioNVItems.RIL_NV_LTE_SCAN_PRIORITY_41 /*76*/:
  4241. return "REQUEST_SET_LOCATION_UPDATES";
  4242. case RadioNVItems.RIL_NV_LTE_HIDDEN_BAND_PRIORITY_25 /*77*/:
  4243. return "RIL_REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE";
  4244. case 78:
  4245. return "RIL_REQUEST_CDMA_SET_ROAMING_PREFERENCE";
  4246. case RadioNVItems.RIL_NV_LTE_HIDDEN_BAND_PRIORITY_41 /*79*/:
  4247. return "RIL_REQUEST_CDMA_QUERY_ROAMING_PREFERENCE";
  4248. case RadioNVItems.RIL_NV_LTE_NEXT_SCAN /*80*/:
  4249. return "RIL_REQUEST_SET_TTY_MODE";
  4250. case 81:
  4251. return "RIL_REQUEST_QUERY_TTY_MODE";
  4252. case RadioNVItems.RIL_NV_LTE_BSR_MAX_TIME /*82*/:
  4253. return "RIL_REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE";
  4254. case 83:
  4255. return "RIL_REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE";
  4256. case 84:
  4257. return "RIL_REQUEST_CDMA_FLASH";
  4258. case 85:
  4259. return "RIL_REQUEST_CDMA_BURST_DTMF";
  4260. case 86:
  4261. return "RIL_REQUEST_CDMA_VALIDATE_AND_WRITE_AKEY";
  4262. case 87:
  4263. return "RIL_REQUEST_CDMA_SEND_SMS";
  4264. case 88:
  4265. return "RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE";
  4266. case 89:
  4267. return "RIL_REQUEST_GSM_GET_BROADCAST_CONFIG";
  4268. case 90:
  4269. return "RIL_REQUEST_GSM_SET_BROADCAST_CONFIG";
  4270. case 91:
  4271. return "RIL_REQUEST_GSM_BROADCAST_ACTIVATION";
  4272. case 92:
  4273. return "RIL_REQUEST_CDMA_GET_BROADCAST_CONFIG";
  4274. case 93:
  4275. return "RIL_REQUEST_CDMA_SET_BROADCAST_CONFIG";
  4276. case 94:
  4277. return "RIL_REQUEST_CDMA_BROADCAST_ACTIVATION";
  4278. case 95:
  4279. return "RIL_REQUEST_CDMA_SUBSCRIPTION";
  4280. case CommandsInterface.CDMA_SMS_FAIL_CAUSE_ENCODING_PROBLEM /*96*/:
  4281. return "RIL_REQUEST_CDMA_WRITE_SMS_TO_RUIM";
  4282. case OEM_NET_GET_MODEM_CAP /*97*/:
  4283. return "RIL_REQUEST_CDMA_DELETE_SMS_ON_RUIM";
  4284. case OEM_NET_UPDATE_SUB_BINDING /*98*/:
  4285. return "RIL_REQUEST_DEVICE_IDENTITY";
  4286. case 99:
  4287. return "REQUEST_EXIT_EMERGENCY_CALLBACK_MODE";
  4288. case 100:
  4289. return "RIL_REQUEST_GET_SMSC_ADDRESS";
  4290. case Threads.ALERT_EXTREME_THREAD /*101*/:
  4291. return "RIL_REQUEST_SET_SMSC_ADDRESS";
  4292. case Threads.ALERT_SEVERE_THREAD /*102*/:
  4293. return "RIL_REQUEST_REPORT_SMS_MEMORY_STATUS";
  4294. case Threads.ALERT_AMBER_THREAD /*103*/:
  4295. return "RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING";
  4296. case Threads.ALERT_TEST_MESSAGE_THREAD /*104*/:
  4297. return "RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE";
  4298. case 105:
  4299. return "RIL_REQUEST_ISIM_AUTHENTICATION";
  4300. case 106:
  4301. return "RIL_REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU";
  4302. case 107:
  4303. return "RIL_REQUEST_STK_SEND_ENVELOPE_WITH_STATUS";
  4304. case 108:
  4305. return "RIL_REQUEST_VOICE_RADIO_TECH";
  4306. case 109:
  4307. return "RIL_REQUEST_GET_CELL_INFO_LIST";
  4308. case Threads.ALERTS_ALL_ONE_THREAD /*110*/:
  4309. return "RIL_REQUEST_SET_CELL_INFO_LIST_RATE";
  4310. case 111:
  4311. return "RIL_REQUEST_SET_INITIAL_ATTACH_APN";
  4312. case 112:
  4313. return "RIL_REQUEST_IMS_REGISTRATION_STATE";
  4314. case 113:
  4315. return "RIL_REQUEST_IMS_SEND_SMS";
  4316. case CallFailCause.KTF_FAIL_CAUSE_114 /*114*/:
  4317. return "RIL_REQUEST_SIM_TRANSMIT_APDU_BASIC";
  4318. case CallFailCause.KTF_FAIL_CAUSE_115 /*115*/:
  4319. return "RIL_REQUEST_SIM_OPEN_CHANNEL";
  4320. case CallFailCause.KTF_FAIL_CAUSE_116 /*116*/:
  4321. return "RIL_REQUEST_SIM_CLOSE_CHANNEL";
  4322. case 117:
  4323. return "RIL_REQUEST_SIM_TRANSMIT_APDU_CHANNEL";
  4324. case 118:
  4325. return "RIL_REQUEST_NV_READ_ITEM";
  4326. case 119:
  4327. return "RIL_REQUEST_NV_WRITE_ITEM";
  4328. case 120:
  4329. return "RIL_REQUEST_NV_WRITE_CDMA_PRL";
  4330. case 121:
  4331. return "RIL_REQUEST_NV_RESET_CONFIG";
  4332. case 122:
  4333. return "RIL_REQUEST_SET_UICC_SUBSCRIPTION";
  4334. case 123:
  4335. return "RIL_REQUEST_ALLOW_DATA";
  4336. case 124:
  4337. return "GET_HARDWARE_CONFIG";
  4338. case 125:
  4339. return "RIL_REQUEST_SIM_AUTHENTICATION";
  4340. case 128:
  4341. return "RIL_REQUEST_SET_DATA_PROFILE";
  4342. case 129:
  4343. return "RIL_REQUEST_SHUTDOWN";
  4344. case 130:
  4345. return "RIL_REQUEST_GET_RADIO_CAPABILITY";
  4346. case 131:
  4347. return "RIL_REQUEST_SET_RADIO_CAPABILITY";
  4348. case 132:
  4349. return "RIL_REQUEST_START_LCE";
  4350. case 133:
  4351. return "RIL_REQUEST_STOP_LCE";
  4352. case 134:
  4353. return "RIL_REQUEST_PULL_LCEDATA";
  4354. case 135:
  4355. return "RIL_REQUEST_GET_ACTIVITY_INFO";
  4356. case 10001:
  4357. return "DIAL_EMERGENCY_CALL";
  4358. case 10002:
  4359. return "CALL_DEFLECTION";
  4360. case 10003:
  4361. return "MODIFY_CALL_INITIATE";
  4362. case 10004:
  4363. return "MODIFY_CALL_CONFIRM";
  4364. case 10005:
  4365. return "SET_VOICE_DOMAIN_PREF";
  4366. case 10006:
  4367. return "SAFE_MODE";
  4368. case 10007:
  4369. return "SET_TRANSMIT_POWER";
  4370. case 10008:
  4371. return "GET_CELL_BROADCAST_CONFIG";
  4372. case 10009:
  4373. return "GET_PHONEBOOK_STORAGE_INFO";
  4374. case 10010:
  4375. return "GET_PHONEBOOK_ENTRY";
  4376. case 10011:
  4377. return "ACCESS_PHONEBOOK_ENTRY";
  4378. case 10012:
  4379. return "USIM_PB_CAPA";
  4380. case 10013:
  4381. return "LOCK_INFO";
  4382. case 10014:
  4383. return "STK_SIM_INIT_EVENT";
  4384. case 10015:
  4385. return "SET_PREFERRED_NETWORK_LIST";
  4386. case 10016:
  4387. return "GET_PREFERRED_NETWORK_LIST";
  4388. case 10017:
  4389. return "CHANGE_SIM_PERSO";
  4390. case 10018:
  4391. return "ENTER_SIM_PERSO";
  4392. case 10019:
  4393. return "SEND_ENCODED_USSD";
  4394. case 10020:
  4395. return "CDMA_SEND_SMS_EXPECT_MORE";
  4396. case 10021:
  4397. return "HANGUP_VT";
  4398. case 10022:
  4399. return "REQUEST_HOLD";
  4400. case 10023:
  4401. return "SET_SIM_POWER";
  4402. case 10025:
  4403. return "UICC_GBA_AUTHENTICATE_BOOTSTRAP";
  4404. case 10026:
  4405. return "UICC_GBA_AUTHENTICATE_NAF";
  4406. case 10027:
  4407. return "GET_INCOMING_COMMUNICATION_BARRING";
  4408. case 10028:
  4409. return "SET_INCOMING_COMMUNICATION_BARRING";
  4410. case 10029:
  4411. return "QUERY_CNAP";
  4412. case 10030:
  4413. return "SET_TRANSFER_CALL";
  4414. case 10031:
  4415. return "GET_DISABLE_2G";
  4416. case 10032:
  4417. return "SET_DISABLE_2G";
  4418. case 10033:
  4419. return "REFRESH_NITZ_TIME";
  4420. default:
  4421. return "<unknown request>";
  4422. }
  4423. }
  4424.  
  4425. static String responseToString(int request) {
  4426. switch (request) {
  4427. case 1000:
  4428. return "UNSOL_RESPONSE_RADIO_STATE_CHANGED";
  4429. case com.android.internal.telephony.cdma.CallFailCause.CDMA_DROP /*1001*/:
  4430. return "UNSOL_RESPONSE_CALL_STATE_CHANGED";
  4431. case com.android.internal.telephony.cdma.CallFailCause.CDMA_INTERCEPT /*1002*/:
  4432. return "UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED";
  4433. case com.android.internal.telephony.cdma.CallFailCause.CDMA_REORDER /*1003*/:
  4434. return "UNSOL_RESPONSE_NEW_SMS";
  4435. case com.android.internal.telephony.cdma.CallFailCause.CDMA_SO_REJECT /*1004*/:
  4436. return "UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT";
  4437. case com.android.internal.telephony.cdma.CallFailCause.CDMA_RETRY_ORDER /*1005*/:
  4438. return "UNSOL_RESPONSE_NEW_SMS_ON_SIM";
  4439. case com.android.internal.telephony.cdma.CallFailCause.CDMA_ACCESS_FAILURE /*1006*/:
  4440. return "UNSOL_ON_USSD";
  4441. case com.android.internal.telephony.cdma.CallFailCause.CDMA_PREEMPTED /*1007*/:
  4442. return "UNSOL_ON_USSD_REQUEST";
  4443. case com.android.internal.telephony.cdma.CallFailCause.CDMA_NOT_EMERGENCY /*1008*/:
  4444. return "UNSOL_NITZ_TIME_RECEIVED";
  4445. case 1009:
  4446. return "UNSOL_SIGNAL_STRENGTH";
  4447. case 1010:
  4448. return "UNSOL_DATA_CALL_LIST_CHANGED";
  4449. case 1011:
  4450. return "UNSOL_SUPP_SVC_NOTIFICATION";
  4451. case 1012:
  4452. return "UNSOL_STK_SESSION_END";
  4453. case 1013:
  4454. return "UNSOL_STK_PROACTIVE_COMMAND";
  4455. case 1014:
  4456. return "UNSOL_STK_EVENT_NOTIFY";
  4457. case CharacterSets.UTF_16 /*1015*/:
  4458. return "UNSOL_STK_CALL_SETUP";
  4459. case 1016:
  4460. return "UNSOL_SIM_SMS_STORAGE_FULL";
  4461. case 1017:
  4462. return "UNSOL_SIM_REFRESH";
  4463. case 1018:
  4464. return "UNSOL_CALL_RING";
  4465. case 1019:
  4466. return "UNSOL_RESPONSE_SIM_STATUS_CHANGED";
  4467. case 1020:
  4468. return "UNSOL_RESPONSE_CDMA_NEW_SMS";
  4469. case 1021:
  4470. return "UNSOL_RESPONSE_NEW_BROADCAST_SMS";
  4471. case 1022:
  4472. return "UNSOL_CDMA_RUIM_SMS_STORAGE_FULL";
  4473. case 1023:
  4474. return "UNSOL_RESTRICTED_STATE_CHANGED";
  4475. case 1024:
  4476. return "UNSOL_ENTER_EMERGENCY_CALLBACK_MODE";
  4477. case 1025:
  4478. return "UNSOL_CDMA_CALL_WAITING";
  4479. case 1026:
  4480. return "UNSOL_CDMA_OTA_PROVISION_STATUS";
  4481. case 1027:
  4482. return "UNSOL_CDMA_INFO_REC";
  4483. case 1028:
  4484. return "UNSOL_OEM_HOOK_RAW";
  4485. case 1029:
  4486. return "UNSOL_RINGBACK_TONE";
  4487. case 1030:
  4488. return "UNSOL_RESEND_INCALL_MUTE";
  4489. case 1031:
  4490. return "CDMA_SUBSCRIPTION_SOURCE_CHANGED";
  4491. case 1032:
  4492. return "UNSOL_CDMA_PRL_CHANGED";
  4493. case 1033:
  4494. return "UNSOL_EXIT_EMERGENCY_CALLBACK_MODE";
  4495. case 1034:
  4496. return "UNSOL_RIL_CONNECTED";
  4497. case 1035:
  4498. return "UNSOL_VOICE_RADIO_TECH_CHANGED";
  4499. case 1036:
  4500. return "UNSOL_CELL_INFO_LIST";
  4501. case 1037:
  4502. return "UNSOL_RESPONSE_IMS_NETWORK_STATE_CHANGED";
  4503. case 1038:
  4504. return "RIL_UNSOL_UICC_SUBSCRIPTION_STATUS_CHANGED";
  4505. case 1039:
  4506. return "UNSOL_SRVCC_STATE_NOTIFY";
  4507. case 1040:
  4508. return "RIL_UNSOL_HARDWARE_CONFIG_CHANGED";
  4509. case 1042:
  4510. return "RIL_UNSOL_RADIO_CAPABILITY";
  4511. case 1043:
  4512. return "UNSOL_ON_SS";
  4513. case 1044:
  4514. return "UNSOL_STK_CC_ALPHA_NOTIFY";
  4515. case 1045:
  4516. return "UNSOL_LCE_INFO_RECV";
  4517. case 11000:
  4518. return "UNSOL_RESPONSE_NEW_CB_MSG";
  4519. case 11001:
  4520. return "UNSOL_RELEASE_COMPLETE_MESSAGE";
  4521. case 11002:
  4522. return "UNSOL_STK_SEND_SMS_RESULT";
  4523. case 11003:
  4524. return "UNSOL_STK_CALL_CONTROL_RESULT";
  4525. case 11008:
  4526. return "UNSOL_DEVICE_READY_NOTI";
  4527. case 11009:
  4528. return "UNSOL_GPS_NOTI";
  4529. case 11010:
  4530. return "UNSOL_AM";
  4531. case 11013:
  4532. return "UNSOL_SAP";
  4533. case 11020:
  4534. return "UNSOL_UART";
  4535. case 11021:
  4536. return "UNSOL_SIM_PB_READY";
  4537. case 11024:
  4538. return "UNSOL_VE";
  4539. case 11026:
  4540. return "UNSOL_FACTORY_AM";
  4541. case 11027:
  4542. return "UNSOL_IMS_REGISTRATION_STATE_CHANGED";
  4543. case 11028:
  4544. return "UNSOL_MODIFY_CALL";
  4545. case 11030:
  4546. return "UNSOL_CS_FALLBACK";
  4547. case 11032:
  4548. return "UNSOL_VOICE_SYSTEM_ID";
  4549. case 11034:
  4550. return "UNSOL_IMS_RETRYOVER";
  4551. case 11035:
  4552. return "UNSOL_PB_INIT_COMPLETE";
  4553. case 11037:
  4554. return "UNSOL_HYSTERESIS_DCN";
  4555. case 11038:
  4556. return "UNSOL_CP_POSITION";
  4557. case 11043:
  4558. return "UNSOL_HOME_NETWORK_NOTI";
  4559. case 11054:
  4560. return "UNSOL_STK_CALL_STATUS";
  4561. case 11056:
  4562. return "UNSOL_MODEM_CAP";
  4563. case 11057:
  4564. return "UNSOL_SIM_SWAP_STATE_CHANGED";
  4565. case 11058:
  4566. return "UNSOL_SIM_COUNT_MISMATCHED";
  4567. case 11060:
  4568. return "UNSOL_DUN";
  4569. case 11061:
  4570. return "UNSOL_IMS_PREFERENCE_CHANGED";
  4571. case 11062:
  4572. return "UNSOL_SIM_APPLICATION_REFRESH";
  4573. case 11063:
  4574. return "UNSOL_UICC_APPLICATION_STATUS";
  4575. case 11064:
  4576. return "UNSOL_VOICE_RADIO_BEARER_HO_STATUS";
  4577. case 11065:
  4578. return "UNSOL_CLM_NOTI";
  4579. case 11066:
  4580. return "UNSOL_SIM_ICCID_NOTI";
  4581. default:
  4582. return "<unknown response>";
  4583. }
  4584. }
  4585.  
  4586. private void riljLog(String msg) {
  4587. Rlog.d(RILJ_LOG_TAG, msg + (this.mInstanceId != null ? " [SUB" + this.mInstanceId + "]" : ""));
  4588. }
  4589.  
  4590. private void riljLogv(String msg) {
  4591. Rlog.v(RILJ_LOG_TAG, msg + (this.mInstanceId != null ? " [SUB" + this.mInstanceId + "]" : ""));
  4592. }
  4593.  
  4594. private void unsljLog(int response) {
  4595. riljLog("[UNSL]< " + responseToString(response));
  4596. }
  4597.  
  4598. private void unsljLogMore(int response, String more) {
  4599. riljLog("[UNSL]< " + responseToString(response) + " " + more);
  4600. }
  4601.  
  4602. private void unsljLogRet(int response, Object ret) {
  4603. riljLog("[UNSL]< " + responseToString(response) + " " + retToString(response, ret));
  4604. }
  4605.  
  4606. private void unsljLogvRet(int response, Object ret) {
  4607. riljLogv("[UNSL]< " + responseToString(response) + " " + retToString(response, ret));
  4608. }
  4609.  
  4610. private Object responseSsData(Parcel p) {
  4611. SsData ssData = new SsData();
  4612. ssData.serviceType = ssData.ServiceTypeFromRILInt(p.readInt());
  4613. ssData.requestType = ssData.RequestTypeFromRILInt(p.readInt());
  4614. ssData.teleserviceType = ssData.TeleserviceTypeFromRILInt(p.readInt());
  4615. ssData.serviceClass = p.readInt();
  4616. ssData.result = p.readInt();
  4617. int num = p.readInt();
  4618. int i;
  4619. if (ssData.serviceType.isTypeCF() && ssData.requestType.isTypeInterrogation()) {
  4620. ssData.cfInfo = new CallForwardInfo[num];
  4621. for (i = 0; i < num; i++) {
  4622. ssData.cfInfo[i] = new CallForwardInfo();
  4623. ssData.cfInfo[i].status = p.readInt();
  4624. ssData.cfInfo[i].reason = p.readInt();
  4625. ssData.cfInfo[i].serviceClass = p.readInt();
  4626. ssData.cfInfo[i].toa = p.readInt();
  4627. ssData.cfInfo[i].number = p.readString();
  4628. ssData.cfInfo[i].timeSeconds = p.readInt();
  4629. riljLog("[SS Data] CF Info " + i + " : " + ssData.cfInfo[i]);
  4630. }
  4631. } else {
  4632. ssData.ssInfo = new int[num];
  4633. for (i = 0; i < num; i++) {
  4634. ssData.ssInfo[i] = p.readInt();
  4635. riljLog("[SS Data] SS Info " + i + " : " + ssData.ssInfo[i]);
  4636. }
  4637. }
  4638. return ssData;
  4639. }
  4640.  
  4641. public void getDeviceIdentity(Message response) {
  4642. RILRequest rr = RILRequest.obtain(OEM_NET_UPDATE_SUB_BINDING, response);
  4643. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  4644. send(rr);
  4645. }
  4646.  
  4647. public void getCDMASubscription(Message response) {
  4648. RILRequest rr = RILRequest.obtain(95, response);
  4649. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  4650. send(rr);
  4651. }
  4652.  
  4653. public void setPhoneType(int phoneType) {
  4654. riljLog("setPhoneType=" + phoneType + " old value=" + this.mPhoneType);
  4655. this.mPhoneType = phoneType;
  4656. }
  4657.  
  4658. public void queryCdmaRoamingPreference(Message response) {
  4659. RILRequest rr = RILRequest.obtain(79, response);
  4660. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  4661. send(rr);
  4662. }
  4663.  
  4664. public void setCdmaRoamingPreference(int cdmaRoamingType, Message response) {
  4665. RILRequest rr = RILRequest.obtain(78, response);
  4666. rr.mParcel.writeInt(1);
  4667. rr.mParcel.writeInt(cdmaRoamingType);
  4668. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " : " + cdmaRoamingType);
  4669. send(rr);
  4670. }
  4671.  
  4672. public void setCdmaSubscriptionSource(int cdmaSubscription, Message response) {
  4673. RILRequest rr = RILRequest.obtain(77, response);
  4674. rr.mParcel.writeInt(1);
  4675. rr.mParcel.writeInt(cdmaSubscription);
  4676. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " : " + cdmaSubscription);
  4677. send(rr);
  4678. }
  4679.  
  4680. public void getCdmaSubscriptionSource(Message response) {
  4681. RILRequest rr = RILRequest.obtain(Threads.ALERT_TEST_MESSAGE_THREAD, response);
  4682. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  4683. send(rr);
  4684. }
  4685.  
  4686. public void queryTTYMode(Message response) {
  4687. RILRequest rr = RILRequest.obtain(81, response);
  4688. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  4689. send(rr);
  4690. }
  4691.  
  4692. public void setTTYMode(int ttyMode, Message response) {
  4693. RILRequest rr = RILRequest.obtain(80, response);
  4694. rr.mParcel.writeInt(1);
  4695. rr.mParcel.writeInt(ttyMode);
  4696. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " : " + ttyMode);
  4697. send(rr);
  4698. }
  4699.  
  4700. public void sendCDMAFeatureCode(String FeatureCode, Message response) {
  4701. RILRequest rr = RILRequest.obtain(84, response);
  4702. rr.mParcel.writeString(FeatureCode);
  4703. if (SHIP_BUILD) {
  4704. if (FeatureCode == null || TextUtils.isEmpty(FeatureCode)) {
  4705. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  4706. } else {
  4707. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " : ...(" + FeatureCode.length() + ")");
  4708. }
  4709. send(rr);
  4710. return;
  4711. }
  4712. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " : " + FeatureCode);
  4713. send(rr);
  4714. }
  4715.  
  4716. public void getCdmaBroadcastConfig(Message response) {
  4717. send(RILRequest.obtain(92, response));
  4718. }
  4719.  
  4720. public void setCdmaBroadcastConfig(CdmaSmsBroadcastConfigInfo[] configs, Message response) {
  4721. int i;
  4722. RILRequest rr = RILRequest.obtain(93, response);
  4723. ArrayList<CdmaSmsBroadcastConfigInfo> processedConfigs = new ArrayList();
  4724. for (CdmaSmsBroadcastConfigInfo config : configs) {
  4725. for (i = config.getFromServiceCategory(); i <= config.getToServiceCategory(); i++) {
  4726. processedConfigs.add(new CdmaSmsBroadcastConfigInfo(i, i, config.getLanguage(), config.isSelected()));
  4727. }
  4728. }
  4729. CdmaSmsBroadcastConfigInfo[] rilConfigs = (CdmaSmsBroadcastConfigInfo[]) processedConfigs.toArray(configs);
  4730. rr.mParcel.writeInt(rilConfigs.length);
  4731. for (i = 0; i < rilConfigs.length; i++) {
  4732. rr.mParcel.writeInt(rilConfigs[i].getFromServiceCategory());
  4733. rr.mParcel.writeInt(rilConfigs[i].getLanguage());
  4734. rr.mParcel.writeInt(rilConfigs[i].isSelected() ? 1 : 0);
  4735. }
  4736. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " with " + rilConfigs.length + " configs : ");
  4737. send(rr);
  4738. }
  4739.  
  4740. public void setCdmaBroadcastActivation(boolean activate, Message response) {
  4741. int i = 1;
  4742. RILRequest rr = RILRequest.obtain(94, response);
  4743. rr.mParcel.writeInt(1);
  4744. Parcel parcel = rr.mParcel;
  4745. if (activate) {
  4746. i = 0;
  4747. }
  4748. parcel.writeInt(i);
  4749. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  4750. send(rr);
  4751. }
  4752.  
  4753. public void exitEmergencyCallbackMode(Message response) {
  4754. RILRequest rr = RILRequest.obtain(99, response);
  4755. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  4756. send(rr);
  4757. }
  4758.  
  4759. public void requestIsimAuthentication(String nonce, Message response) {
  4760. RILRequest rr = RILRequest.obtain(105, response);
  4761. rr.mParcel.writeString(nonce);
  4762. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  4763. send(rr);
  4764. }
  4765.  
  4766. public void requestIccSimAuthentication(int authContext, String data, String aid, Message response) {
  4767. RILRequest rr = RILRequest.obtain(125, response);
  4768. rr.mParcel.writeInt(authContext);
  4769. rr.mParcel.writeString(data);
  4770. rr.mParcel.writeString(aid);
  4771. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  4772. send(rr);
  4773. }
  4774.  
  4775. public void getCellInfoList(Message result) {
  4776. RILRequest rr = RILRequest.obtain(109, result);
  4777. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  4778. send(rr);
  4779. }
  4780.  
  4781. public void setCellInfoListRate(int rateInMillis, Message response) {
  4782. riljLog("setCellInfoListRate: " + rateInMillis);
  4783. RILRequest rr = RILRequest.obtain(Threads.ALERTS_ALL_ONE_THREAD, response);
  4784. rr.mParcel.writeInt(1);
  4785. rr.mParcel.writeInt(rateInMillis);
  4786. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  4787. send(rr);
  4788. }
  4789.  
  4790. public void setInitialAttachApn(String apn, String protocol, int authType, String username, String password, Message result) {
  4791. RILRequest rr = RILRequest.obtain(111, null);
  4792. riljLog("Set RIL_REQUEST_SET_INITIAL_ATTACH_APN");
  4793. rr.mParcel.writeString(apn);
  4794. rr.mParcel.writeString(protocol);
  4795. rr.mParcel.writeInt(authType);
  4796. rr.mParcel.writeString(username);
  4797. rr.mParcel.writeString(password);
  4798. if (isDebugLevelNotLow()) {
  4799. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + ", apn:" + apn + ", protocol:" + protocol + ", authType:" + authType + ", username:" + username + ", password:" + password);
  4800. }
  4801. send(rr);
  4802. }
  4803.  
  4804. public void setDataProfile(DataProfile[] dps, Message result) {
  4805. riljLog("Set RIL_REQUEST_SET_DATA_PROFILE");
  4806. RILRequest rr = RILRequest.obtain(128, null);
  4807. DataProfile.toParcel(rr.mParcel, dps);
  4808. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " with " + dps + " Data Profiles : ");
  4809. for (DataProfile dataProfile : dps) {
  4810. riljLog(dataProfile.toString());
  4811. }
  4812. send(rr);
  4813. }
  4814.  
  4815. public void testingEmergencyCall() {
  4816. riljLog("testingEmergencyCall");
  4817. this.mTestingEmergencyCall.set(true);
  4818. }
  4819.  
  4820. public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
  4821. pw.println("RIL: " + this);
  4822. pw.println(" mSocket=" + this.mSocket);
  4823. pw.println(" mSenderThread=" + this.mSenderThread);
  4824. pw.println(" mSender=" + this.mSender);
  4825. pw.println(" mReceiverThread=" + this.mReceiverThread);
  4826. pw.println(" mReceiver=" + this.mReceiver);
  4827. pw.println(" mWakeLock=" + this.mWakeLock);
  4828. pw.println(" mWakeLockTimeout=" + this.mWakeLockTimeout);
  4829. synchronized (this.mRequestList) {
  4830. synchronized (this.mWakeLock) {
  4831. pw.println(" mWakeLockCount=" + this.mWakeLockCount);
  4832. }
  4833. int count = this.mRequestList.size();
  4834. pw.println(" mRequestList count=" + count);
  4835. for (int i = 0; i < count; i++) {
  4836. RILRequest rr = (RILRequest) this.mRequestList.valueAt(i);
  4837. pw.println(" [" + rr.mSerial + "] " + requestToString(rr.mRequest));
  4838. }
  4839. }
  4840. pw.println(" mLastNITZTimeInfo=" + this.mLastNITZTimeInfo);
  4841. pw.println(" mTestingEmergencyCall=" + this.mTestingEmergencyCall.get());
  4842. }
  4843.  
  4844. public void iccOpenLogicalChannel(String AID, Message response) {
  4845. RILRequest rr = RILRequest.obtain(CallFailCause.KTF_FAIL_CAUSE_115, response);
  4846. rr.mParcel.writeString(AID);
  4847. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  4848. send(rr);
  4849. }
  4850.  
  4851. public void iccCloseLogicalChannel(int channel, Message response) {
  4852. RILRequest rr = RILRequest.obtain(CallFailCause.KTF_FAIL_CAUSE_116, response);
  4853. rr.mParcel.writeInt(1);
  4854. rr.mParcel.writeInt(channel);
  4855. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  4856. send(rr);
  4857. }
  4858.  
  4859. public void iccTransmitApduLogicalChannel(int channel, int cla, int instruction, int p1, int p2, int p3, String data, Message response) {
  4860. if (channel <= 0) {
  4861. throw new RuntimeException("Invalid channel in iccTransmitApduLogicalChannel: " + channel);
  4862. }
  4863. iccTransmitApduHelper(117, channel, cla, instruction, p1, p2, p3, data, response);
  4864. }
  4865.  
  4866. public void iccTransmitApduBasicChannel(int cla, int instruction, int p1, int p2, int p3, String data, Message response) {
  4867. iccTransmitApduHelper(CallFailCause.KTF_FAIL_CAUSE_114, 0, cla, instruction, p1, p2, p3, data, response);
  4868. }
  4869.  
  4870. private void iccTransmitApduHelper(int rilCommand, int channel, int cla, int instruction, int p1, int p2, int p3, String data, Message response) {
  4871. RILRequest rr = RILRequest.obtain(rilCommand, response);
  4872. rr.mParcel.writeInt(channel);
  4873. rr.mParcel.writeInt(cla);
  4874. rr.mParcel.writeInt(instruction);
  4875. rr.mParcel.writeInt(p1);
  4876. rr.mParcel.writeInt(p2);
  4877. rr.mParcel.writeInt(p3);
  4878. rr.mParcel.writeString(data);
  4879. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  4880. send(rr);
  4881. }
  4882.  
  4883. public void nvReadItem(int itemID, Message response) {
  4884. RILRequest rr = RILRequest.obtain(118, response);
  4885. rr.mParcel.writeInt(itemID);
  4886. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + ' ' + itemID);
  4887. send(rr);
  4888. }
  4889.  
  4890. public void nvWriteItem(int itemID, String itemValue, Message response) {
  4891. RILRequest rr = RILRequest.obtain(119, response);
  4892. rr.mParcel.writeInt(itemID);
  4893. rr.mParcel.writeString(itemValue);
  4894. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + ' ' + itemID + ": " + itemValue);
  4895. send(rr);
  4896. }
  4897.  
  4898. public void nvWriteCdmaPrl(byte[] preferredRoamingList, Message response) {
  4899. RILRequest rr = RILRequest.obtain(120, response);
  4900. rr.mParcel.writeByteArray(preferredRoamingList);
  4901. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " (" + preferredRoamingList.length + " bytes)");
  4902. send(rr);
  4903. }
  4904.  
  4905. public void nvResetConfig(int resetType, Message response) {
  4906. RILRequest rr = RILRequest.obtain(121, response);
  4907. rr.mParcel.writeInt(1);
  4908. rr.mParcel.writeInt(resetType);
  4909. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + ' ' + resetType);
  4910. send(rr);
  4911. }
  4912.  
  4913. public void setRadioCapability(RadioCapability rc, Message response) {
  4914. RILRequest rr = RILRequest.obtain(131, response);
  4915. rr.mParcel.writeInt(rc.getVersion());
  4916. rr.mParcel.writeInt(rc.getSession());
  4917. rr.mParcel.writeInt(rc.getPhase());
  4918. rr.mParcel.writeInt(rc.getRadioAccessFamily());
  4919. rr.mParcel.writeString(rc.getLogicalModemUuid());
  4920. rr.mParcel.writeInt(rc.getStatus());
  4921. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " " + rc.toString());
  4922. send(rr);
  4923. }
  4924.  
  4925. public void getRadioCapability(Message response) {
  4926. RILRequest rr = RILRequest.obtain(130, response);
  4927. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  4928. send(rr);
  4929. }
  4930.  
  4931. public void startLceService(int reportIntervalMs, boolean pullMode, Message response) {
  4932. RILRequest rr = RILRequest.obtain(132, response);
  4933. rr.mParcel.writeInt(2);
  4934. rr.mParcel.writeInt(reportIntervalMs);
  4935. rr.mParcel.writeInt(pullMode ? 1 : 0);
  4936. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  4937. send(rr);
  4938. }
  4939.  
  4940. public void stopLceService(Message response) {
  4941. RILRequest rr = RILRequest.obtain(133, response);
  4942. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  4943. send(rr);
  4944. }
  4945.  
  4946. public void pullLceData(Message response) {
  4947. RILRequest rr = RILRequest.obtain(134, response);
  4948. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  4949. send(rr);
  4950. }
  4951.  
  4952. public void getModemActivityInfo(Message response) {
  4953. RILRequest rr = RILRequest.obtain(135, response);
  4954. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  4955. send(rr);
  4956. }
  4957.  
  4958. public void accessPhoneBookEntry(int command, int fileid, int index, AdnRecord adn, String pin2, Message result) {
  4959. boolean isEncodable;
  4960. int i;
  4961. int j;
  4962. RILRequest rr = RILRequest.obtain(10011, result);
  4963. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  4964. String alphTag = adn.mAlphaTag;
  4965. String number = adn.mNumber;
  4966. String email = adn.mEmails[0];
  4967. String anr = adn.mAnr;
  4968. String anrA = adn.mAnrA;
  4969. String anrB = adn.mAnrB;
  4970. String anrC = adn.mAnrC;
  4971. String sne = adn.mSne;
  4972. if (anr.length() == 0) {
  4973. anr = null;
  4974. }
  4975. if (anrA.length() == 0) {
  4976. anrA = null;
  4977. }
  4978. if (anrB.length() == 0) {
  4979. anrB = null;
  4980. }
  4981. if (anrC.length() == 0) {
  4982. anrC = null;
  4983. }
  4984. byte[] byteArrayName = new byte[0];
  4985. byte[] byteArrayNameTemp = new byte[0];
  4986. byte[] byteArraySNE = new byte[0];
  4987. byte[] byteArraySNETemp = new byte[0];
  4988. byte[] byteArrayEmail = new byte[0];
  4989. byte[] byteArrayEmailTemp = new byte[0];
  4990. rr.mParcel.writeInt(command);
  4991. rr.mParcel.writeInt(fileid);
  4992. rr.mParcel.writeInt(index);
  4993. try {
  4994. GsmAlphabet.countGsmSeptets(alphTag, true);
  4995. isEncodable = true;
  4996. } catch (Exception e) {
  4997. isEncodable = false;
  4998. }
  4999. if (isEncodable) {
  5000. }
  5001. try {
  5002. byteArrayNameTemp = alphTag.getBytes("ISO-10646-UCS-2");
  5003. byteArrayName = new byte[(byteArrayNameTemp.length - 2)];
  5004. for (i = 0; i < byteArrayNameTemp.length - 2; i++) {
  5005. byteArrayName[i] = byteArrayNameTemp[i + 2];
  5006. }
  5007. } catch (Exception e2) {
  5008. }
  5009. for (i = 0; i < byteArrayName.length; i++) {
  5010. riljLog("name[" + i + " ] = " + byteArrayName[i]);
  5011. }
  5012. rr.mParcel.writeByteArray(byteArrayName);
  5013. rr.mParcel.writeInt(byteArrayName.length);
  5014. rr.mParcel.writeInt(3);
  5015. rr.mParcel.writeString(number);
  5016. if (false) {
  5017. try {
  5018. byteArrayEmailTemp = email.getBytes("ISO-10646-UCS-2");
  5019. byteArrayEmail = new byte[(byteArrayEmailTemp.length - 2)];
  5020. for (j = 0; j < byteArrayEmailTemp.length - 2; j++) {
  5021. byteArrayEmail[j] = byteArrayEmailTemp[j + 2];
  5022. }
  5023. } catch (Exception e3) {
  5024. }
  5025. riljLog("email = " + email);
  5026. rr.mParcel.writeByteArray(byteArrayEmail);
  5027. rr.mParcel.writeInt(byteArrayEmail.length);
  5028. } else {
  5029. byte[] gsm8bitEmail = GsmAlphabet.stringToGsm8BitPacked(email);
  5030. rr.mParcel.writeByteArray(gsm8bitEmail);
  5031. rr.mParcel.writeInt(gsm8bitEmail.length);
  5032. }
  5033. riljLog("anr = " + anr);
  5034. rr.mParcel.writeString(anr);
  5035. rr.mParcel.writeString(anrA);
  5036. rr.mParcel.writeString(anrB);
  5037. rr.mParcel.writeString(anrC);
  5038. try {
  5039. GsmAlphabet.countGsmSeptets(sne, true);
  5040. } catch (Exception e4) {
  5041. }
  5042. try {
  5043. byteArraySNETemp = sne.getBytes("ISO-10646-UCS-2");
  5044. byteArraySNE = new byte[(byteArraySNETemp.length - 2)];
  5045. for (i = 0; i < byteArraySNETemp.length - 2; i++) {
  5046. byteArraySNE[i] = byteArraySNETemp[i + 2];
  5047. }
  5048. } catch (Exception e5) {
  5049. }
  5050. riljLog("sne = " + sne);
  5051. for (j = 0; j < byteArraySNE.length; j++) {
  5052. riljLog("sne[" + j + " ] = " + byteArraySNE[j]);
  5053. }
  5054. rr.mParcel.writeByteArray(byteArraySNE);
  5055. rr.mParcel.writeInt(byteArraySNE.length);
  5056. rr.mParcel.writeInt(3);
  5057. rr.mParcel.writeString(pin2);
  5058. send(rr);
  5059. }
  5060.  
  5061. public void changeBarringPassword(String facility, String oldPwd, String newPwd, String newPwdAgain, Message result) {
  5062. RILRequest rr = RILRequest.obtain(44, result);
  5063. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  5064. rr.mParcel.writeInt(4);
  5065. rr.mParcel.writeString(facility);
  5066. rr.mParcel.writeString(oldPwd);
  5067. rr.mParcel.writeString(newPwd);
  5068. rr.mParcel.writeString(newPwdAgain);
  5069. send(rr);
  5070. }
  5071.  
  5072. public void getPhoneBookStorageInfo(int fileid, Message response) {
  5073. RILRequest rr = RILRequest.obtain(10009, response);
  5074. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  5075. rr.mParcel.writeInt(1);
  5076. rr.mParcel.writeInt(fileid);
  5077. send(rr);
  5078. }
  5079.  
  5080. public void getPhoneBookEntry(int command, int fileid, int index, String pin2, Message result) {
  5081. RILRequest rr = RILRequest.obtain(10010, result);
  5082. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  5083. rr.mParcel.writeInt(command);
  5084. rr.mParcel.writeInt(fileid);
  5085. rr.mParcel.writeString(null);
  5086. rr.mParcel.writeInt(index);
  5087. rr.mParcel.writeInt(0);
  5088. rr.mParcel.writeInt(0);
  5089. rr.mParcel.writeString(null);
  5090. rr.mParcel.writeString(pin2);
  5091. send(rr);
  5092. }
  5093.  
  5094. public void getUsimPBCapa(Message result) {
  5095. RILRequest rr = RILRequest.obtain(10012, result);
  5096. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  5097. send(rr);
  5098. }
  5099.  
  5100. public void getSIMLockInfo(int num_lock_type, int lock_type, Message result) {
  5101. RILRequest rr = RILRequest.obtain(10013, result);
  5102. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  5103. rr.mParcel.writeInt(num_lock_type);
  5104. rr.mParcel.writeInt(lock_type);
  5105. send(rr);
  5106. }
  5107.  
  5108. public void setSimInitEvent(Message response) {
  5109. RILRequest rr = RILRequest.obtain(10014, response);
  5110. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  5111. send(rr);
  5112. }
  5113.  
  5114. public int modifyNetworkTypeByOperator(int networkType) {
  5115. boolean isDcmLteFeature = SystemProperties.getBoolean("persist.radio.dcmlte", true);
  5116. boolean isRoaming = SystemProperties.getBoolean("gsm.operator.isroaming", false);
  5117. int preferredNetworkType = SystemProperties.getInt("persist.radio.setnwkmode", 9);
  5118. boolean userDataEnabled = Global.getInt(this.mContext.getContentResolver(), "mobile_data", 1) == 1;
  5119. boolean userDataRoamingEnabled = Global.getInt(this.mContext.getContentResolver(), "data_roaming", 1) == 1;
  5120. if (System.getInt(this.mContext.getContentResolver(), "voicecall_type", 1) == 0) {
  5121. }
  5122. String campMcc = SystemProperties.get("gsm.operator.numeric", "");
  5123. String homeNet = SystemProperties.get("gsm.sim.operator.numeric", "44050");
  5124. if ("00101".equals(homeNet) || "99999".equals(homeNet) || "45001".equals(homeNet)) {
  5125. return networkType;
  5126. }
  5127. if (campMcc.length() < 3) {
  5128. isRoaming = false;
  5129. } else if (homeNet.substring(0, 3).equals(campMcc.substring(0, 3)) || "000".equals(campMcc.substring(0, 3)) || "000".equals(homeNet.substring(0, 3))) {
  5130. isRoaming = false;
  5131. } else {
  5132. isRoaming = true;
  5133. }
  5134. riljLog("modifyNetworkTypeByOperator (preferredNetworkType:" + preferredNetworkType + ", userDataEnabled:" + userDataEnabled + ", isRoaming:" + isRoaming + ", userDataRoamingEnabled:" + userDataRoamingEnabled + ")");
  5135. if (!userDataEnabled || (isRoaming && !userDataRoamingEnabled)) {
  5136. userDataEnabled = false;
  5137. } else {
  5138. userDataEnabled = true;
  5139. }
  5140. if ("KDI".equals("EUR")) {
  5141. boolean LteDataComm = PreferenceManager.getDefaultSharedPreferences(this.mContext).getBoolean("japan_system_select_key", true);
  5142. riljLog("... LteDataComm:" + LteDataComm);
  5143. userDataEnabled = isRoaming ? userDataEnabled && LteDataComm : true;
  5144. }
  5145. if (CscFeature.getInstance().getEnableStatus("CscFeature_RIL_NamSupport")) {
  5146. boolean allowDataEnableByNam = SystemProperties.getBoolean("ril.allowDataEnableByNam", true);
  5147. riljLog("allowDataEnableByNam: " + allowDataEnableByNam);
  5148. userDataEnabled = userDataEnabled && allowDataEnableByNam;
  5149. }
  5150. networkType = preferredNetworkType;
  5151. if (!userDataEnabled) {
  5152. switch (preferredNetworkType) {
  5153. case 8:
  5154. networkType = 4;
  5155. break;
  5156. case 9:
  5157. networkType = 3;
  5158. break;
  5159. case 10:
  5160. networkType = 7;
  5161. break;
  5162. case 12:
  5163. networkType = 2;
  5164. break;
  5165. }
  5166. }
  5167. return networkType;
  5168. }
  5169.  
  5170. public String modifyDnsByCpa(String dnses, String ifname) {
  5171. boolean isKddiCpaOn;
  5172. String[] tmpDns = new String[0];
  5173. String DEFAULT_NULL_ADDRESS = "0.0.0.0";
  5174. if (Secure.getInt(this.mContext.getContentResolver(), "kddi_cpa_on", 0) != 0) {
  5175. isKddiCpaOn = true;
  5176. } else {
  5177. isKddiCpaOn = false;
  5178. }
  5179. String cpaDns1 = Secure.getString(this.mContext.getContentResolver(), "kddi_cpa_static_dns1");
  5180. String cpaDns2 = Secure.getString(this.mContext.getContentResolver(), "kddi_cpa_static_dns2");
  5181. riljLog("modifyDnsByCpa (isKddiCpaOn:" + isKddiCpaOn + ", cpaDns1:" + cpaDns1 + "cpaDns2:" + cpaDns2 + ", dnses:" + dnses + ")");
  5182. if (cpaDns2 == null || cpaDns2.equals("")) {
  5183. cpaDns2 = DEFAULT_NULL_ADDRESS;
  5184. }
  5185. if (!isKddiCpaOn) {
  5186. return dnses;
  5187. }
  5188. String propertyPrefix = "net." + ifname + ".";
  5189. String[] dnsServers = new String[2];
  5190. if (cpaDns1 == null || cpaDns1.equals("")) {
  5191. if (TextUtils.isEmpty(dnses)) {
  5192. cpaDns1 = "1.0.0.0";
  5193. cpaDns2 = "1.0.0.0";
  5194. } else {
  5195. tmpDns = dnses.split(" ");
  5196. riljLog("tmpdns[0]:" + tmpDns[0] + ", tmpDns[1]:" + tmpDns[1]);
  5197. if (tmpDns[0].equals(DEFAULT_NULL_ADDRESS)) {
  5198. tmpDns[0] = "1.0.0.0";
  5199. }
  5200. if (tmpDns[1].equals(DEFAULT_NULL_ADDRESS)) {
  5201. tmpDns[1] = "1.0.0.0";
  5202. }
  5203. SystemProperties.set(propertyPrefix + "dns1", tmpDns[0]);
  5204. SystemProperties.set(propertyPrefix + "dns2", tmpDns[1]);
  5205. return tmpDns[0] + " " + tmpDns[1];
  5206. }
  5207. }
  5208. SystemProperties.set(propertyPrefix + "dns1", cpaDns1);
  5209. SystemProperties.set(propertyPrefix + "dns2", cpaDns2);
  5210. return cpaDns1 + " " + cpaDns2;
  5211. }
  5212.  
  5213. public void sendEncodedUSSD(byte[] ussdString, int length, int dcsCode, Message response) {
  5214. RILRequest rr = RILRequest.obtain(10019, response);
  5215. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " " + IccUtils.bytesToHexString(ussdString) + ", DCS : " + dcsCode);
  5216. rr.mParcel.writeByteArray(ussdString);
  5217. rr.mParcel.writeInt(length);
  5218. rr.mParcel.writeInt(dcsCode);
  5219. send(rr);
  5220. }
  5221.  
  5222. private Object responseSSReleaseCompleteNotification(Parcel p) {
  5223. SSReleaseCompleteNotification notification = new SSReleaseCompleteNotification();
  5224. Rlog.i(RILJ_LOG_TAG, "responseSSReleaseCompleteNotification()");
  5225. notification.size = p.readInt();
  5226. notification.dataLen = p.readInt();
  5227. notification.params = p.readInt();
  5228. notification.status = p.readInt();
  5229. notification.data = p.readString();
  5230. Rlog.i(RILJ_LOG_TAG, "notification.data = " + notification.data);
  5231. return notification;
  5232. }
  5233.  
  5234. private Object responseUSSD(Parcel p) {
  5235. int num = p.readInt();
  5236. int dcs = p.readInt();
  5237. Rlog.d(RILJ_LOG_TAG, "responseUSSD - num " + num);
  5238. String[] response = new String[num];
  5239. int i = 0;
  5240. while (i < num) {
  5241. if (dcs != 148 || i <= 0) {
  5242. response[i] = p.readString();
  5243. } else {
  5244. try {
  5245. response[i] = new String(IccUtils.hexStringToBytes(p.readString()), CharacterSets.MIMENAME_EUC_KR);
  5246. Rlog.d(RILJ_LOG_TAG, "responseUSSD :: USSD_DCS_KS5601, response" + response[i]);
  5247. } catch (UnsupportedEncodingException e) {
  5248. response[i] = "";
  5249. }
  5250. }
  5251. i++;
  5252. }
  5253. return response;
  5254. }
  5255.  
  5256. private Object responseSIM_PB(Parcel p) {
  5257. int[] lengthAlphas = new int[3];
  5258. int[] dataTypeAlphas = new int[3];
  5259. String[] alphaTags = new String[3];
  5260. int[] lengthNumbers = new int[5];
  5261. int[] dataTypeNumbers = new int[5];
  5262. String[] numbers = new String[5];
  5263. p.readIntArray(lengthAlphas);
  5264. p.readIntArray(dataTypeAlphas);
  5265. p.readStringArray(alphaTags);
  5266. if (!SHIP_BUILD) {
  5267. Rlog.i(RILJ_LOG_TAG, "alphaTag is " + alphaTags[0]);
  5268. }
  5269. if (!SHIP_BUILD) {
  5270. Rlog.i(RILJ_LOG_TAG, "SNE is " + alphaTags[1]);
  5271. }
  5272. if (!SHIP_BUILD) {
  5273. Rlog.i(RILJ_LOG_TAG, "email is " + alphaTags[2]);
  5274. }
  5275. p.readIntArray(lengthNumbers);
  5276. Rlog.i(RILJ_LOG_TAG, "lengthNumber is " + lengthNumbers[0]);
  5277. p.readIntArray(dataTypeNumbers);
  5278. p.readStringArray(numbers);
  5279. if (!SHIP_BUILD) {
  5280. Rlog.i(RILJ_LOG_TAG, "number is " + numbers[0]);
  5281. }
  5282. if (!SHIP_BUILD) {
  5283. Rlog.i(RILJ_LOG_TAG, "ANR is " + numbers[1]);
  5284. }
  5285. return new SimPBEntryResult(lengthAlphas, dataTypeAlphas, alphaTags, lengthNumbers, dataTypeNumbers, numbers, p.readInt(), p.readInt());
  5286. }
  5287.  
  5288. private Object responseSIM_LockInfo(Parcel p) {
  5289. int num_lock_type = p.readInt();
  5290. int lock_type = p.readInt();
  5291. int lock_key = p.readInt();
  5292. int num_of_retry = p.readInt();
  5293. Rlog.i(RILJ_LOG_TAG, "num:" + num_lock_type + " lock_type:" + lock_type + " lock_key:" + lock_key + " num_of_retry:" + num_of_retry);
  5294. return new SimLockInfoResult(num_lock_type, lock_type, lock_key, num_of_retry);
  5295. }
  5296.  
  5297. private Object responseSimPowerDone(Parcel p) {
  5298. Rlog.d(RILJ_LOG_TAG, "ResponseSimPowerDone");
  5299. int numInts = p.readInt();
  5300. int[] response = new int[numInts];
  5301. for (int i = 0; i < numInts; i++) {
  5302. response[i] = p.readInt();
  5303. }
  5304. Rlog.d(RILJ_LOG_TAG, "ResponseSimPowerDone : " + response[0]);
  5305. return Integer.valueOf(response[0]);
  5306. }
  5307.  
  5308. private void setInitialPhoneType(int networkType) {
  5309. int phoneType = TelephonyManager.getPhoneType(networkType);
  5310. if (phoneType != this.initPhoneType) {
  5311. SystemProperties.set("persist.radio.initphone-type", String.valueOf(phoneType));
  5312. Rlog.d(RILJ_LOG_TAG, "Initial PhoneType is changed: " + this.initPhoneType + " -> " + phoneType);
  5313. this.initPhoneType = phoneType;
  5314. }
  5315. }
  5316.  
  5317. public void supplyIccPerso(String pin, Message result) {
  5318. RILRequest rr = RILRequest.obtain(10018, result);
  5319. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  5320. rr.mParcel.writeInt(1);
  5321. rr.mParcel.writeString(pin);
  5322. send(rr);
  5323. }
  5324.  
  5325. public void changeIccSimPerso(String oldPass, String newPass, Message result) {
  5326. RILRequest rr = RILRequest.obtain(10017, result);
  5327. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  5328. rr.mParcel.writeInt(2);
  5329. rr.mParcel.writeString(oldPass);
  5330. rr.mParcel.writeString(newPass);
  5331. send(rr);
  5332. }
  5333.  
  5334. public void sendSMSmore(String smscPDU, String pdu, Message result) {
  5335. RILRequest rr = RILRequest.obtain(26, result);
  5336. Rlog.d(RILJ_LOG_TAG, "smscPDU: " + smscPDU);
  5337. Rlog.d(RILJ_LOG_TAG, "pdu: " + pdu);
  5338. constructGsmSendSmsRilRequest(rr, smscPDU, pdu);
  5339. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  5340. send(rr);
  5341. }
  5342.  
  5343. public void sendCdmaSmsMore(byte[] pdu, Message result) {
  5344. RILRequest rr = RILRequest.obtain(10020, result);
  5345. constructCdmaSendSmsRilRequest(rr, pdu);
  5346. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  5347. send(rr);
  5348. }
  5349.  
  5350. public void hangupVT(int rejectCause, Message result) {
  5351. RILRequest rr = RILRequest.obtain(10021, result);
  5352. rr.mParcel.writeInt(1);
  5353. rr.mParcel.writeInt(rejectCause);
  5354. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " rejectCause: " + rejectCause);
  5355. send(rr);
  5356. }
  5357.  
  5358. public void holdCall(Message result) {
  5359. RILRequest rr = RILRequest.obtain(10022, result);
  5360. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  5361. send(rr);
  5362. }
  5363.  
  5364. private boolean isDebugLevelNotLow() {
  5365. if (SystemProperties.get(LOG_LEVEL_PROP, LOG_LEVEL_PROP_LOW).equalsIgnoreCase(LOG_LEVEL_PROP_LOW)) {
  5366. return false;
  5367. }
  5368. return true;
  5369. }
  5370.  
  5371. public void uiccGbaAuthenticateBootstrap(String sessionId, byte[] rand, byte[] autn, Message response) {
  5372. RILRequest rr = RILRequest.obtain(10025, response);
  5373. String randHex = IccUtils.bytesToHexString(rand);
  5374. String autnHex = IccUtils.bytesToHexString(autn);
  5375. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + "[" + sessionId + "," + randHex + "," + autnHex + "]");
  5376. rr.mParcel.writeString(sessionId);
  5377. rr.mParcel.writeString(randHex);
  5378. rr.mParcel.writeString(autnHex);
  5379. send(rr);
  5380. }
  5381.  
  5382. public void uiccGbaAuthenticateNaf(String sessionId, byte[] nafId, byte[] impi, Message response) {
  5383. RILRequest rr = RILRequest.obtain(10026, response);
  5384. String nafIdHex = IccUtils.bytesToHexString(nafId);
  5385. String impiHex = IccUtils.bytesToHexString(impi);
  5386. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + "[" + sessionId + "," + nafIdHex + "]");
  5387. rr.mParcel.writeString(sessionId);
  5388. rr.mParcel.writeString(nafIdHex);
  5389. rr.mParcel.writeString(impiHex);
  5390. send(rr);
  5391. }
  5392.  
  5393. private Object responseBootstrap(Parcel p) {
  5394. Bundle b = new Bundle();
  5395. b.putByteArray("res", IccUtils.hexStringToBytes(p.readString()));
  5396. b.putByteArray("auts", IccUtils.hexStringToBytes(p.readString()));
  5397. return b;
  5398. }
  5399.  
  5400. private Object responseNaf(Parcel p) {
  5401. return IccUtils.hexStringToBytes(p.readString());
  5402. }
  5403.  
  5404. protected void notifyModemCap(byte[] data, Integer phoneId) {
  5405. this.mModemCapRegistrants.notifyRegistrants(new AsyncResult(null, new UnsolOemHookBuffer(phoneId.intValue(), data), null));
  5406. Rlog.d(RILJ_LOG_TAG, "MODEM_CAPABILITY on phone=" + phoneId + " notified to registrants");
  5407. }
  5408.  
  5409. public void getICBarring(String facility, String password, int serviceClass, Message response) {
  5410. RILRequest rr = RILRequest.obtain(10027, response);
  5411. String dbgMsg = rr.serialString() + "> " + requestToString(rr.mRequest);
  5412. if (!SHIP_BUILD) {
  5413. dbgMsg = dbgMsg + " [" + facility + " " + serviceClass + "]";
  5414. }
  5415. riljLog(dbgMsg);
  5416. rr.mParcel.writeInt(4);
  5417. rr.mParcel.writeString(facility);
  5418. rr.mParcel.writeString(password);
  5419. rr.mParcel.writeString(Integer.toString(serviceClass));
  5420. rr.mParcel.writeString("");
  5421. send(rr);
  5422. }
  5423.  
  5424. public void setICBarring(String facility, int barringState, String iCBNumber, int serviceClass, Message response) {
  5425. String barringString;
  5426. RILRequest rr = RILRequest.obtain(10028, response);
  5427. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " [" + facility + " " + barringState + " " + serviceClass + " ]");
  5428. rr.mParcel.writeInt(5);
  5429. rr.mParcel.writeString(facility);
  5430. if (barringState == 0) {
  5431. barringString = "0";
  5432. } else if (barringState == 1) {
  5433. barringString = "1";
  5434. } else if (barringState == 3) {
  5435. barringString = "3";
  5436. } else if (barringState == 4) {
  5437. barringString = "4";
  5438. } else {
  5439. Rlog.d(RILJ_LOG_TAG, "setICBarring: barring state is wrong value");
  5440. barringString = "1";
  5441. }
  5442. rr.mParcel.writeString(barringString);
  5443. rr.mParcel.writeString(iCBNumber);
  5444. rr.mParcel.writeString(Integer.toString(serviceClass));
  5445. rr.mParcel.writeString("");
  5446. send(rr);
  5447. }
  5448.  
  5449. public void transferCall(String msisdn, String deviceId, int index, Message result) {
  5450. RILRequest rr = RILRequest.obtain(10030, result);
  5451. String dbgMsg = rr.serialString() + "> " + requestToString(rr.mRequest);
  5452. if (!SHIP_BUILD) {
  5453. dbgMsg = dbgMsg + " [" + msisdn + "," + deviceId + "]";
  5454. }
  5455. riljLog(dbgMsg);
  5456. rr.mParcel.writeInt(3);
  5457. rr.mParcel.writeString(msisdn);
  5458. rr.mParcel.writeString(deviceId);
  5459. rr.mParcel.writeString(Integer.toString(index));
  5460. send(rr);
  5461. }
  5462.  
  5463. public void getDisable2g(Message response) {
  5464. RILRequest rr = RILRequest.obtain(10031, response);
  5465. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  5466. send(rr);
  5467. }
  5468.  
  5469. public void setDisable2g(int state, Message response) {
  5470. RILRequest rr = RILRequest.obtain(10032, response);
  5471. String dbgMsg = rr.serialString() + "> " + requestToString(rr.mRequest);
  5472. if (!SHIP_BUILD) {
  5473. dbgMsg = dbgMsg + " [" + state + "]";
  5474. }
  5475. riljLog(dbgMsg);
  5476. rr.mParcel.writeInt(1);
  5477. rr.mParcel.writeInt(state);
  5478. send(rr);
  5479. }
  5480.  
  5481. public void refreshNitzTime(Message result) {
  5482. RILRequest rr = RILRequest.obtain(10033, result);
  5483. riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  5484. send(rr);
  5485. }
  5486.  
  5487. private void testingETWS(SmsMessage sms) {
  5488. byte[] tmp;
  5489. byte[] testID_1_1100 = IccUtils.hexStringToBytes("3000110011010D0A5BAE57CE770C531790E85C716CBF3044573065B9306757309707767A751F30025F37304463FA308C306B509930483066");
  5490. byte[] testID_2_1100 = IccUtils.hexStringToBytes("2000110011010D0A5BAE57CE770C531790E85C716CBF3044573065B9306757309707767A751F30025F37304463FA308C306B509930483066");
  5491. byte[] testID_3_1100 = IccUtils.hexStringToBytes("1000110011010D0A5BAE57CE770C531790E85C716CBF3044573065B9306757309707767A751F30025F37304463FA308C306B509930483066");
  5492. byte[] testID_4_1100 = IccUtils.hexStringToBytes("4000110011010D0A5BAE57CE770C531790E85C716CBF3044573065B9306757309707767A751F30025F37304463FA308C306B509930483066");
  5493. int Id = Integer.parseInt(sms.getMessageBody());
  5494. riljLog("testingETWS");
  5495. switch (Id) {
  5496. case 11100:
  5497. tmp = testID_1_1100;
  5498. break;
  5499. case 21100:
  5500. tmp = testID_2_1100;
  5501. break;
  5502. case 31100:
  5503. tmp = testID_3_1100;
  5504. break;
  5505. case 41100:
  5506. tmp = testID_4_1100;
  5507. break;
  5508. default:
  5509. return;
  5510. }
  5511. if (this.mGsmBroadcastSmsRegistrant != null) {
  5512. this.mGsmBroadcastSmsRegistrant.notifyRegistrant(new AsyncResult(null, tmp, null));
  5513. }
  5514. }
  5515. }
Add Comment
Please, Sign In to add comment