Advertisement
Guest User

HuaweiQualcommRIL.java

a guest
Jul 19th, 2013
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.63 KB | None | 0 0
  1. /*
  2. * Copyright (C) 2013 The CyanogenMod Project
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16.  
  17. package com.android.internal.telephony;
  18.  
  19. import static com.android.internal.telephony.RILConstants.*;
  20.  
  21. import android.content.Context;
  22. import android.os.Message;
  23. import android.os.Parcel;
  24. import android.os.SystemProperties;
  25. import android.telephony.SignalStrength;
  26. import android.text.TextUtils;
  27. import android.util.Log;
  28.  
  29. import com.android.internal.telephony.cdma.CdmaInformationRecords;
  30. import com.android.internal.telephony.cdma.CdmaInformationRecords.CdmaSignalInfoRec;
  31. import com.android.internal.telephony.cdma.SignalToneUtil;
  32. import com.android.internal.telephony.gsm.SmsBroadcastConfigInfo;
  33.  
  34. import java.util.ArrayList;
  35.  
  36. /**
  37. * Custom Qualcomm SimReady RIL for Huawei using the latest Uicc stack
  38. *
  39. * {@hide}
  40. */
  41. public class HuaweiQualcommRIL extends QualcommSharedRIL implements CommandsInterface {
  42. boolean RILJ_LOGV = true;
  43. boolean RILJ_LOGD = true;
  44.  
  45. public HuaweiQualcommRIL(Context context, int networkMode, int cdmaSubscription) {
  46. super(context, networkMode, cdmaSubscription);
  47. mQANElements = 4;
  48. }
  49.  
  50. @Override
  51. protected void notifyRegistrantsCdmaInfoRec(CdmaInformationRecords infoRec) {
  52. final int response = RIL_UNSOL_CDMA_INFO_REC;
  53.  
  54. if (infoRec.record instanceof CdmaSignalInfoRec) {
  55. CdmaSignalInfoRec sir = (CdmaSignalInfoRec) infoRec.record;
  56. if (sir != null
  57. && sir.isPresent
  58. && sir.signalType == SignalToneUtil.IS95_CONST_IR_SIGNAL_IS54B
  59. && sir.alertPitch == SignalToneUtil.IS95_CONST_IR_ALERT_MED
  60. && sir.signal == SignalToneUtil.IS95_CONST_IR_SIG_IS54B_L) {
  61.  
  62. Log.d(LOG_TAG, "Dropping \"" + responseToString(response) + " "
  63. + retToString(response, sir)
  64. + "\" to prevent \"ring of death\" bug.");
  65. return;
  66. }
  67. }
  68.  
  69. super.notifyRegistrantsCdmaInfoRec(infoRec);
  70. }
  71.  
  72. public void setGsmBroadcastConfig(SmsBroadcastConfigInfo[] paramArrayOfSmsBroadcastConfigInfo, Message paramMessage)
  73. {
  74. RILRequest localRILRequest = RILRequest.obtain(90, paramMessage);
  75. int i = paramArrayOfSmsBroadcastConfigInfo.length;
  76. mp.writeInt(i);
  77. int j = 0;
  78. if (j < i)
  79. {
  80. mp.writeInt(paramArrayOfSmsBroadcastConfigInfo[j].getFromServiceId());
  81. mp.writeInt(paramArrayOfSmsBroadcastConfigInfo[j].getToServiceId());
  82. mp.writeInt(paramArrayOfSmsBroadcastConfigInfo[j].getFromCodeScheme());
  83. mp.writeInt(paramArrayOfSmsBroadcastConfigInfo[j].getToCodeScheme());
  84. Parcel localParcel = mp;
  85. if (paramArrayOfSmsBroadcastConfigInfo[j].isSelected()) {}
  86. for (int m = 1;; m = 0)
  87. {
  88. localParcel.writeInt(m);
  89. j++;
  90. break;
  91. }
  92. }
  93. riljLog(localRILRequest.serialString() + "> " + requestToString(mRequest) + " with " + i + " configs : ");
  94. for (int k = 0; k < i; k++)
  95. riljLog(paramArrayOfSmsBroadcastConfigInfo[k].toString());
  96. send(localRILRequest);
  97. }
  98. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement