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.hardware.radio.config.V1_0.IRadioConfigIndication; 20 import android.hardware.radio.config.V1_0.SimSlotStatus; 21 import android.os.AsyncResult; 22 import android.telephony.Rlog; 23 24 import com.android.internal.telephony.uicc.IccSlotStatus; 25 26 import java.util.ArrayList; 27 28 /** 29 * This class is the implementation of IRadioConfigIndication interface. 30 */ 31 public class RadioConfigIndication extends IRadioConfigIndication.Stub { 32 private final RadioConfig mRadioConfig; 33 private static final String TAG = "RadioConfigIndication"; 34 35 public RadioConfigIndication(RadioConfig radioConfig) { 36 mRadioConfig = radioConfig; 37 } 38 39 /** 40 * Unsolicited indication for slot status changed 41 */ 42 public void simSlotsStatusChanged(int indicationType, ArrayList<SimSlotStatus> slotStatus) { 43 ArrayList<IccSlotStatus> ret = RadioConfig.convertHalSlotStatus(slotStatus); 44 Rlog.d(TAG, "[UNSL]< " + " UNSOL_SIM_SLOT_STATUS_CHANGED " + ret.toString()); 45 if (mRadioConfig.mSimSlotStatusRegistrant != null) { 46 mRadioConfig.mSimSlotStatusRegistrant.notifyRegistrant( 47 new AsyncResult(null, ret, null)); 48 } 49 } 50 } 51