/* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include #include "commonStructs.h" #include "debug.h" #include "structs.h" #include "collections.h" #define RADIO_MODULE "SimIndication" namespace android::hardware::radio::compat { namespace aidl = ::aidl::android::hardware::radio::sim; void RadioIndication::setResponseFunction(std::shared_ptr simCb) { mSimCb = simCb; } std::shared_ptr RadioIndication::simCb() { return mSimCb.get(); } Return RadioIndication::carrierInfoForImsiEncryption(V1_0::RadioIndicationType type) { LOG_CALL << type; simCb()->carrierInfoForImsiEncryption(toAidl(type)); return {}; } Return RadioIndication::cdmaSubscriptionSourceChanged( V1_0::RadioIndicationType type, V1_0::CdmaSubscriptionSource cdmaSource) { LOG_CALL << type; simCb()->cdmaSubscriptionSourceChanged(toAidl(type), aidl::CdmaSubscriptionSource(cdmaSource)); return {}; } Return RadioIndication::simPhonebookChanged(V1_0::RadioIndicationType type) { LOG_CALL << type; simCb()->simPhonebookChanged(toAidl(type)); return {}; } Return RadioIndication::simPhonebookRecordsReceived( V1_0::RadioIndicationType type, V1_6::PbReceivedStatus status, const hidl_vec& rec) { LOG_CALL << type; simCb()->simPhonebookRecordsReceived(toAidl(type), aidl::PbReceivedStatus(status), toAidl(rec)); return {}; } Return RadioIndication::simRefresh(V1_0::RadioIndicationType type, const V1_0::SimRefreshResult& refreshResult) { LOG_CALL << type; simCb()->simRefresh(toAidl(type), toAidl(refreshResult)); return {}; } Return RadioIndication::simStatusChanged(V1_0::RadioIndicationType type) { LOG_CALL << type; simCb()->simStatusChanged(toAidl(type)); return {}; } Return RadioIndication::stkEventNotify(V1_0::RadioIndicationType type, const hidl_string& cmd) { LOG_CALL << type; simCb()->stkEventNotify(toAidl(type), cmd); return {}; } Return RadioIndication::stkProactiveCommand(V1_0::RadioIndicationType type, const hidl_string& cmd) { LOG_CALL << type; simCb()->stkProactiveCommand(toAidl(type), cmd); return {}; } Return RadioIndication::stkSessionEnd(V1_0::RadioIndicationType type) { LOG_CALL << type; simCb()->stkSessionEnd(toAidl(type)); return {}; } Return RadioIndication::subscriptionStatusChanged(V1_0::RadioIndicationType type, bool activate) { LOG_CALL << type; simCb()->subscriptionStatusChanged(toAidl(type), activate); return {}; } Return RadioIndication::uiccApplicationsEnablementChanged(V1_0::RadioIndicationType type, bool enabled) { LOG_CALL << type; simCb()->uiccApplicationsEnablementChanged(toAidl(type), enabled); return {}; } } // namespace android::hardware::radio::compat