Advertisement
manfromnn

Qualcomm42RIL[1].java

Jun 26th, 2014
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.74 KB | None | 0 0
  1. /*
  2.  * Copyright (C) 2012-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 android.content.Context;
  20. import android.os.Message;
  21.  
  22. /**
  23.  * Backwards compatible RIL implementation for Qualcomm 4.2-MR1
  24.  * radios. Android 4.3 added the CELL_INFO_LIST commands, displacing several
  25.  * command ids already used in pre-4.3 RILs.
  26.  *
  27.  * {@hide}
  28.  */
  29. public class Qualcomm42RIL extends RIL implements CommandsInterface {
  30.  
  31.     static final int RIL_REQUEST_IMS_REGISTRATION_STATE = 109;
  32.     static final int RIL_REQUEST_IMS_SEND_SMS = 110;
  33.     static final int RIL_REQUEST_GET_DATA_CALL_PROFILE = 111;
  34.     static final int RIL_REQUEST_SET_UICC_SUBSCRIPTION = 118;
  35.     static final int RIL_REQUEST_SET_DATA_SUBSCRIPTION = 119;
  36.     static final int RIL_REQUEST_GET_UICC_SUBSCRIPTION = 120;
  37.     static final int RIL_REQUEST_GET_DATA_SUBSCRIPTION = 121;
  38.     static final int RIL_UNSOL_RESPONSE_IMS_NETWORK_STATE_CHANGED = 1036;
  39.     static final int RIL_UNSOL_TETHERED_MODE_STATE_CHANGED = 1037;
  40.  
  41.     public Qualcomm42RIL(Context context, int networkMode,
  42.             int cdmaSubscription) {
  43.         super(context, networkMode, cdmaSubscription);
  44.     }
  45.  
  46.     /**
  47.      * {@inheritDoc}
  48.      */
  49.     @Override
  50.     public void getCellInfoList(Message result) {
  51.         if (RILJ_LOGD) riljLog("[STUB] > getCellInfoList");
  52.     }
  53.  
  54.     /**
  55.      * {@inheritDoc}
  56.      */
  57.     @Override
  58.     public void setCellInfoListRate(int rateInMillis, Message response) {
  59.         if (RILJ_LOGD) riljLog("[STUB] > setCellInfoListRate");
  60.     }
  61.  
  62.     public void getImsRegistrationState(Message result) {
  63.         RILRequest rr = RILRequest.obtain(RIL_REQUEST_IMS_REGISTRATION_STATE, result);
  64.  
  65.         if (RILJ_LOGD) {
  66.             riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  67.         }
  68.         send(rr);
  69.     }
  70.  
  71.     public void setUiccSubscription(int slotId, int appIndex, int subId,
  72.             int subStatus, Message result) {
  73.         //Note: This RIL request is also valid for SIM and RUIM (ICC card)
  74.         RILRequest rr = RILRequest.obtain(RIL_REQUEST_SET_UICC_SUBSCRIPTION, result);
  75.  
  76.         if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)
  77.                 + " slot: " + slotId + " appIndex: " + appIndex
  78.                 + " subId: " + subId + " subStatus: " + subStatus);
  79.  
  80.         rr.mParcel.writeInt(slotId);
  81.         rr.mParcel.writeInt(appIndex);
  82.         rr.mParcel.writeInt(subId);
  83.         rr.mParcel.writeInt(subStatus);
  84.  
  85.         send(rr);
  86.     }
  87.  
  88.     public void setDataSubscription(Message result) {
  89.         RILRequest rr = RILRequest.obtain(RIL_REQUEST_SET_DATA_SUBSCRIPTION, result);
  90.         if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
  91.         send(rr);
  92.     }
  93.  
  94.     public void
  95.     getDataCallProfile(int appType, Message result) {
  96.         RILRequest rr = RILRequest.obtain(
  97.                 RIL_REQUEST_GET_DATA_CALL_PROFILE, result);
  98.  
  99.         // count of ints
  100.         rr.mParcel.writeInt(1);
  101.         rr.mParcel.writeInt(appType);
  102.  
  103.         if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)
  104.                 + " : " + appType);
  105.  
  106.         send(rr);
  107.     }
  108.  
  109. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement