1 /* 2 * Copyright (C) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 #ifndef TELEPHONY_EXT_ICCFILE_EXT_H 16 #define TELEPHONY_EXT_ICCFILE_EXT_H 17 18 #include "inner_event.h" 19 #include "message_parcel.h" 20 #include "telephony_log_wrapper.h" 21 #include "telephony_errors.h" 22 23 namespace OHOS::Telephony { 24 class IIccFileExt { 25 public: 26 enum FileChangeType { 27 INVALID_FILE_OPE, 28 ICCID_FILE_LOAD, 29 GID1_FILE_LOAD, 30 GID2_FILE_LOAD, 31 SPN_FILE_LOAD, 32 C_IMSI_FILE_LOAD, 33 G_IMSI_FILE_LOAD, 34 G_MCCMNC_FILE_LOAD, 35 ALL_FILE_LOAD, 36 }; 37 38 using FileChangeType = IIccFileExt::FileChangeType; ~IIccFileExt()39 virtual ~IIccFileExt() 40 { 41 } 42 GetIccFile()43 std::weak_ptr<OHOS::Telephony::IIccFileExt>& GetIccFile() 44 { 45 return iccFile_; 46 } 47 48 virtual void SetIccFile(std::shared_ptr<OHOS::Telephony::IIccFileExt> &iccFile) = 0; 49 ClearData()50 virtual void ClearData() 51 { 52 } 53 LoadSimMatchedFileFromRilCache()54 virtual void LoadSimMatchedFileFromRilCache() 55 { 56 } 57 LoadSimMatchedFileFromRilCacheByEfid(int fileId)58 virtual void LoadSimMatchedFileFromRilCacheByEfid(int fileId) 59 { 60 } 61 AddRecordsToLoadNum()62 virtual void AddRecordsToLoadNum() 63 { 64 } 65 ExecutOriginalSimIoRequest(int32_t filedId,int fileIdDone)66 virtual bool ExecutOriginalSimIoRequest(int32_t filedId, int fileIdDone) 67 { 68 return false; 69 } 70 FileChange(const std::string fileStr,FileChangeType changeType)71 virtual bool FileChange(const std::string fileStr, FileChangeType changeType) 72 { 73 return false; 74 } 75 GetCachedFileResult(MessageParcel & data)76 virtual int32_t GetCachedFileResult(MessageParcel &data) 77 { 78 return Telephony::TELEPHONY_ERR_UNINIT; 79 } 80 GetCachedIccidResult(std::string & iccidResult)81 virtual int32_t GetCachedIccidResult(std::string &iccidResult) 82 { 83 return Telephony::TELEPHONY_ERR_UNINIT; 84 } 85 OnOpkeyLoad(const std::string opKey,const std::string opName)86 virtual void OnOpkeyLoad(const std::string opKey, const std::string opName) 87 { 88 } 89 ProcessExtGetFileDone(const AppExecFwk::InnerEvent::Pointer & event)90 virtual void ProcessExtGetFileDone(const AppExecFwk::InnerEvent::Pointer &event) 91 { 92 } 93 ProcessExtGetFileResponse()94 virtual void ProcessExtGetFileResponse() 95 { 96 } 97 98 protected: 99 std::weak_ptr<OHOS::Telephony::IIccFileExt> iccFile_; 100 }; 101 } // namespace OHOS::Telephony 102 #endif //TELEPHONY_EXT_ICCFILE_EXT_H