1 /* 2 * Copyright (C) 2018 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.internal.telephony; 18 19 import android.os.AsyncResult; 20 import android.os.Trace; 21 22 import com.android.internal.telephony.uicc.IccSlotStatus; 23 import com.android.telephony.Rlog; 24 25 import java.util.ArrayList; 26 27 /** 28 * This class is the HIDL implementation of IRadioConfigIndication interface. 29 */ 30 public class RadioConfigIndicationHidl extends 31 android.hardware.radio.config.V1_2.IRadioConfigIndication.Stub { 32 private static final String TAG = "RadioConfigIndicationHidl"; 33 34 private final RadioConfig mRadioConfig; 35 RadioConfigIndicationHidl(RadioConfig radioConfig)36 public RadioConfigIndicationHidl(RadioConfig radioConfig) { 37 mRadioConfig = radioConfig; 38 } 39 40 /** 41 * Unsolicited indication for slot status changed 42 */ simSlotsStatusChanged(int indicationType, ArrayList<android.hardware.radio.config.V1_0.SimSlotStatus> slotStatus)43 public void simSlotsStatusChanged(int indicationType, 44 ArrayList<android.hardware.radio.config.V1_0.SimSlotStatus> slotStatus) { 45 ArrayList<IccSlotStatus> ret = RILUtils.convertHalSlotStatus(slotStatus); 46 logd("UNSOL_SIM_SLOT_STATUS_CHANGED " + ret.toString()); 47 if (mRadioConfig.mSimSlotStatusRegistrant != null) { 48 mRadioConfig.mSimSlotStatusRegistrant.notifyRegistrant( 49 new AsyncResult(null, ret, null)); 50 } 51 } 52 53 /** 54 * Unsolicited indication for slot status changed 55 */ simSlotsStatusChanged_1_2(int indicationType, ArrayList<android.hardware.radio.config.V1_2.SimSlotStatus> slotStatus)56 public void simSlotsStatusChanged_1_2(int indicationType, 57 ArrayList<android.hardware.radio.config.V1_2.SimSlotStatus> slotStatus) { 58 ArrayList<IccSlotStatus> ret = RILUtils.convertHalSlotStatus(slotStatus); 59 logd("UNSOL_SIM_SLOT_STATUS_CHANGED " + ret.toString()); 60 if (mRadioConfig.mSimSlotStatusRegistrant != null) { 61 mRadioConfig.mSimSlotStatusRegistrant.notifyRegistrant( 62 new AsyncResult(null, ret, null)); 63 } 64 } 65 logd(String log)66 private static void logd(String log) { 67 Rlog.d(TAG, "[UNSL]< " + log); 68 Trace.instantForTrack(Trace.TRACE_TAG_NETWORK, "RIL", log); 69 } 70 } 71