diff --git a/build-profile.json5 b/build-profile.json5 index 519659a..a658cd1 100644 --- a/build-profile.json5 +++ b/build-profile.json5 @@ -65,18 +65,6 @@ ] } ] - }, - { - "name": "simcardmanagement", - "srcPath": "./simcardmanagement", - "targets": [ - { - "name": "default", - "applyToProducts": [ - "default" - ] - } - ] } ] } \ No newline at end of file diff --git a/entry/src/main/ets/common/components/FuncBtnGroup.ets b/entry/src/main/ets/common/components/FuncBtnGroup.ets index 8ac45f5..ac00fd4 100644 --- a/entry/src/main/ets/common/components/FuncBtnGroup.ets +++ b/entry/src/main/ets/common/components/FuncBtnGroup.ets @@ -121,7 +121,6 @@ export default struct FuncBtnGroup { * @param {Object} callData - call data */ onCallStateChange(newVal) { - LogUtils.i(TAG, "Calling status changed newState : " + JSON.stringify(newVal)); const BtnName = ['video', 'record', 'add', 'contact', 'merge'] if (newVal === CallStateConst.CALL_STATUS_ACTIVE || newVal === CallStateConst.CALL_STATUS_HOLDING) { this.btnList.forEach((item) => { diff --git a/entry/src/main/ets/model/CallDataManager.ets b/entry/src/main/ets/model/CallDataManager.ets index 84f8b40..eedf62d 100644 --- a/entry/src/main/ets/model/CallDataManager.ets +++ b/entry/src/main/ets/model/CallDataManager.ets @@ -94,6 +94,10 @@ export default class CallDataManager { */ public update(callData) { const { callState, callId } = callData; + if (callId === undefined || callId === null) { + LogUtils.i(TAG, 'callId is not exist'); + return; + } const targetObj = this.callList.find((v) => v.callId === callId); LogUtils.i(TAG, "update :") if (targetObj) { diff --git a/hvigor/hvigor-config.json5 b/hvigor/hvigor-config.json5 index d1ed6c3..3ca9c50 100644 --- a/hvigor/hvigor-config.json5 +++ b/hvigor/hvigor-config.json5 @@ -13,8 +13,8 @@ * limitations under the License. */ { - "hvigorVersion": "2.0.0", + "hvigorVersion": "2.4.2", "dependencies": { - "@ohos/hvigor-ohos-plugin": "2.0.0" + "@ohos/hvigor-ohos-plugin": "2.4.2" } } diff --git a/simcardmanagement/.gitignore b/simcardmanagement/.gitignore deleted file mode 100644 index 4a65948..0000000 --- a/simcardmanagement/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/node_modules -/.preview -/build -/.cxx \ No newline at end of file diff --git a/simcardmanagement/build-profile.json5 b/simcardmanagement/build-profile.json5 deleted file mode 100644 index 73a89a8..0000000 --- a/simcardmanagement/build-profile.json5 +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (c) 2023 Huawei Device Co., Ltd. - * 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. - */ - -{ - "apiType": 'stageMode', - "buildOption": {"compileMode": "esmodule"}, - "entryModules": [ - "callui" - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/simcardmanagement/hvigorfile.js b/simcardmanagement/hvigorfile.js deleted file mode 100644 index fda93c7..0000000 --- a/simcardmanagement/hvigorfile.js +++ /dev/null @@ -1,2 +0,0 @@ -// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. -module.exports = require('@ohos/hvigor-ohos-plugin').hapTasks diff --git a/simcardmanagement/oh-package.json5 b/simcardmanagement/oh-package.json5 deleted file mode 100644 index 30aacdc..0000000 --- a/simcardmanagement/oh-package.json5 +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright (c) 2023 Huawei Device Co., Ltd. - * 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. - */ -{ - "license": "ISC", - "devDependencies": {}, - "name": "simcardmanagement", - "description": "example description", - "repository": {}, - "version": "1.0.0", - "dependencies": {} -} \ No newline at end of file diff --git a/simcardmanagement/src/main/ets/Application/MyAbilityStage.ts b/simcardmanagement/src/main/ets/Application/MyAbilityStage.ts deleted file mode 100644 index 750a5e8..0000000 --- a/simcardmanagement/src/main/ets/Application/MyAbilityStage.ts +++ /dev/null @@ -1,10 +0,0 @@ -import AbilityStage from "@ohos.app.ability.AbilityStage" -import LogUtils from '../common/utils/LogUtils' - -const TAG = "MyAbilityStage"; - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - LogUtils.i(TAG, 'onWindowStageDestroy'); - } -} \ No newline at end of file diff --git a/simcardmanagement/src/main/ets/MainAbility/MainAbility.ts b/simcardmanagement/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 711f8a6..0000000 --- a/simcardmanagement/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,44 +0,0 @@ -import Ability from '@ohos.app.ability.UIAbility' -import type Window from '@ohos.window'; -import LogUtils from '../common/utils/LogUtils' - -const TAG = "MainAbility"; - -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - LogUtils.i(TAG, 'onCreate'); - globalThis.simCardAbilityContext = this.context; - } - - onDestroy() { - LogUtils.i(TAG, 'onDestroy'); - } - - onWindowStageCreate(windowStage: Window.WindowStage): void { - // Main window is created, set main page for this ability - LogUtils.i(TAG, 'onWindowStageCreate'); - - windowStage.loadContent('pages/index', (err, data) => { - if (err.code) { - LogUtils.e(TAG, 'Failed to load the content. Cause:' + JSON.stringify(err)); - return; - } - LogUtils.e(TAG, 'Succeeded in loading the content. Data: ' + JSON.stringify(data)); - }); - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - LogUtils.i(TAG, 'onWindowStageDestroy'); - } - - onForeground() { - // Ability has brought to foreground - LogUtils.i(TAG, 'onForeground'); - } - - onBackground() { - // Ability has back to background - LogUtils.i(TAG, 'onBackground'); - } -} diff --git a/simcardmanagement/src/main/ets/common/components/cardInfomation.ets b/simcardmanagement/src/main/ets/common/components/cardInfomation.ets deleted file mode 100644 index a4315a4..0000000 --- a/simcardmanagement/src/main/ets/common/components/cardInfomation.ets +++ /dev/null @@ -1,688 +0,0 @@ -/** - * Copyright (c) 2023 Huawei Device Co., Ltd. - * 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 Licensef 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. - */ -import UpdataInfo from './dialog/upDataInfo'; -import StopSim from './dialog/stopSim'; -import EditSimInfo from './dialog/editSimInfo'; -import simServiceProxy from '../../model/simServiceProxy'; -import radioServiceProxy from '../../model/radioServiceProxy'; -import { registerSimStateChange, getMaxSimCount } from '../../model/registerSimStateApi'; -import dataServiceProxy from '../../model/dataServiceProxy'; -import LogUtils from '../../common/utils/LogUtils'; -import SimStateConst from '../utils/SimStateConst'; -import OperaNameStruct from '../struct/operaNameStruct'; -import SubscriberManager from '../utils/SubscriberManager'; - -const TAG = "cardInformation" - -class CardInfoStruct { - id - title - isOpened - disabled - name - info - isSimCardClosed -} - -@Component -export default struct eSimSet { - @Link list: Array; - @State flowCardId: number = 1; - @State phone1Number: string = ''; - @State phone2Number: string = ''; - @State title: Resource = $r('app.string.sim_card_one_no_space'); - @State curEditList: CardInfoStruct = new CardInfoStruct(); - @State isSimCardClosed: boolean = true; - @State simName: string = ''; - @State phoneNumber: string = ''; - @State isChange: boolean = true; - @State diaLing: number = 0; - @State upisChange: boolean = true; - @State isCancel: boolean = false; - @Link isCardChange: boolean; - @State upDataTitle: Resource = $r('app.string.sim_card_one_no_space'); - @State isStop1: boolean = true; - @State isStop2: boolean = true; - @State simCardStop: boolean = false; - @Link changeCard: boolean; - @Link isCardChange2: boolean; - @Link defaultSetString: Resource; - @StorageLink("operatorName") @Watch('updateOperatorName') operatorRes: OperaNameStruct = new OperaNameStruct(); - @Link isAirPlaneMode: boolean; - timer = null; - SIM_CARD_DEFAULT = 'sim_card_management_card_default_call'; - SIM_CARD_INFO = 'sim_card_management_storage_card_info'; - SIM_CARD_KEYWORD = 'sim_card_keyword'; - SIM_CARD_INFO2 = 'sim_card_management_storage_card_info2'; - SIM_CARD_Change = 'sim_card_management_card_change_boolean'; - SIM_CARD_STOP = 'sim_card_management_card_stop_boolean'; - SIM_CARD_DATA = 'sim_card_management_storage_card_data'; - SIM_LIST_DISABLED = 'sim_card_management_list_disabled'; - SIM_LIST_DISABLED2 = 'sim_card_management_list_disabled2'; - SIM_NAME1 = 'sim_card_name1'; - SIM_NAME2 = 'sim_card_name2'; - SIM_phoneNumber1 = 'sim_card_phoneNumber1'; - SIM_phoneNumber2 = 'sim_card_phoneNumber2'; - editSimInfo: CustomDialogController = new CustomDialogController({ - builder: EditSimInfo({ curEditList: this.curEditList, phoneNumber: $phoneNumber, - action: (simName, curEditList, phoneNumber) => { - if (curEditList.id === 0) { - if (simName !== 'null') { - this.list[0].name = simName; - } else { - this.getNetName(0); - }; - if (phoneNumber !== 'null') { - this.phone1Number = phoneNumber; - } else { - this.getPhoneNumber(0); - }; - } else { - if (simName !== 'null') { - this.list[1].name = simName; - } else { - this.getNetName(1); - }; - if (phoneNumber !== null) { - this.phone2Number = phoneNumber; - } else { - this.getPhoneNumber(1); - }; - } - this.isChange = !this.isChange; - } }), - alignment: DialogAlignment.Bottom, - autoCancel: false, - offset: { dx: 0, dy: -16 } - }) - stopSim: CustomDialogController = new CustomDialogController({ - builder: StopSim({ - curEditList: this.curEditList, - title: this.title, - isChange: $isChange, - cancel: (isChange) => { - this.isCancel = true; - if (this.curEditList.id === 0) { - this.list[0].isOpened = true; - } else { - this.list[1].isOpened = true; - }; - this.simCardStop = isChange; - }, - action: (stop) => { - this.defaultSetString = $r('app.string.sim_null_character'); - if (this.curEditList.id === 0) { - this.setSimActive(0, false) - this.list[0].name = $r('app.string.sim_not_enabled'); - this.isStop1 = false; - this.list[0].isOpened = false; - this.isStop2 = true; - this.changeCard = false; - this.isCardChange = false - } else { - this.changeCard = true; - this.setSimActive(1, false) - this.list[1].name = $r('app.string.sim_not_enabled'); - this.list[1].isOpened = false; - this.isStop1 = true; - this.isStop2 = false; - this.isCardChange = true; - }; - } - }), - alignment: DialogAlignment.Bottom, - autoCancel: false, - offset: { dx: 0, dy: -16 } - }) - updataInfo: CustomDialogController = new CustomDialogController({ - builder: UpdataInfo({ title: this.upDataTitle, isChange: this.upisChange }), - alignment: DialogAlignment.Bottom, - autoCancel: false, - offset: { dx: 0, dy: -30 } - }) - - edit(item) { - LogUtils.i(TAG, "onclick edit this.title:" + JSON.stringify(item.title)) - this.title = item.title; - this.curEditList = item; - if (item.id === 0) { - if (this.phone1Number) { - this.phoneNumber = this.phone1Number; - } else { - this.getNetName(0); - } - } else { - if (this.phone2Number) { - this.phoneNumber = this.phone2Number; - } else { - this.getNetName(1) - } - }; - this.editSimInfo.open(); - } - - stopCard(item, boolean) { - this.simCardStop = boolean; - if (!boolean) { - }; - this.upisChange = boolean; - item.isOpened = boolean; - }; - - UpdataInfo(v) { - clearTimeout(this.timer); - this.upisChange = v; - this.updataInfo.open(); - this.timer = setTimeout(() => { - this.updataInfo.close(); - }, 15000) - }; - - /** - * Get the customized mobile phone number set by the user - */ - getShowNumber(slotId) { - simServiceProxy.getShowNumber(slotId).then((res: string) => { - if (!slotId) { - if (res === 'null') { - this.getPhoneNumber(0) - } else { - this.phone1Number = res; - } - } else { - if (res === 'null') { - this.getPhoneNumber(1) - } else { - this.phone2Number = res; - } - }; - }).catch((err) => { - this.getPhoneNumber(slotId); - }) - } - - /** - * Get the custom operator name set by the user -- success - */ - getShowName(slotId) { - simServiceProxy.getShowName(slotId).then((res) => { - if (!slotId) { - if (res === 'null') { - this.getNetName(0) - } else { - this.list[slotId].name = res; - } - } else { - if (res === 'null') { - this.getNetName(1) - } else { - this.list[slotId].name = res; - } - }; - this.isChange = !this.isChange; - }).catch((err) => { - this.getNetName(slotId) - }) - } - - /** - * Get card slot operator name - */ - getNetName(slotId) { - radioServiceProxy.getOperatorName(slotId).then((res: string) => { - if (!slotId) { - this.list[slotId].name = res; - } else { - this.list[slotId].name = res; - } - this.isChange = !this.isChange - }).catch((err) => { - }) - } - - /** - * Whether there is a card - */ - hasSimCard(slotId) { - simServiceProxy.hasSimCard(slotId).then((res: boolean) => { - LogUtils.i(TAG, "getSimState: hasSimCard card : " + JSON.stringify(slotId) + " " + JSON.stringify(res)); - this.list[slotId].isSimCardClosed = res; - this.list[slotId] = { ...this.list[slotId] } - this.isChange = !this.isChange; - }).catch((err) => { - }) - } - - updateOperatorName() { - this.list[this.operatorRes.CUR_SLOT_ID].name = this.operatorRes.CUR_PLMN; - this.hasSimCard(0); - this.hasSimCard(1); - this.onInit(); - this.list[this.operatorRes.CUR_SLOT_ID] = { ...this.list[this.operatorRes.CUR_SLOT_ID] } - } - /** - * Get card status - */ - async getSimState(slotId) { - this.getSupportNetwork(slotId); - this.hasSimCard(slotId); - simServiceProxy.getSimState(slotId).then((res: number) => { - LogUtils.i(TAG, "getSimstate: id" + JSON.stringify(slotId) + JSON.stringify(res)); - if (res === SimStateConst.SIM_STATE_READY || res === SimStateConst.SIM_STATE_LOADED) { - this.list[slotId].disabled = true; - this.list[slotId].isOpened = true; - this.getShowName(slotId); - this.getShowNumber(slotId); - } else if (res === SimStateConst.SIM_STATE_NOT_READY || res === SimStateConst.SIM_STATE_LOCKED) { - this.list[slotId].name = $r('app.string.sim_no_service'); - this.list[slotId].isOpened = false; - this.getShowNumber(slotId); - } else if (res === SimStateConst.SIM_STATE_NOT_PRESENT) { - this.list[slotId].name = $r('app.string.sim_no_card_inserted'); - this.list[slotId].isOpened = false; - if (slotId) { - this.phone2Number = ''; - } else { - this.phone1Number = ''; - } - this.list[slotId].disabled = false; - this.list[slotId].info = '4G/3G/2G'; - } else { - this.list[slotId].info = '4G/3G/2G'; - this.list[slotId].disabled = false; - this.list[slotId].isOpened = false; - if (slotId) { - this.phone2Number = ''; - } else { - this.phone1Number = ''; - } - this.list[slotId].name = $r('app.string.sim_no_card_inserted'); - } - this.isChange = !this.isChange; - this.updataInfo.close(); - clearTimeout(this.timer) - }).catch((err) => { - this.list[slotId].name = $r('app.string.sim_no_card_inserted'); - if (slotId) { - this.phone2Number = ''; - } else { - this.phone1Number = ''; - } - this.list[slotId].disabled = false; - this.list[slotId].isOpened = false; - this.list[slotId].info = '4G/3G/2G'; - this.simCardStop = false; - }); - this.isChange = !this.isChange; - } - - onInit() { - this.getSimState(0); - this.getSimState(1); - } - - /** - * Get the phone number of sim card - */ - getPhoneNumber(slotId) { - simServiceProxy.getSimTelephoneNumber(slotId).then((res: string) => { - if (!slotId) { - this.phone1Number = res; - } else { - this.phone2Number = res; - } - }).catch(() => { - this.phone2Number = ''; - }) - } - - setSimActive(slotId, bool) { - simServiceProxy.setSimActive(slotId, bool).then((res) => { - if (bool) { - this.getShowName(slotId); - } else { - this.list[slotId].name = $r('app.string.sim_not_enabled'); - this.list[slotId].info = '4G/3G/2G'; - } - this.updataInfo.close(); - clearTimeout(this.timer); - }).catch((err) => { - }) - } - - /** - * Whether the sim card is activated - */ - isSimActive(slotId) { - simServiceProxy.isSimActive(slotId).then((res) => { - LogUtils.i(TAG, "isSimActive id" + JSON.stringify(slotId) + " " + JSON.stringify(res)); - if (!res && this.list[slotId].isSimCardClosed) { - this.list[slotId].isOpened = false; - this.list[slotId].name = $r('app.string.not_set'); - this.list[slotId].info = '4G/3G/2G'; - } else if (res && this.list[slotId].isSimCardClosed) { - this.list[slotId].isOpened = true; - this.getShowName(slotId); - this.getShowNumber(slotId); - this.list[slotId] = { ...this.list[slotId] }; - } - }).catch((err) => { - this.list[slotId].isOpened = false; - }); - } - - getSupportNetwork(slotId) { - radioServiceProxy.getSupportNetwork(slotId).then((res) => { - LogUtils.i(TAG, "4g/3g/2g/:" + JSON.stringify(slotId) + " " + JSON.stringify(res)); - if (res) { - this.list[slotId].info = '5G/4G/3G/2G'; - } else { - this.list[slotId].info = '4G/3G/2G'; - } - }).catch((err) => { - }); - } - - /** - * Get default voice - */ - getDefaultVoiceSlotId() { - simServiceProxy.getDefaultVoiceSlotId().then((res: number) => { - this.diaLing = res; - }).catch((err) => { - }) - } - - /** - * Set default voice - */ - setDefaultVoiceSlotId(slotId) { - simServiceProxy.setDefaultVoiceSlotId(slotId).catch((err) => { - }) - } - - addRegisterSimStateChange(slotId) { - registerSimStateChange(slotId, async () => { - this.getSimState(slotId); - this.isChange = !this.isChange; - this.simCardStop = this.list[0].isOpened && this.list[1].isOpened; - this.list[slotId] = { ...this.list[slotId] }; - this.editSimInfo.close(); - }) - } - - setDefaultDataSlotId(slotId) { - dataServiceProxy.setDefaultDataSlotId(slotId); - } - - aboutToAppear() { - LogUtils.i(TAG, "aboutToAppear"); - this.onInit(); - if (getMaxSimCount() === 2) { - this.addRegisterSimStateChange(1); - this.isSimActive(1); - } - this.addRegisterSimStateChange(0); - this.isSimActive(0); - this.isChange = !this.isChange; - } - - build() { - Column() { - Flex({ alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { - Row() { - Stack() { - Image($r('app.media.phone')).width(62).height(42) - Text(this.list[0].title) - .fontSize('12vp') - .fontColor('#333333') - .lineHeight(21) - .fontWeight(FontWeight.Regular) - .fontFamily("HarmonyHeiTi") - .margin({ right: 30 }) - } - - Column() { - Text(this.isAirPlaneMode ? $r('app.string.sim_no_service') : this.list[0].name) - .fontSize('16vp') - .margin({ - bottom: 2 - }) - .fontFamily("HarmonyHeiTi") - .fontWeight(FontWeight.Medium) - .lineHeight(22) - Text(this.phone1Number) - .fontColor('#555') - .fontSize('14vp') - .margin({ bottom: this.phone2Number ? 0 : 2 }) - .lineHeight(19) - .fontFamily("HarmonyHeiTi") - .fontWeight(FontWeight.Regular) - Text(this.list[0].info) - .fontColor(this.isChange ? '#555' : '#555') - .fontSize('14vp') - .lineHeight(19) - .fontFamily("HarmonyHeiTi") - .fontWeight(FontWeight.Regular) - } - .margin({ left: 16 }) - .opacity((this.list[0].isOpened && !this.isAirPlaneMode) ? 1 : 0.4) - - Image($r('app.media.redact')) - .width('15vp') - .height('15vp') - .onClick(() => { - this.edit(this.list[0]) - }) - .margin({ left: 20 }) - .enabled(this.list[0].isOpened && !this.isAirPlaneMode) - } - - Row() { - Toggle({ type: ToggleType.Switch, isOn: this.list[0].isOpened }) - .width(36) - .height(20) - .enabled(!this.isAirPlaneMode) - .onChange((isOn: boolean) => { - LogUtils.i(TAG, "onclick toggle card one") - this.getDefaultVoiceSlotId(); - this.list[0].isOpened = !this.list[0].isOpened; - this.upDataTitle = this.list[0].title; - if (!this.list[0].isOpened) { - if (this.diaLing == 0) { - this.setDefaultVoiceSlotId(-1) - this.setDefaultDataSlotId(1) - this.defaultSetString = $r('app.string.not_set'); - } - } - if (this.list[1].isOpened) { - if (!this.list[0].isOpened) { - if (this.isCardChange) { - this.title = $r('app.string.sim_card_one_no_space'); - this.curEditList = this.list[0]; - this.setDefaultDataSlotId(1); - this.stopSim.open(); - this.stopCard(this.list[0], false); - }; - }; - }; - if (this.list[0].isOpened && this.list[1].isOpened) { - this.UpdataInfo(true); - this.setSimActive(0, true) - this.stopCard(this.list[0], true); - } - if (!this.list[0].isOpened && this.list[1].isOpened && !this.isCardChange) { - this.setDefaultDataSlotId(1) - this.UpdataInfo(false); - this.setSimActive(0, false) - this.stopCard(this.list[0], false); - } - if (this.list[0].isOpened && !this.list[1].isOpened) { - this.UpdataInfo(true); - this.setSimActive(0, true) - this.changeCard = true; - } else if (!this.list[0].isOpened && !this.list[1].isOpened) { - this.UpdataInfo(false); - this.isCardChange = false; - this.setDefaultDataSlotId(1) - this.setSimActive(0, false) - this.list[0].name = $r('app.string.sim_not_enabled'); - this.stopCard(this.list[0], false); - } else if (!this.list[0].isOpened || !this.list[1].isOpened) { - this.stopCard(this.list[0], false); - } - this.isChange = !this.isChange; - }) - } - } - .opacity(this.list[0].isOpened && !this.isAirPlaneMode ? 1 : 0.6) - .enabled(this.list[0].disabled && !this.isAirPlaneMode) - .padding({ - left: 12, - right: 12, - top: 12, - bottom: 12 - }) - .height(104) - .width("100%") - .borderRadius($r('app.float.radius_16')) - .backgroundColor($r("sys.color.ohos_id_color_foreground_contrary")) - - Column() { - } - .height(16) - .width("100%") - - Flex({ alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { - Row() { - Stack() { - Image($r('app.media.phone')).width(62).height(42) - Text(this.list[1].title) - .fontSize('12vp') - .fontColor('#333333') - .align(Alignment.Start) - .lineHeight(21) - .fontWeight(FontWeight.Regular) - .fontFamily("HarmonyHeiTi") - .margin({ right: 30 }) - } - - Column() { - Text(this.isAirPlaneMode ? $r('app.string.sim_no_service') : this.list[1].name) - .fontSize('16vp') - .margin({ bottom: 2 }) - .fontFamily("HarmonyHeiTi") - .fontWeight(FontWeight.Medium) - .lineHeight(22) - Text(this.phone2Number) - .fontColor('#555') - .fontSize('14vp') - .margin({ bottom: this.phone2Number ? 0 : 2 }) - .lineHeight(19) - .fontFamily("HarmonyHeiTi") - .fontWeight(FontWeight.Regular) - Text(this.list[1].info) - .fontColor(this.isChange ? '#555' : '#555') - .fontSize('14vp') - .lineHeight(19) - .fontFamily("HarmonyHeiTi") - .fontWeight(FontWeight.Regular) - } - .margin({ left: 16 }) - .opacity((this.list[1].isOpened && !this.isAirPlaneMode) ? 1 : 0.4) - - Image($r('app.media.redact')) - .width('12vp') - .height('12vp') - .onClick(() => { - this.edit(this.list[1]); - }) - .margin({ left: 4 }) - .enabled(this.list[1].isOpened && !this.isAirPlaneMode) - } - - Row() { - Toggle({ type: ToggleType.Switch, isOn: this.list[1].isOpened }) - .width(36) - .height(20) - .enabled(!this.isAirPlaneMode) - .onChange((isOn: boolean) => { - LogUtils.i(TAG, "onclick toggle card two") - this.getDefaultVoiceSlotId(); - this.list[1].isOpened = !this.list[1].isOpened; - this.upDataTitle = this.list[1].title; - if (!this.list[1].isOpened) { - if (this.diaLing == 0) { - this.setDefaultDataSlotId(0) - this.setDefaultVoiceSlotId(-1) - this.defaultSetString = $r('app.string.not_set'); - } - } - if (this.list[0].isOpened) { - if (!this.list[1].isOpened) { - if (!this.isCardChange) { - this.setDefaultDataSlotId(0) - this.title = $r('app.string.sim_card_two_no_space'); - this.curEditList = this.list[1]; - this.stopSim.open(); - this.stopCard(this.list[1], false); - }; - }; - }; - if (this.list[0].isOpened && this.list[1].isOpened) { - this.UpdataInfo(true); - this.setSimActive(1, true); - this.stopCard(this.list[1], true); - } - if (this.list[0].isOpened && !this.list[1].isOpened && this.isCardChange) { - this.setDefaultDataSlotId(0) - this.UpdataInfo(false); - this.setSimActive(1, false); - this.stopCard(this.list[1], false); - } - if (!this.list[0].isOpened && this.list[1].isOpened) { - this.UpdataInfo(true); - this.setSimActive(1, true); - this.changeCard = true; - } else if (!this.list[0].isOpened && !this.list[1].isOpened) { - this.setDefaultDataSlotId(0) - this.UpdataInfo(false); - this.isCardChange = false; - this.setSimActive(1, false); - this.list[1].name = $r('app.string.sim_not_enabled'); - this.stopCard(this.list[1], false); - } else if (!this.list[0].isOpened || !this.list[1].isOpened) { - this.stopCard(this.list[1], false); - } - this.isChange = !this.isChange; - }) - } - } - .height(104) - .opacity(this.list[1].isOpened && !this.isAirPlaneMode ? 1 : 0.6) - .enabled(this.list[1].disabled && !this.isAirPlaneMode) - .padding({ - left: 12, - right: 12, - top: 12, - bottom: 12 - }) - .width("100%") - .backgroundColor($r("sys.color.ohos_id_color_foreground_contrary")) - .borderRadius($r('app.float.radius_16')) - } - .width('100%') - } -} diff --git a/simcardmanagement/src/main/ets/common/components/defaultCard.ets b/simcardmanagement/src/main/ets/common/components/defaultCard.ets deleted file mode 100644 index 1b2acd5..0000000 --- a/simcardmanagement/src/main/ets/common/components/defaultCard.ets +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Copyright (c) 2023 Huawei Device Co., Ltd. - * 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. - */ - -/** - * DefaultCard component - */ -@Component -export default struct DefaultCard { - @State cardTextBackgrounColor: string = " #0A59F7"; - @State cardName: Resource = $r('app.string.card_1'); - @State cardTextColor: string = "#FFFFFF" - - build() { - Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { - Text(this.cardName) - .fontSize(14) - .fontWeight(FontWeight.Medium) - .fontFamily("HarmonyHeiTi") - .lineHeight(16) - .fontColor(this.cardTextColor) - .align(Alignment.Center) - } - .width(65) - .height(28) - .borderRadius(50) - .backgroundColor(this.cardTextBackgrounColor) - } -} \ No newline at end of file diff --git a/simcardmanagement/src/main/ets/common/components/dialog/defalutDialing.ets b/simcardmanagement/src/main/ets/common/components/dialog/defalutDialing.ets deleted file mode 100644 index 0c970b6..0000000 --- a/simcardmanagement/src/main/ets/common/components/dialog/defalutDialing.ets +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * 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. - */ -import simServiceProxy from '../../../model/simServiceProxy' -import LogUtils from '../../../common/utils/LogUtils' - -const TAG = "DefaultDialCard:" - -@CustomDialog -export default struct DefaultDialCard { - controller: CustomDialogController; - action: (cardname) => void; - @Link defaultSet: Resource; - @State changeDefault: boolean = true; - @State changeCard1: boolean = false; - @State changeCard2: boolean = false; - @State phoneNumber1: string = ''; - @State phoneNumber2: string = ''; - SIM_CARD_DEFAULT = 'sim_card_management_card_default_call'; - SIM_CARD_KEYWORD = 'sim_card_keyword'; - - /** - * Get the phone number of sim card - */ - getPhoneNumber(slotId) { - simServiceProxy.getSimTelephoneNumber(slotId).then((res: string) => { - if (!slotId) { - this.phoneNumber1 = res; - } else { - this.phoneNumber2 = res; - } - }).catch((err) => { - }); - } - - /** - * Get the customized mobile phone number set by the user - */ - getShowNumber(slotId) { - simServiceProxy.getShowNumber(slotId).then((res: string) => { - if (res !== 'null') { - if (!slotId) { - this.phoneNumber1 = res; - } else { - this.phoneNumber2 = res; - } - } else { - this.getPhoneNumber(slotId); - } - }).catch((err) => { - }); - } - - /** - * Set default voice - */ - setDefaultVoiceSlotId(slotId) { - simServiceProxy.setDefaultVoiceSlotId(slotId).then((res) => { - if (res) { - if (slotId === -1) { - this.action($r('app.string.not_set')); - } else if (slotId === 0) { - this.action($r('app.string.sim_card_one_no_space')); - } else if (slotId === 1) { - this.action($r('app.string.sim_card_two_no_space')); - } - } - }).catch((err) => { - }); - } - - aboutToAppear() { - LogUtils.i(TAG, "aboutToAppear:") - this.getShowNumber(0); - this.getShowNumber(1); - } - - build() { - Column() { - Flex({ direction: FlexDirection.Column }) { - Text($r('app.string.default_dial_card')) - .fontSize('20vp') - .fontColor('rgba(0, 0, 0, 0.9)') - .textAlign(TextAlign.Start) - .lineHeight(56) - .fontWeight(FontWeight.Medium) - .fontFamily("HarmonyHeiTi") - .align(Alignment.Start) - Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { - Text($r('app.string.not_set')) - .fontSize($r('sys.float.ohos_id_text_size_body2')) - .fontWeight(FontWeight.Regular) - .fontFamily("HarmonyHeiTi") - .align(Alignment.Center | Alignment.Start) - .lineHeight(21) - Image(JSON.stringify(this.defaultSet) === JSON.stringify($r('app.string.not_set')) ? $r('app.media.ic_Radiobtn_on') : $r('app.media.ic_Radiobtn_off')) - .height(24) - .width(24) - }.height(48) - .onClick(() => { - this.setDefaultVoiceSlotId(-1); - this.controller.close(); - }) - - Divider().vertical(false).strokeWidth(0.5).color('#ccc') - Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { - Column() { - Text($r('app.string.card_1')) - .fontSize($r('sys.float.ohos_id_text_size_body2')) - .fontWeight(FontWeight.Regular) - .fontFamily("HarmonyHeiTi") - .align(Alignment.Start) - .lineHeight(22) - Text(this.phoneNumber1) - .fontSize(16) - .fontWeight(FontWeight.Medium) - .fontFamily("HarmonyHeiTi") - .align(Alignment.Start) - .lineHeight(19) - .fontColor($r('sys.color.ohos_id_color_text_secondary')) - }.alignItems(HorizontalAlign.Start) - - Column() { - Image(JSON.stringify(this.defaultSet) == JSON.stringify($r('app.string.sim_card_one_no_space')) ? $r('app.media.ic_Radiobtn_on') : $r('app.media.ic_Radiobtn_off')) - .height(24) - .width(24) - } - }.height(64) - .onClick(() => { - this.setDefaultVoiceSlotId(0) - this.controller.close(); - }) - - Divider().vertical(false).strokeWidth(0.5).color('#ccc') - Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { - Column() { - Text($r('app.string.card_2')) - .fontSize($r('sys.float.ohos_id_text_size_body2')) - .fontWeight(FontWeight.Regular) - .fontFamily("HarmonyHeiTi") - .align(Alignment.Start) - .lineHeight(22) - Text(this.phoneNumber2) - .fontSize(16) - .fontWeight(FontWeight.Medium) - .fontFamily("HarmonyHeiTi") - .align(Alignment.Start) - .lineHeight(19) - .fontColor($r('sys.color.ohos_id_color_text_secondary')) - }.alignItems(HorizontalAlign.Start) - - Column() { - Image(JSON.stringify(this.defaultSet) == JSON.stringify($r('app.string.sim_card_two_no_space')) ? $r('app.media.ic_Radiobtn_on') : $r('app.media.ic_Radiobtn_off')) - .height(24) - .width(24) - } - }.height(64) - .onClick(() => { - this.setDefaultVoiceSlotId(1) - this.controller.close(); - }) - - Divider().vertical(false).strokeWidth(0.5).color('#ccc') - Flex({ justifyContent: FlexAlign.SpaceAround, alignItems: ItemAlign.Center }) { - Text($r('app.string.cancel')) - .fontSize('16vp') - .fontWeight(FontWeight.Medium) - .fontFamily("HarmonyHeiTi") - .fontColor($r('sys.color.ohos_id_color_text_primary')) - } - .onClick(() => { - this.controller.close(); - }) - .height(56) - } - } - .height(297) - .padding({ left: 24, right: 24 }) - } -} \ No newline at end of file diff --git a/simcardmanagement/src/main/ets/common/components/dialog/editSimInfo.ets b/simcardmanagement/src/main/ets/common/components/dialog/editSimInfo.ets deleted file mode 100644 index 5cd2395..0000000 --- a/simcardmanagement/src/main/ets/common/components/dialog/editSimInfo.ets +++ /dev/null @@ -1,240 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * 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. - */ -import { REGULAR } from '../../../common/utils/constant' -import simServiceProxy from '../../../model/simServiceProxy' -import radioServiceProxy from '../../../model/radioServiceProxy' -import LogUtils from '../../utils/LogUtils' -import { getString } from '../../utils/Utils' - -const TAG = "EditSimInfo" - -class CardInfoStruct { - id - title - isOpened - disabled - name - info - isSimCardClosed -} - -@CustomDialog -export default struct EditSimInfo { - controller: CustomDialogController; - action: (simName, curEditList, phoneNumber) => void; - disabledState: true; - inputVal: ''; - isShow: true; - curEditList: CardInfoStruct = new CardInfoStruct(); - MinLength: number = 0; - MaxLength: number = 17; - @State simName: string = ''; - @State isChange: boolean = true; - @State phoneNumber: string = ''; - SIM_NAME1 = 'sim_card_name1'; - SIM_NAME2 = 'sim_card_name2'; - SIM_phoneNumber1 = 'sim_card_phoneNumber1'; - SIM_phoneNumber2 = 'sim_card_phoneNumber2'; - - /** - * Set user's custom operator name - */ - setShowName(slotId, name) { - simServiceProxy.setShowName(slotId, name).then((res) => { - if (res) { - this.getShowName(slotId); - } - }).catch(() => { - }) - } - - /** - * Get the custom operator name set by the user -- success - */ - getShowName(slotId) { - simServiceProxy.getShowName(slotId).then((res: string) => { - if (res !== 'null') { - this.simName = res; - } - ; - }).catch(() => { - }) - } - - /** - * Get the customized mobile phone number set by the user - */ - getShowNumber(slotId) { - simServiceProxy.getShowNumber(slotId).then((res: string) => { - if (res !== 'null') { - this.phoneNumber = res; - } else { - this.getPhoneNumber(slotId); - } - }).catch(() => { - }) - } - - /** - * Set user's customized mobile phone number - */ - setShowNumber(slotId, phoneNumber) { - simServiceProxy.setShowNumber(slotId, phoneNumber).then(() => { - }).catch((err) => { - }) - } - - /** - * Get card slot operator name - */ - getNetName(slotId) { - radioServiceProxy.getOperatorName(slotId).then((res: string) => { - if (!slotId) { - this.simName = res; - } else { - this.simName = res; - } - }).catch((err) => { - }) - } - - getPhoneNumber(slotId) { - simServiceProxy.getSimTelephoneNumber(slotId).then((res: string) => { - this.phoneNumber = res; - }).catch((err) => { - }) - } - - aboutToAppear() { - LogUtils.i(TAG, "this.curentList:" + JSON.stringify(this.curEditList)); - if (this.curEditList.id === 0) { - LogUtils.i(TAG, "this.curentList id:" + JSON.stringify(this.curEditList.id)); - this.getShowName(0); - this.getShowNumber(0); - } else { - this.getShowName(1); - this.getShowNumber(1); - } - this.isChange = !this.isChange; - } - - build() { - Column() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Start }) { - Text($r('app.string.sim_edit', `${getString(this.curEditList.title)}`)) - .fontWeight(FontWeight.Medium) - .fontFamily('HarmonyHeiTi') - .fontSize('20vp') - .fontColor('rgba(0, 0, 0, 0.9)') - .lineHeight(56) - .margin({ left: 12, right: 12 }) - - TextInput({ text: this.simName, placeholder: $r('app.string.sim_card_name') }) - .maxLength(20) - .height(48) - .placeholderFont({ size: 16, family: 'HarmonyHeiTi' }) - .fontWeight(FontWeight.Regular) - .backgroundColor($r("sys.color.ohos_id_color_list_card_bg")) - .onChange((value: string) => { - this.simName = value; - LogUtils.i(TAG, "simName: " + JSON.stringify(this.simName)) - }) - Divider().vertical(false).strokeWidth(0.5).color('#ccc') - TextInput({ text: this.phoneNumber, placeholder: $r('app.string.sim_phone_number') }) - .maxLength(15) - .height(48) - .placeholderFont({ size: 16, family: 'HarmonyHeiTi' }) - .fontWeight(FontWeight.Regular) - .backgroundColor($r("sys.color.ohos_id_color_list_card_bg")) - .onChange((v: string) => { - let inputString = v.match(REGULAR.regular); - this.phoneNumber = ''; - if (inputString != null) { - this.phoneNumber = inputString.join(''); - } - ; - this.isChange = !this.isChange; - }) - Divider().vertical(false).strokeWidth(0.5).color('#ccc') - Flex({ justifyContent: FlexAlign.SpaceAround }) { - Text($r('app.string.cancel')) - .fontSize(16) - .fontWeight(FontWeight.Medium) - .fontFamily("HarmonyHeiTi") - .lineHeight(21) - .fontColor($r('sys.color.ohos_id_color_text_primary_activated')) - .onClick(() => { - this.controller.close(); - this.phoneNumber = ''; - this.simName = ''; - }) - Divider().vertical(true).height(0.5).strokeWidth(1).opacity(0.5) - Text($r('app.string.confirm')) - .fontSize(16) - .fontColor($r('sys.color.ohos_id_color_text_primary_activated')) - .fontWeight(FontWeight.Medium) - .fontFamily("HarmonyHeiTi") - .lineHeight(21) - .onClick(() => { - if (this.phoneNumber == '+') { - this.controller.close(); - return; - } - if (this.curEditList.id === 0) { - if (!this.phoneNumber) { - LogUtils.i(TAG, "onclick edit confim : ") - this.phoneNumber = 'null'; - this.setShowNumber(0, 'null'); - } else { - LogUtils.i(TAG, "onclick edit cancel : ") - this.setShowNumber(0, this.phoneNumber); - } - if (!this.simName) { - this.simName = 'null'; - this.setShowName(0, 'null'); - } else { - this.setShowName(0, this.simName); - } - this.action(this.simName, this.curEditList, this.phoneNumber); - } else { - if (!this.phoneNumber) { - this.phoneNumber = 'null' - this.setShowNumber(1, 'null'); - } else { - this.setShowNumber(1, this.phoneNumber); - } - if (!this.simName) { - this.simName = 'null'; - this.setShowName(1, 'null'); - } else { - this.setShowName(1, this.simName); - } - this.action(this.simName, this.curEditList, this.phoneNumber); - } - this.isChange = !this.isChange; - this.controller.close() - }) - .fontColor(this.isChange ? '#2871d4' : '#2871d4') - } - .margin({ left: 12, right: 12, top: 18 }) - .height(56) - } - } - .height(216) - .padding({ left: 24, right: 24 }) - .backgroundColor($r("sys.color.ohos_id_color_list_card_bg")) - .borderRadius(26) - } -} \ No newline at end of file diff --git a/simcardmanagement/src/main/ets/common/components/dialog/setFlowLimit.ets b/simcardmanagement/src/main/ets/common/components/dialog/setFlowLimit.ets deleted file mode 100644 index a19702c..0000000 --- a/simcardmanagement/src/main/ets/common/components/dialog/setFlowLimit.ets +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * 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. - */ -import { getString } from '../../utils/Utils' - -@CustomDialog -export default struct SetFlowLimit { - controller: CustomDialogController; - action: () => void; - change: boolean = null; - - build() { - Column() { - Flex({ direction: FlexDirection.Column }) { - Text($r('app.string.sim_package_limit', `${this.change ? getString($r('app.string.sim_card_one_no_space')) : getString($r('app.string.sim_card_two_no_space')) }`)) - .fontWeight(600) - .fontSize('28vp') - .fontColor('rgba(0, 0, 0, 0.9)') - .height('50vp') - .textAlign(TextAlign.Start) - Text($r('app.string.sim_additional_costs', `${this.change ? getString($r('app.string.sim_card_two_no_space')) : getString($r('app.string.sim_card_one_no_space')) }`)) - .fontSize('24vp') - .textAlign(TextAlign.Start) - .margin({ bottom: 20 }) - Flex({ justifyContent: FlexAlign.SpaceAround }) { - Button($r('app.string.cancel')) - .fontSize('24vp') - .onClick(() => { - this.controller.close(); - this.action(); - }).backgroundColor(0xffffff).fontColor('#2871d4') - Divider().vertical(true).height(1).strokeWidth(1).lineCap(LineCapStyle.Round).opacity(0.5) - Button($r('app.string.go_to_set')) - .fontSize('24vp') - .onClick(() => { - this.controller.close(); - this.action(); - }).backgroundColor(0xffffff).fontColor('#2871d4') - } - } - .height(200) - } - .padding(24) - } -} diff --git a/simcardmanagement/src/main/ets/common/components/dialog/stopSim.ets b/simcardmanagement/src/main/ets/common/components/dialog/stopSim.ets deleted file mode 100644 index db7a199..0000000 --- a/simcardmanagement/src/main/ets/common/components/dialog/stopSim.ets +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * 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. - */ -import { getString } from '../../utils/Utils' - -class CardInfoStruct { - id - title - isOpened - disabled - name - info - isSimCardClosed -} - -@CustomDialog -export default struct StopSim { - controller: CustomDialogController; - action: (stop) => void; - curEditList: CardInfoStruct = new CardInfoStruct(); - title: Resource = $r('app.string.sim_card_one_no_space'); - cancel: (boolean) => void; - @State isChange: boolean = false; - SIM_CARD_Change = 'sim_card_management_card_change_boolean'; - SIM_CARD_DEFAULT = 'sim_card_management_card_default_call'; - - build() { - Column() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Start }) { - Text(`${getString($r('app.string.stop_use'))}${getString(this.curEditList.title)}`) - .fontWeight(FontWeight.Medium) - .fontFamily("HarmonyHeiTi") - .fontSize('20vp') - .fontColor('rgba(0, 0, 0, 0.9)') - .height(56) - .textAlign(TextAlign.Start) - Text($r('app.string.sim_mobile_data_change', `${this.curEditList.id === 0 ? getString($r('app.string.sim_card_two_no_space')) : getString($r('app.string.sim_card_one_no_space'))}`, `${getString(this.curEditList.title)}`)) - .fontSize($r('sys.float.ohos_id_text_size_body1')) - .fontWeight(FontWeight.Regular) - .textAlign(TextAlign.Start) - Flex({ justifyContent: FlexAlign.SpaceAround }) { - Text($r('app.string.cancel')) - .fontSize($r('sys.float.ohos_id_text_size_button1')) - .onClick(() => { - this.isChange = true; - this.controller.close(); - this.cancel(true); - }) - .fontWeight(FontWeight.Medium) - .fontFamily("HarmonnyHeiTi") - .lineHeight(21) - .fontColor($r('sys.color.ohos_id_color_text_primary_activated')) - Divider() - .vertical(true) - .height(1) - .strokeWidth(1) - .lineCap(LineCapStyle.Round) - .opacity(0.5) - Text($r('app.string.stop_use')) - .fontSize($r('sys.float.ohos_id_text_size_button1')) - .onClick(() => { - this.isChange = false; - this.controller.close(); - this.action(false); - }) - .fontWeight(FontWeight.Medium) - .fontFamily("HarmonnyHeiTi") - .lineHeight(21) - .fontColor($r('sys.color.ohos_id_color_text_primary_activated')) - } - .height(56) - .margin({ top: 8 }) - .padding({ top: 12 }) - } - } - .height(180) - .padding({ left: 24, right: 24 }) - } -} - diff --git a/simcardmanagement/src/main/ets/common/components/dialog/upDataInfo.ets b/simcardmanagement/src/main/ets/common/components/dialog/upDataInfo.ets deleted file mode 100644 index 80ef2b9..0000000 --- a/simcardmanagement/src/main/ets/common/components/dialog/upDataInfo.ets +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * 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. - */ -import { getString } from '../../utils/Utils' - -@CustomDialog -export default struct UpdataInfo { - controller: CustomDialogController; - action: () => void; - title: Resource = $r('app.string.sim_card_one_no_space'); - cancel: () => void; - isChange: boolean; - - build() { - Column() { - Text($r('app.string.sim_stop_information', `${!this.isChange ? getString($r('app.string.stop_use')) : getString($r('app.string.sim_enabled'))}`, `${getString(this.title)}`)) - .height('98vp') - .fontWeight(FontWeight.Medium) - .fontFamily('HarmonyHeiTi') - .fontSize('20vp') - .fontColor('rgba(0, 0, 0, 0.9)') - } - .alignItems(HorizontalAlign.Start) - .padding({ left: '24pv' }) - .width('100%') - } -} \ No newline at end of file diff --git a/simcardmanagement/src/main/ets/common/components/headComponent.ets b/simcardmanagement/src/main/ets/common/components/headComponent.ets deleted file mode 100644 index 4cd5cd3..0000000 --- a/simcardmanagement/src/main/ets/common/components/headComponent.ets +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Copyright (c) 2023 Huawei Device Co., Ltd. - * 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. - */ - -/** - * head custom component - */ -@Component -export default struct HeadComponent { - @State isTouch: boolean = false; - @State headName: Resource = $r('app.string.sim_headName'); - - build() { - Row() { - Stack({ alignContent: Alignment.Center }) { - Image($r('app.media.ic_back')) - .width(24) - .height(24) - .fillColor($r("sys.color.ohos_id_color_primary")) - } - .margin({ right: 16 }) - .backgroundColor(this.isTouch ? $r('app.color.color_E3E3E3_grey') : $r('app.color.color_00000000_transparent')) - .onClick(() => { - globalThis.simCardAbilityContext?.terminateSelf().then((data) => { - }); - }) - .onTouch((event: TouchEvent) => { - if (event.type === TouchType.Down) { - this.isTouch = true; - } - if (event.type === TouchType.Up) { - this.isTouch = false; - } - }); - - Text(this.headName) - .fontSize(20) - .fontFamily('HarmonyHeiTi-Bold') - .fontWeight(FontWeight.Medium) - .fontColor($r('sys.color.ohos_id_color_text_primary')) - .maxLines(1) - .textOverflow({ overflow: TextOverflow.Ellipsis }) - .textAlign(TextAlign.Start) - .margin({ top: 15, bottom: 15 }); - } - .width("100%") - .padding({ left: 12 }) - .height(56) - .alignItems(VerticalAlign.Center) - .align(Alignment.Start) - } -} \ No newline at end of file diff --git a/simcardmanagement/src/main/ets/common/config/cardInfoData.ets b/simcardmanagement/src/main/ets/common/config/cardInfoData.ets deleted file mode 100644 index 33241d4..0000000 --- a/simcardmanagement/src/main/ets/common/config/cardInfoData.ets +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * 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. - */ - -/** - * @file: Card information init - */ - -import { CARD_NET_SUPPORT } from '../utils/constant'; - -export default { - // card title - title: '', - // card name - name: 'strings.noCardInserted', - updateName: '', - // card number - number: '', - updateNumber: '', - // is contain this card - isOpened: false, - // is or isn't opened - disabled: true, - id: 0, - netSupport: CARD_NET_SUPPORT.NO_SUPPORT_5G -}; \ No newline at end of file diff --git a/simcardmanagement/src/main/ets/common/config/cardSetData.ets b/simcardmanagement/src/main/ets/common/config/cardSetData.ets deleted file mode 100644 index 26437b0..0000000 --- a/simcardmanagement/src/main/ets/common/config/cardSetData.ets +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * 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. - */ - -/** - * @file: Card set data init - */ - -export default { - dataBy: 0, - isChangeDataCard: false, - callBy: 0, - card1Forward: false, - card2Forward: false -}; \ No newline at end of file diff --git a/simcardmanagement/src/main/ets/common/struct/operaNameStruct.ets b/simcardmanagement/src/main/ets/common/struct/operaNameStruct.ets deleted file mode 100644 index 033aac5..0000000 --- a/simcardmanagement/src/main/ets/common/struct/operaNameStruct.ets +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (c) 2023 Huawei Device Co., Ltd. - * 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. - */ -export default class CardInfoStruct { - CUR_PLMN - CUR_PLMN_SHOW - CUR_SLOT_ID - CUR_SPN - CUR_SPN_SHOW - moduleName -} \ No newline at end of file diff --git a/simcardmanagement/src/main/ets/common/utils/AirplaneMode.ets b/simcardmanagement/src/main/ets/common/utils/AirplaneMode.ets deleted file mode 100644 index 366d2b1..0000000 --- a/simcardmanagement/src/main/ets/common/utils/AirplaneMode.ets +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Copyright (c) 2023 Huawei Device Co., Ltd. - * 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. - */ -/** - * Message/AirplaneMode utils - */ -const SETTING_AIRPLANE_MODE_URI = 'datashare:///com.ohos.settingsdata/entry/settingsdata/SETTINGSDATA?Proxy=true'; -const QUERY_AIRPLANE_MODE_KEY = 'airplane_mode'; -const TAG = 'AirplaneMode'; - -import dataShare from '@ohos.data.dataShare'; -import dataSharePredicates from '@ohos.data.dataSharePredicates'; -import LogUtils from './LogUtils'; - -let dataShareHelper; - -/** - * add AirPlaneMode Listener. - */ -export function addAirPlaneModeListener(callback) { - LogUtils.i(TAG, 'addAirPlaneModeListener'); - try { - dataShare.createDataShareHelper(globalThis.simCardAbilityContext, SETTING_AIRPLANE_MODE_URI, (err, data) => { - if (err != undefined) { - LogUtils.e(TAG, 'addAirPlaneModeListener error: code: ' + err.code + ', message: ' + err.message); - return; - } - dataShareHelper = data; - try { - dataShareHelper.on('dataChange', SETTING_AIRPLANE_MODE_URI, () => { - LogUtils.i(TAG, 'addAirPlaneModeListener dataChange'); - queryAirPlaneMode(callback); - }); - queryAirPlaneMode(callback); - } catch (err) { - LogUtils.e(TAG, 'addAirPlaneModeListener error: code: ' + err.code + ', message: ' + err.message); - } - }); - } catch (err) { - LogUtils.e(TAG, 'addAirPlaneModeListener error: code: ' + err.code + ', message: ' + err.message); - } -} - -/** - * remove AirPlaneMode Listener. - */ -export function removeAirPlaneModeListener() { - LogUtils.i(TAG, 'removeAirPlaneModeListener'); - if (!dataShareHelper) { - LogUtils.e(TAG, 'removeAirPlaneModeListener dataShareHelper null'); - return; - } - try { - dataShareHelper.off('dataChange', SETTING_AIRPLANE_MODE_URI, () => { - LogUtils.i(TAG, 'removeAirPlaneModeListener dataChange'); - }); - } catch (err) { - LogUtils.e(TAG, 'removeAirPlaneModeListener error: code: ' + err.code + ', message: ' + err.message); - } -} - -/** - * query AirPlaneMode. - */ -export function queryAirPlaneMode(callback) { - LogUtils.i(TAG, 'queryAirPlaneMode '); - if (!dataShareHelper) { - LogUtils.e(TAG, 'queryAirPlaneMode dataShareHelper null'); - return; - } - let condition = new dataSharePredicates.DataSharePredicates(); - condition.equalTo('KEYWORD', 'airplane_mode'); - try { - // ID, KEYWORD, VALUE - dataShareHelper.query(SETTING_AIRPLANE_MODE_URI, condition, null).then((data) => { - LogUtils.i(TAG, 'queryAirPlaneMode query succeed'); - if (data && data.goToFirstRow()) { - LogUtils.i(TAG, 'queryAirPlaneMode query succeed return key'); - callback(data.getLong(data.getColumnIndex('VALUE'))); - return; - } - callback(-1); - }).catch((err) => { - LogUtils.e(TAG, 'queryAirPlaneMode query in error: err: ' + JSON.stringify(err)); - }); - } catch (err) { - LogUtils.e(TAG, 'queryAirPlaneMode query out error: code: ' + err.code + ', message: ' + err.message); - } -} \ No newline at end of file diff --git a/simcardmanagement/src/main/ets/common/utils/LogUtils.ts b/simcardmanagement/src/main/ets/common/utils/LogUtils.ts deleted file mode 100644 index 2efece3..0000000 --- a/simcardmanagement/src/main/ets/common/utils/LogUtils.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Copyright (c) 2022 Huawei Device Co., Ltd. - * 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. - */ - -/** - * Log Util - * - * standard: - * 1. define TAG, recommend class name. - * 2. switch IS_DEBUG_ON as true, when debugging. - * 3. msg should be short and valuable. - * 4. choose appropriate function. - * 5. the function execute many times can not print. - * 6. uniqueness. - */ - -/** - * log package tool class - */ -export class LogUtils { - d(TAG, msg): void { - console.debug('[simcardmanagement:]' + TAG + ':' + msg); - } - - i(TAG, msg): void { - console.info('[simcardmanagement:]' + TAG + ':' + msg); - } - - w(TAG, msg): void { - console.warn('[simcardmanagement:]' + TAG + ':' + msg); - } - - e(TAG, msg): void { - console.error('[simcardmanagement:]' + TAG + ':' + msg); - } -} - -let mLogUtil = new LogUtils(); - -export default mLogUtil as LogUtils; - diff --git a/simcardmanagement/src/main/ets/common/utils/SimStateConst.ets b/simcardmanagement/src/main/ets/common/utils/SimStateConst.ets deleted file mode 100644 index 861abc0..0000000 --- a/simcardmanagement/src/main/ets/common/utils/SimStateConst.ets +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (c) 2023 Huawei Device Co., Ltd. - * 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. - */ -export default class SimStateConst { - public static SIM_STATE_UNKNOWN = 0; - public static SIM_STATE_NOT_PRESENT = 1; - public static SIM_STATE_LOCKED = 2; - public static SIM_STATE_NOT_READY = 3; - public static SIM_STATE_READY = 4; - public static SIM_STATE_LOADED = 5; -} \ No newline at end of file diff --git a/simcardmanagement/src/main/ets/common/utils/SubscriberManager.ets b/simcardmanagement/src/main/ets/common/utils/SubscriberManager.ets deleted file mode 100644 index 6f98770..0000000 --- a/simcardmanagement/src/main/ets/common/utils/SubscriberManager.ets +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Copyright (c) 2023 Huawei Device Co., Ltd. - * 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. - */ -import commonEvent from '@ohos.commonEvent'; -import LogUtils from './LogUtils' -let subscriber; -const TAG = "SubscriberManager" -const events = ['usual.event.SPN_INFO_CHANGED', 'usual.event.SIM_STATE_CHANGE']; - -export class SubscriberManager { - - /** - * Registered subscribers - */ - public async registerSubscriber() { - subscriber = await new Promise((resolve) => { - commonEvent.createSubscriber({ - events, - priority: 1000 - }, - (err, data) => { - resolve(data); - } - ); - }); - - commonEvent.subscribe(subscriber, (err, res) => { - LogUtils.i(TAG, "commonEvent subscribe 1 : %s" + JSON.stringify(res)); - if (err.code === 0) { - LogUtils.i(TAG, "commonEvent subscribe : %s" + JSON.stringify(res)); - if (!!res.parameters.CUR_PLMN) { - AppStorage.SetOrCreate("operatorName", res.parameters); - } - } else { - LogUtils.i(TAG, "commonEvent.subscribe err : %s" + JSON.stringify(err)); - } - }); - } - /** - * unsubscribe - */ - public unsubscribe() { - commonEvent.unsubscribe(subscriber, (err) => { - if (err.code !== 0) { - LogUtils.i(TAG, "commonEvent.unsubscribe err: %s" + JSON.stringify(err)) - } - }); - } -} - -let mSubscriberManager = new SubscriberManager(); - -export default mSubscriberManager as SubscriberManager; \ No newline at end of file diff --git a/simcardmanagement/src/main/ets/common/utils/Utils.ets b/simcardmanagement/src/main/ets/common/utils/Utils.ets deleted file mode 100644 index 4df5ce6..0000000 --- a/simcardmanagement/src/main/ets/common/utils/Utils.ets +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * 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. - */ - -/** - * @file: Utils - */ -export function getString(value: Resource) { - return globalThis.simCardAbilityContext.resourceManager.getStringSync(value); -} - diff --git a/simcardmanagement/src/main/ets/common/utils/constant.ets b/simcardmanagement/src/main/ets/common/utils/constant.ets deleted file mode 100644 index 88dd319..0000000 --- a/simcardmanagement/src/main/ets/common/utils/constant.ets +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * 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. - */ - -/** - * @file: Constant selection data - */ - -export const DIALOG_TYPE = { - TWO_BUTTON_DIALOG: 'twoButton', - TOAST_DIALOG: 'toast' -}; - -export const UPDATE_DIALOG_TYPE = { - ADD_ESIM: 'addESim' -}; - -export const CARD_CALLING_SET = { - NO_SETTING: -1, - CARD1: 0, - CARD2: 1 -}; - -export const CARD_NET_SUPPORT = { - NO_SUPPORT_5G: '4G/3G/2G', - SUPPORT_5G: '5G/4G/3G/2G' -}; - -export const REGULAR = { - regular: /^[+]|[0-9]+/g, - regular2: /[^~!@$%^&()#+*_\-=<>?:"{}|,.\/;₠₵¢¢Πη℅©¶¢€∣∅√÷×≈™′℗®'´''ˊ¢`•▪.·°∉¢φ£△∆·£¥£฿€$¥′″∏~~﹏﹋≈'\\[\]·~!@¥%……&()——\-={}|《》?:“”【】、;‘',。、A-Za-z\x22]/g -}; - diff --git a/simcardmanagement/src/main/ets/model/api.ets b/simcardmanagement/src/main/ets/model/api.ets deleted file mode 100644 index 98b57bb..0000000 --- a/simcardmanagement/src/main/ets/model/api.ets +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * 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. - */ - -/** - * @file: SIM open interface call - */ - -import observer from '@ohos.telephony.observer'; -import sim from '@ohos.telephony.sim'; - -export { sim, observer }; - -function getSimState(slotId=0) { - return sim.getSimState(slotId); -} - -function getDefaultVoiceSlotId(slotId) { - return sim.getDefaultVoiceSlotId(slotId); -} - -function getSimTelephoneNumber(slotId=0) { - return sim.getSimTelephoneNumber(slotId); -} - - -export { getSimState, getDefaultVoiceSlotId, getSimTelephoneNumber, }; \ No newline at end of file diff --git a/simcardmanagement/src/main/ets/model/dataServiceProxy.ets b/simcardmanagement/src/main/ets/model/dataServiceProxy.ets deleted file mode 100644 index 086a751..0000000 --- a/simcardmanagement/src/main/ets/model/dataServiceProxy.ets +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * 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. - */ - -/** - * @file: data service interface - */ - -import data from '@ohos.telephony.data'; -import LogUtils from '../common/utils/LogUtils' - -const TAG = "dataServiceProxy" - -/** - * Get default dataSlotId - * - * @return {Promise} - */ -export function getDefaultDataSlotId() { - return new Promise((resolve, reject) => { - try { - data.getDefaultCellularDataSlotId((error, data) => { - if (error) { - LogUtils.i(TAG, "getDefaultCellularDataSlotId error:" + JSON.stringify(error)); - reject(error); - } else { - LogUtils.i(TAG, "getDefaultCellularDataSlotId data:" + JSON.stringify(data)); - resolve(data); - } - }); - } catch (error) { - LogUtils.i(TAG, "getDefaultCellularDataSlotId catch:" + JSON.stringify(error)); - reject(error); - } - }); -} - -/** - * Set default dataSlotId - * - * @param {number} slotId - slot ID - * @return {Promise} - */ -export function setDefaultDataSlotId(slotId = 0) { - return new Promise((resolve, reject) => { - try { - data.setDefaultCellularDataSlotId(slotId, (error, data) => { - if (error) { - LogUtils.i(TAG, "setDefaultCellularDataSlotId error:" + JSON.stringify(error)); - reject(error); - } else { - LogUtils.i(TAG, "setDefaultCellularDataSlotId data:" + JSON.stringify(data)); - resolve(true); - } - }); - } catch (error) { - LogUtils.i(TAG, "setDefaultCellularDataSlotId catch:" + JSON.stringify(error)); - reject(error); - } - }); -} - -/** - * Is change net - * - * @param {boolean} bool - * @return {Promise} - */ -export function isChangeNet(bool = true) { - return new Promise((resolve) => { - resolve(true); - LogUtils.i(TAG, "isChangeNet resolve:" + bool); - }); -} - -export default { - getDefaultDataSlotId, - setDefaultDataSlotId, - isChangeNet -}; \ No newline at end of file diff --git a/simcardmanagement/src/main/ets/model/radioServiceProxy.ets b/simcardmanagement/src/main/ets/model/radioServiceProxy.ets deleted file mode 100644 index 3e97f62..0000000 --- a/simcardmanagement/src/main/ets/model/radioServiceProxy.ets +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * 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. - */ - -/** - * @file: radio service interface - */ - -import radio from '@ohos.telephony.radio'; -import LogUtils from '../common/utils/LogUtils' -import { getString } from '../common/utils/Utils' - -const TAG = "radioserviceProxy" - -/** - * Get support network - * - * @param {number} slotId - slot ID - * @return {Promise} - */ -let getSupportNetwork = function (slotId = 0) { - return new Promise(function (resolve, reject) { - try { - let isSupported = radio.isNrSupported(); - LogUtils.i(TAG, "getSupportNetwork isNrSupported:" + isSupported); - resolve(isSupported); - } catch (error) { - LogUtils.i(TAG, "getSupportNetwork isNrSupported:catch" + JSON.stringify(error)); - reject(error); - } - }); -}; - -/** - * Get operation name - * - * @param {number} slotId - slot id - * @return {Promise} - */ -let getOperatorName = function (slotId = 0) { - return new Promise((resolve, reject) => { - try { - radio.getOperatorName(slotId, (error, value) => { - if (error) { - LogUtils.i(TAG, "getOperatorName error:" + JSON.stringify(error)); - reject(error); - } else { - LogUtils.i(TAG, "getOperatorName value:" + JSON.stringify(value)); - if (value == 'CHINA MOBILE') { - LogUtils.i(TAG, "getOperatorName value-CHINA MOBILE:" + JSON.stringify(value)); - resolve(getString($r('app.string.china_mobile'))); - } else { - resolve(value); - } - } - }); - } catch (error) { - LogUtils.i(TAG, "getOperatorName catch:" + JSON.stringify(error)); - reject(error); - } - }); -}; - -/** - * Get show name - * - * @param {number} slotId - slot ID - * @return {Promise} - */ -export function getPrimarySlotId() { - return new Promise(function (resolve, reject) { - try { - radio.getPrimarySlotId((error, value) => { - if (error) { - LogUtils.i(TAG, "getPrimarySlotId error:" + JSON.stringify(error)); - reject(error); - } else { - LogUtils.i(TAG, "getPrimarySlotId data:" + JSON.stringify(value)); - resolve(value); - } - }); - } catch (error) { - LogUtils.i(TAG, "getPrimarySlotId catch:" + JSON.stringify(error)); - reject(error); - } - }); -} - -export default { - getSupportNetwork, - getOperatorName -}; \ No newline at end of file diff --git a/simcardmanagement/src/main/ets/model/registerSimStateApi.ets b/simcardmanagement/src/main/ets/model/registerSimStateApi.ets deleted file mode 100644 index 8c86468..0000000 --- a/simcardmanagement/src/main/ets/model/registerSimStateApi.ets +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * 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. - */ - -/** - * @file: registerSimStateApi - */ - -import observer from '@ohos.telephony.observer'; -import LogUtils from '../common/utils/LogUtils' -import sim from '@ohos.telephony.sim'; - -const TAG = "registerSimStateApi" - -/** - * Monitor the SIM card status - * - * @param {function} callBack - call-back - * @param {string} slotId - card The slot id - */ -export function registerSimStateChange(slotId, callBack) { - return observer.on('simStateChange', { - slotId: slotId - }, (callStateInfo) => { - LogUtils.i(TAG, "registerSimStateChange: then" + "slotid: " + JSON.stringify(slotId) + " callstateinfo:" + JSON.stringify(callStateInfo)); - callBack(callStateInfo); - return callStateInfo - }); -} - -export function getMaxSimCount() { - return sim.getMaxSimCount(); -} \ No newline at end of file diff --git a/simcardmanagement/src/main/ets/model/simServiceProxy.ets b/simcardmanagement/src/main/ets/model/simServiceProxy.ets deleted file mode 100644 index 3ae846b..0000000 --- a/simcardmanagement/src/main/ets/model/simServiceProxy.ets +++ /dev/null @@ -1,395 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * 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. - */ - -/** - * @file: SIM card service interface - */ - -import sim from '@ohos.telephony.sim'; -import LogUtils from '../common/utils/LogUtils' -import { getString } from '../common/utils/Utils' - -const TAG = "simServiceProxy" - -/** - * Get simAccount number - * - * @param {number} slotId - slot ID - * @return {Promise} - */ -export function getSimAccountNumber(slotId = 0) { - return new Promise(function (resolve, reject) { - try { - sim.getSimAccountInfo(slotId, (error, info) => { - if (error) { - LogUtils.i(TAG, "getSimAccountNumber getSimAccountInfo error:" + JSON.stringify(error)); - reject(error); - } else { - LogUtils.i(TAG, "getSimAccountNumber getSimAccountInfo data:" + JSON.stringify(info.showNumber)); - resolve(info.showNumber); - } - }); - } catch (error) { - LogUtils.i(TAG, "getSimAccountNumber getSimAccountInfo catch:" + JSON.stringify(error)); - reject(error); - } - }); -} - -/** - * is has simcard - * - * @param {number} slotId - slot ID - * @return {Promise} - */ -export function hasSimCard(slotId = 0) { - return new Promise(function (resolve, reject) { - try { - sim.hasSimCard(slotId, (error, data) => { - if (error) { - LogUtils.i(TAG, "hasSimCard error card : " + JSON.stringify(slotId) + " " + JSON.stringify(error)); - reject(error); - } else { - LogUtils.i(TAG, "hasSimCard data card : " + JSON.stringify(slotId) + " " + JSON.stringify(data)); - resolve(data); - } - ; - }); - } catch (error) { - LogUtils.i(TAG, "hasSimCard catch card : " + JSON.stringify(slotId) + " " + JSON.stringify(error)); - reject(error); - } - }); -} - -/** - * Get simSpn - * - * @param {number} slotId - slot ID - * @return {Promise} - */ -export function getSimSpn(slotId = 0) { - return new Promise(function (resolve, reject) { - try { - sim.getSimSpn(slotId, (error, value) => { - if (error) { - LogUtils.i(TAG, "getSimSpn error:" + JSON.stringify(error)); - reject(error); - } else { - LogUtils.i(TAG, "getSimSpn data:" + JSON.stringify(value)); - resolve(value); - } - }); - } catch (error) { - LogUtils.i(TAG, "hasSimCard catch:" + JSON.stringify(error)); - reject(error); - } - }); -} - -/** - * Get sim telephone number - * - * @param {number} slotId - slot ID - * @return {Promise} - */ -export function getSimTelephoneNumber(slotId = 0) { - return new Promise(function (resolve, reject) { - try { - sim.getSimTelephoneNumber(slotId, (error, value) => { - if (error) { - LogUtils.i(TAG, "getSimTelephoneNumber error:" + JSON.stringify(error)); - reject(error); - } else { - LogUtils.i(TAG, "getSimTelephoneNumber data:" + JSON.stringify(value)); - resolve(value); - } - }); - } catch (error) { - LogUtils.i(TAG, "getSimTelephoneNumber catch:" + JSON.stringify(error)); - reject(error); - } - }); -} - -/** - * Is sim active - * - * @param {number} slotId - slot ID - * @return {Promise} - */ -export function isSimActive(slotId = 0) { - return new Promise((resolve, reject) => { - try { - sim.isSimActive(slotId, (error, value) => { - if (error) { - LogUtils.i(TAG, "isSimActive error slotId: " + JSON.stringify(slotId) + " " + JSON.stringify(error)); - reject(error); - } else { - LogUtils.i(TAG, "isSimActive data slotId: " + JSON.stringify(slotId) + " " + JSON.stringify(value)); - resolve(value); - } - }); - } catch (error) { - LogUtils.i(TAG, "isSimActive catch slotId: " + JSON.stringify(slotId) + " " + JSON.stringify(error)); - reject(error); - } - }); -} - -/** - * Get sim state - * - * @param {number} slotId - slot ID - * @return {Promise} - */ -export function getSimState(slotId = 0) { - return new Promise(function (resolve, reject) { - try { - sim.getSimState(slotId, (error, value) => { - if (error) { - LogUtils.i(TAG, "getSimState card :" + JSON.stringify(slotId) + " error: " + JSON.stringify(error)); - reject(error); - } else { - LogUtils.i(TAG, "getSimState data:" + JSON.stringify(slotId) + " data: " + JSON.stringify(value)); - resolve(value); - } - }); - } catch (error) { - LogUtils.i(TAG, "getSimState catch:" + JSON.stringify(slotId) + " catch: " + JSON.stringify(error)); - reject(error); - } - }); -} - -/** - * Get default voiceSlotId - * - * @return {Promise} - */ -export function getDefaultVoiceSlotId() { - return new Promise(function (resolve, reject) { - try { - sim.getDefaultVoiceSlotId((error, value) => { - if (error) { - LogUtils.i(TAG, "getDefaultVoiceSlotId error:" + JSON.stringify(error)); - reject(error); - } else { - LogUtils.i(TAG, "getDefaultVoiceSlotId data:" + JSON.stringify(value)); - resolve(value); - } - }); - } catch (error) { - LogUtils.i(TAG, "getDefaultVoiceSlotId catch:" + JSON.stringify(error)); - reject(error); - } - }); -} - -/** - * Set default voiceSlotId - * - * @param {number} slotId - slot ID - * @return {Promise} - */ -export function setDefaultVoiceSlotId(slotId = 0) { - return new Promise((resolve, reject) => { - try { - sim.setDefaultVoiceSlotId(slotId, (error, data) => { - if (error) { - LogUtils.i(TAG, "setDefaultVoiceSlotId error:" + JSON.stringify(slotId) + " " + JSON.stringify(error)); - reject(error); - } else { - LogUtils.i(TAG, "setDefaultVoiceSlotId data:" + JSON.stringify(slotId) + " " + JSON.stringify(data)); - resolve(true); - } - }); - } catch (error) { - LogUtils.i(TAG, "setDefaultVoiceSlotId catch:" + JSON.stringify(slotId) + " " + JSON.stringify(error)); - reject(error); - } - }); -} - -/** - * Set sim active - * - * @param {number} slotId - slot ID - * @param {boolean} bool - Is SIM card activated - * @return {Promise} - */ -export function setSimActive(slotId = 0, bool) { - if (bool) { - return new Promise((resolve, reject) => { - try { - sim.activateSim(slotId, (error) => { - if (error) { - LogUtils.i(TAG, "activateSim error:" + JSON.stringify(error)); - reject(error); - } else { - LogUtils.i(TAG, "activateSim data:" + JSON.stringify(bool)); - resolve(true); - } - }); - } catch (error) { - LogUtils.i(TAG, "activateSim catch:" + JSON.stringify(error)); - reject(error); - } - }); - } else { - return new Promise((resolve, reject) => { - try { - sim.deactivateSim(slotId, (error) => { - if (error) { - LogUtils.i(TAG, "deactivateSim error:" + JSON.stringify(error)); - reject(error); - } else { - LogUtils.i(TAG, "deactivateSim data:" + JSON.stringify(bool)); - resolve(false); - } - }); - } catch (error) { - LogUtils.i(TAG, "deactivateSim catch:" + JSON.stringify(error)); - reject(error); - } - }); - } -} - -/** - * Set show name - * - * @param {number} slotId - slot ID - * @param {string} name - name Value - * @return {Promise} - */ -export function setShowName(slotId = 0, name = '') { - LogUtils.i(TAG, "setShowName data:" + JSON.stringify(name)); - return new Promise((resolve, reject) => { - try { - sim.setShowName(slotId, name, (error) => { - if (error) { - LogUtils.i(TAG, "setShowName error:" + JSON.stringify(error)); - reject(error); - } else { - LogUtils.i(TAG, "setShowName success:"); - resolve(true); - } - }); - } catch (error) { - LogUtils.i(TAG, "setShowName catch:" + JSON.stringify(error)); - reject(error); - } - }); -} - -/** - * Get show name - * - * @param {number} slotId - slot ID - * @return {Promise} - */ -export function getShowName(slotId = 0) { - return new Promise(function (resolve, reject) { - try { - sim.getShowName(slotId, (error, value) => { - if (error) { - LogUtils.i(TAG, "getShowName error:" + JSON.stringify(error)); - reject(error); - } else { - LogUtils.i(TAG, "getShowName data:" + JSON.stringify(value)); - if (value == 'CHINA MOBILE') { - resolve(getString($r('app.string.china_mobile'))); - } else { - resolve(value); - } - } - }); - } catch (error) { - LogUtils.i(TAG, "getShowName catch:" + JSON.stringify(error)); - reject(error); - } - }); -} - -/** - * Set show number - * - * @param {number} slotId - slot ID - * @param {string} number - phone number - * @return {Promise} - */ -export function setShowNumber(slotId = 0, number = '') { - LogUtils.i(TAG, "setShowNumber number:" + JSON.stringify(number)); - return new Promise((resolve, reject) => { - try { - sim.setShowNumber(slotId, number, (error) => { - if (error) { - LogUtils.i(TAG, "setShowNumber error:" + JSON.stringify(error)); - reject(error); - } else { - LogUtils.i(TAG, "setShowNumber success:"); - resolve(true); - } - }); - } catch (error) { - LogUtils.i(TAG, "setShowNumber catch:" + JSON.stringify(error)); - reject(error); - } - }); -} - -/** - * Get show number - * - * @param {number} slotId - slot ID - * @return {Promise} - */ -export function getShowNumber(slotId = 0) { - return new Promise(function (resolve, reject) { - try { - sim.getShowNumber(slotId, (error, value) => { - if (error) { - LogUtils.i(TAG, "getShowNumber error:" + JSON.stringify(error)); - reject(error); - } else { - LogUtils.i(TAG, "getShowNumber data:" + JSON.stringify(value)); - resolve(value); - } - }); - } catch (error) { - LogUtils.i(TAG, "getShowNumber catch:" + JSON.stringify(error)); - reject(error); - } - }); -} - -const simAdapter = { - getSimAccountNumber, - getSimSpn, - getSimTelephoneNumber, - setDefaultVoiceSlotId, - getDefaultVoiceSlotId, - isSimActive, - hasSimCard, - getSimState, - setSimActive, - setShowName, - getShowName, - setShowNumber, - getShowNumber -}; - -export default simAdapter; \ No newline at end of file diff --git a/simcardmanagement/src/main/ets/pages/index.ets b/simcardmanagement/src/main/ets/pages/index.ets deleted file mode 100644 index 7a280ca..0000000 --- a/simcardmanagement/src/main/ets/pages/index.ets +++ /dev/null @@ -1,398 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * 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. - */ -/** - SIM_CARD_INFO */ -import { addAirPlaneModeListener, removeAirPlaneModeListener, queryAirPlaneMode } from '../common/utils/AirplaneMode'; -import HeadComponent from '../common/components/headComponent' -import CardInfomation from '../common/components/cardInfomation' -import SetFlowLimit from '../common/components/dialog/setFlowLimit' -import DefaultDialCard from '../common/components/dialog/defalutDialing' -import dataServiceProxy from '../model/dataServiceProxy'; -import simServiceProxy from '../model/simServiceProxy' -import DefaultCard from '../common/components/defaultCard' -import LogUtils from '../common/utils/LogUtils' -import { registerSimStateChange, getMaxSimCount } from '../model/registerSimStateApi' -import SubscriberManager from '../common/utils/SubscriberManager' -import { getPrimarySlotId } from '../model/radioServiceProxy' -import OperaNameStruct from '../common/struct/operaNameStruct'; - -export const CARD_HOT_PULL_PLUG = { - HOT_PULL: 1, - HOT_PLUG: 4 -}; - -const TAG = "Index" -class CardInfoStruct { - id - title - isOpened - disabled - name - info - isSimCardClosed -} - -@Entry -@Component -struct Index { - scroller: Scroller = new Scroller(); - @State list: Array = [ - { - id: 0, - title: $r('app.string.sim_card_one_no_space'), - isOpened: false, - disabled: true, - name: $r('app.string.sim_null_character'), - info: '', - isSimCardClosed: false - }, - { - id: 1, - title: $r('app.string.sim_card_two_no_space'), - isOpened: false, - disabled: true, - name: $r('app.string.sim_null_character'), - info: '', - isSimCardClosed: false - } - ]; - @State isShow: boolean = false; - @State isShow2: boolean = false; - private number1: string = ''; - private number2: string = ''; - @State defaultDataChange: boolean = true; - @State isStop: boolean = true; - @State defaultSet: Resource = $r('app.string.not_set'); - @State simActive: boolean = false; - @StorageLink("operatorName") @Watch('updateInfo') operatorInfo: OperaNameStruct = new OperaNameStruct(); - // Mobile AirPlane Mode - @State isAirPlaneMode: boolean = false; - SIM_CARD_STOP = 'sim_card_management_card_stop_boolean'; - SIM_CARD_Change = 'sim_card_management_card_change_boolean'; - SIM_CARD_DEFAULT = 'sim_card_management_card_default_call'; - SIM_CARD_TRANSFER = 'sim_card_management_transfer'; - SIM_CARD_TRANSFER2 = 'sim_card_management_transfer2'; - SHOW_CHANGE = 'sim_change_data'; - setFlowLimit: CustomDialogController = new CustomDialogController({ - builder: SetFlowLimit({ change: this.defaultDataChange }), - alignment: DialogAlignment.Bottom, - autoCancel: false, - offset: { dx: 0, dy: -30 } - }) - defaultDialCard: CustomDialogController = new CustomDialogController({ - builder: DefaultDialCard({ defaultSet: $defaultSet, - action: (v) => { - this.defaultSet = v; - } }), - alignment: DialogAlignment.Bottom, - autoCancel: false, - offset: { dx: 0, dy: -16 } - }) - - defaultCard() { - LogUtils.i(TAG, "onclick defaultDialCard open") - this.defaultDialCard.open(); - }; - - // init AirPlane Mode - initAirPlaneMode() { - LogUtils.i(TAG, 'initAirPlaneMode'); - try { - addAirPlaneModeListener((data) => { - LogUtils.i(TAG, 'initAirPlaneMode callback'); - this.isAirPlaneMode = data == 1 ? true : false; - }); - } catch(err) { - LogUtils.e(TAG,`initAirPlaneMode err = ${JSON.stringify(err)}`); - } - } - - // query AirPlane Mode - getAirPlaneMode() { - LogUtils.i(TAG, 'getAirPlaneMode'); - try { - queryAirPlaneMode((data) => { - LogUtils.i(TAG, 'getAirPlaneMode callback'); - this.isAirPlaneMode = data == 1 ? true : false; - }); - } catch(err) { - LogUtils.e(TAG,`getAirPlaneMode err = ${JSON.stringify(err)}`); - } - } - - /** - * Get the customized mobile phone number set by the user - */ - getShowNumber(slotId) { - simServiceProxy.getShowNumber(slotId).then((res: string) => { - if (res !== 'null') { - if (!slotId) { - this.number1 = res; - } else { - this.number2 = res; - } - } else { - this.getPhoneNumber(slotId); - } - }); - } - - /** - * Get the phone number of sim card - */ - getPhoneNumber(slotId) { - simServiceProxy.getSimTelephoneNumber(slotId).then((res: string) => { - if (!slotId) { - this.number1 = res; - } else { - this.number2 = res; - } - }) - } - - /** - * Get the default voice sim card - */ - getDefaultVoiceSlotld() { - simServiceProxy.getDefaultVoiceSlotId().then((res: number) => { - LogUtils.i(TAG, "isSimActive getDefaultVoiceSlotId:" + " " + JSON.stringify(res)); - if (res === 0 || res === 1) { - this.isSimActive(res); - } else { - this.defaultSet = $r('app.string.not_set'); - } - }).catch((err) => { - this.defaultSet = $r('app.string.not_set'); - }) - } - - isSimActive(slotId) { - simServiceProxy.isSimActive(slotId).then((res: boolean) => { - LogUtils.i(TAG, "isSimActive simServiceProxy.isSimActive:" + JSON.stringify(slotId) + " " + JSON.stringify(res)); - this.simActive = res; - if (res) { - if (slotId === 0) { - this.defaultSet = $r('app.string.sim_card_one_no_space'); - } - else if (slotId === 1) { - this.defaultSet = $r('app.string.sim_card_two_no_space'); - } else { - this.defaultSet = $r('app.string.not_set'); - } - } else { - this.defaultSet = $r('app.string.not_set'); - } - }).catch((err) => { - this.defaultSet = $r('app.string.not_set'); - }) - } - - updateInfo() { - this.getShowNumber(0); - this.getShowNumber(1); - this.getDefaultVoiceSlotld(); - this.getDefaultDataSlotId(); - } - - setDefaultDataSlotId(slotId) { - dataServiceProxy.setDefaultDataSlotId(slotId) - } - - aboutToAppear() { - LogUtils.i(TAG, "aboutToAppear:"); - this.initAirPlaneMode(); - SubscriberManager.registerSubscriber(); - - if (getMaxSimCount() >= 2) { - this.addRegisterSimStateChange(1); - } - this.addRegisterSimStateChange(0); - } - - getDefaultDataSlotId() { - if (this.list[0].isSimCardClosed && this.list[1].isSimCardClosed) { - dataServiceProxy.getDefaultDataSlotId().then((res) => { - this.setDefaultDataChange(res); - }) - } else { - getPrimarySlotId().then((res) => { - LogUtils.i(TAG, "getPrimarySlotId: then: " + JSON.stringify(res)); - this.setDefaultDataChange(res); - }); - } - } - - setDefaultDataChange(res) { - if (res === 1) { - this.defaultDataChange = false; - } else { - this.defaultDataChange = true; - } - } - - onPageShow() { - LogUtils.i(TAG, "onPageShow start "); - this.getAirPlaneMode(); - this.updateInfo(); - LogUtils.i(TAG, "onPageShow end ") - } - - addRegisterSimStateChange(slotId) { - registerSimStateChange(slotId, async (callStateInfo) => { - LogUtils.i(TAG, "registerSimStateChange:" + JSON.stringify(callStateInfo)); - this.updateInfo(); - this.defaultDialCard.close(); - }) - } - - aboutToDisappear() { - SubscriberManager.unsubscribe(); - } - - onPageHide() { - removeAirPlaneModeListener(); - } - - build() { - GridRow({ columns: { sm: 4, md: 8, lg: 12 }, gutter: { x: 12 } }) { - GridCol({ span: { sm: 4, md: 8, lg: 8 }, offset: { sm: 0, md: 1, lg: 2 } }) { - Column() { - Column() { - HeadComponent({ headName: $r('app.string.sim_headName') }) - - Column() { - } - .height(12) - .width("100%") - - CardInfomation({ - list: $list, - changeCard: $defaultDataChange, - phone1Number: this.number1, - phone2Number: this.number2, - isCardChange: $defaultDataChange, - isCardChange2: $isShow, - defaultSetString: $defaultSet, - isAirPlaneMode: $isAirPlaneMode, - }) - - Column() { - } - .height(16) - .width("100%") - - Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { - Column() { - Text($r('app.string.default_mobile_data')).fontSize('16vp').fontFamily("HarmonyHeiTi").fontWeight(FontWeight.Medium).maxLines(1) - } - .opacity(this.isStop && !this.isAirPlaneMode ? 1 : 0.4) - .opacity((this.list[0].isOpened && this.list[1].isOpened && !this.isAirPlaneMode) ? 1 : 0.4) - .align(Alignment.Center) - - Row() { - DefaultCard({ cardName: $r('app.string.card_1'), - cardTextBackgrounColor: this.defaultDataChange ? "#0A59F7" : "#FFFFFF", - cardTextColor: this.defaultDataChange ? "#FFFFFF" : "#0A59F7" }) - .opacity((this.list[0].isOpened && this.list[1].isOpened && !this.isAirPlaneMode) ? 1 : 0.4) - .onClick(() => { - LogUtils.i(TAG, "onclick defaultcard card one") - this.setDefaultDataSlotId(0); - this.defaultDataChange = !this.defaultDataChange; - }) - .margin({ right: 6 }) - - DefaultCard({ cardName: $r('app.string.card_2'), - cardTextBackgrounColor: this.defaultDataChange ? "#FFFFFF" : "#0A59F7", - cardTextColor: this.defaultDataChange ? "#0A59F7" : "#FFFFFF" }) - .opacity((this.list[0].isOpened && this.list[1].isOpened && !this.isAirPlaneMode) ? 1 : 0.4) - .onClick(() => { - LogUtils.i(TAG, "onclick defaultcard card two") - this.setDefaultDataSlotId(1); - this.defaultDataChange = !this.defaultDataChange; - }) - } - .enabled(this.list[0].isOpened && this.list[1].isOpened && !this.isAirPlaneMode) - .margin({ right: 1 }) - .width(148) - .height(40) - .borderRadius(50) - .backgroundColor($r("sys.color.ohos_id_color_sub_background")) - .padding({ - top: 6, - bottom: 6, - right: 6, - left: 6 - }) - } - .padding({ - left: 12, - right: 12, - top: 12, - bottom: 12 - }) - .width("100%") - .backgroundColor($r("sys.color.ohos_id_color_foreground_contrary")) - .opacity((this.list[0].isOpened && this.list[1].isOpened) ? 1 : 0.6) - .borderRadius($r('app.float.radius_16')) - - Column() { - } - .height(16) - .width("100%") - - Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { - Text($r('app.string.default_dial_card')).fontSize('16vp').fontFamily("HarmonyHeiTi").fontWeight(FontWeight.Medium).maxLines(1) - .lineHeight(21) - .opacity((this.list[0].isOpened && this.list[1].isOpened) ? 1 : 0.4) - - Row() { - Text(this.defaultSet ? this.defaultSet : $r('app.string.not_set')).fontSize(14).fontColor('#555').margin({ - right: 5 - }).lineHeight(19) - .fontFamily("HarmonyHeiTi").fontWeight(FontWeight.Regular) - Image($r('app.media.next_icon')).height(20).width(12) - } - .opacity((this.list[0].isOpened && this.list[1].isOpened && !this.isAirPlaneMode) ? 1 : 0.4) - } - .opacity((this.list[0].isOpened && this.list[1].isOpened && !this.isAirPlaneMode) ? 1 : 0.6) - .enabled((this.list[0].isOpened && this.list[1].isOpened && !this.isAirPlaneMode)) - .onClick(() => { - this.defaultCard(); - }) - .height(60) - .padding({ - left: 12, - right: 12, - top: 2, - bottom: 2 - }) - .width("100%") - .backgroundColor($r("sys.color.ohos_id_color_foreground_contrary")) - .borderRadius($r('app.float.radius_16')) - } - .useSizeType({ - sm: { span: 4, offset: 0 }, - md: { span: 6, offset: 1 }, - lg: { span: 8, offset: 2 } - }) - } - } - } - .padding({ left: 12, right: 12 }) - .width('100%') - .height('100%') - .backgroundColor($r("sys.color.ohos_id_color_sub_background")) - } -} \ No newline at end of file diff --git a/simcardmanagement/src/main/module.json b/simcardmanagement/src/main/module.json deleted file mode 100644 index 614b7f1..0000000 --- a/simcardmanagement/src/main/module.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "module": { - "name": "simcardmanagement", - "type": "feature", - "srcEntrance": "./ets/Application/MyAbilityStage.ts", - "description": "$string:simcardmanagement_desc", - "mainElement": "com.ohos.simcardmanagement.MainAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "metadata": [ - { - "name": "ArkTSPartialUpdate", - "value": "false" - } - ], - "abilities": [ - { - "name": "com.ohos.simcardmanagement.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:MainAbility_desc", - "icon": "$media:app_icon", - "label": "$string:MainAbility_label", - "startWindowIcon": "$media:app_start_window_icon", - "startWindowBackground": "$color:white", - "visible": true - } - ], - "requestPermissions" : [ - { - "name": "ohos.permission.GET_NETWORK_INFO", - "reason": "$string:GET_NETWORK_INFO" - }, - { - "name": "ohos.permission.SET_TELEPHONY_STATE", - "reason": "$string:SET_TELEPHONY_STATE" - }, - { - "name": "ohos.permission.GET_TELEPHONY_STATE", - "reason": "$string:GET_TELEPHONY_STATE" - }, - { - "name": "ohos.permission.MANAGE_SECURE_SETTINGS", - "reason": "$string:MANAGE_SECURE_SETTINGS" - } - ] - } -} \ No newline at end of file diff --git a/simcardmanagement/src/main/module.json5 b/simcardmanagement/src/main/module.json5 deleted file mode 100644 index 45d36d4..0000000 --- a/simcardmanagement/src/main/module.json5 +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Copyright (c) 2023 Huawei Device Co., Ltd. - * 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. - */ - -{ - "module": { - "name": "simcardmanagement", - "type": "feature", - "srcEntrance": "./ets/Application/MyAbilityStage.ts", - "description": "$string:simcardmanagement_desc", - "mainElement": "com.ohos.simcardmanagement.MainAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "metadata": [ - { - "name": "ArkTSPartialUpdate", - "value": "false" - } - ], - "abilities": [ - { - "name": "com.ohos.simcardmanagement.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:MainAbility_desc", - "icon": "$media:app_icon", - "label": "$string:MainAbility_label", - "startWindowIcon": "$media:app_start_window_icon", - "startWindowBackground": "$color:white", - "visible": true - } - ], - "requestPermissions" : [ - { - "name": "ohos.permission.GET_NETWORK_INFO", - "reason": "$string:GET_NETWORK_INFO" - }, - { - "name": "ohos.permission.SET_TELEPHONY_STATE", - "reason": "$string:SET_TELEPHONY_STATE" - }, - { - "name": "ohos.permission.GET_TELEPHONY_STATE", - "reason": "$string:GET_TELEPHONY_STATE" - }, - { - "name": "ohos.permission.MANAGE_SECURE_SETTINGS", - "reason": "$string:MANAGE_SECURE_SETTINGS" - } - ] - } -} \ No newline at end of file diff --git a/simcardmanagement/src/main/resources/base/element/color.json b/simcardmanagement/src/main/resources/base/element/color.json deleted file mode 100644 index 1090bca..0000000 --- a/simcardmanagement/src/main/resources/base/element/color.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "color": [ - { - "name": "white", - "value": "#FFFFFF" - }, - { - "name": "color_333333_grey", - "value": "#333333" - }, - { - "name": "color_666666_grey", - "value": "#666666" - }, - { - "name": "color_999999_grey", - "value": "#999999" - }, - { - "name": "color_E3E3E3_grey", - "value": "#E3E3E3" - }, - { - "name": "color_00000000_transparent", - "value": "#00000000" - }, - { - "name": "volume_bg_color", - "value": "#CCFFFFFF" - }, - { - "name": "font_color_182431", - "value": "#182431" - } - ] -} \ No newline at end of file diff --git a/simcardmanagement/src/main/resources/base/element/float.json b/simcardmanagement/src/main/resources/base/element/float.json deleted file mode 100644 index 1c2104b..0000000 --- a/simcardmanagement/src/main/resources/base/element/float.json +++ /dev/null @@ -1,132 +0,0 @@ -{ - "float": [ - { - "name": "wh_value_1", - "value": "1" - }, - { - "name": "wh_value_5", - "value": "5" - }, - { - "name": "wh_value_10", - "value": "10" - }, - { - "name": "wh_value_15", - "value": "15" - }, - { - "name": "wh_value_20", - "value": "20" - }, - { - "name": "wh_value_30", - "value": "30" - }, - { - "name": "wh_value_40", - "value": "40" - }, - { - "name": "wh_value_50", - "value": "50" - }, - { - "name": "wh_value_60", - "value": "60" - }, - { - "name": "wh_value_65", - "value": "65" - }, - { - "name": "wh_value_70", - "value": "70" - }, - { - "name": "wh_value_80", - "value": "80" - }, - { - "name": "wh_value_100", - "value": "100" - }, - { - "name": "wh_value_130", - "value": "1300" - }, - { - "name": "wh_value_160", - "value": "160" - }, - { - "name": "wh_value_230", - "value": "230" - }, - { - "name": "wh_value_280", - "value": "280" - }, - { - "name": "wh_value_390", - "value": "390" - }, - { - "name": "wh_value_400", - "value": "400" - }, - { - "name": "font_35", - "value": "35" - }, - { - "name": "font_18", - "value": "18" - }, - { - "name": "font_20", - "value": "20" - }, - { - "name": "font_21", - "value": "21" - }, - { - "name": "font_22", - "value": "22" - }, - { - "name": "font_24", - "value": "24" - }, - { - "name": "font_28", - "value": "28" - }, - { - "name": "font_50", - "value": "50" - }, - { - "name": "control_common_font_size", - "value": "20" - }, - { - "name": "slider_text_padding_left", - "value": "5" - }, - { - "name": "volume_border_radius", - "value": "15" - }, - { - "name": "radius_24", - "value": "24vp" - }, - { - "name": "radius_16", - "value": "16vp" - } - ] -} \ No newline at end of file diff --git a/simcardmanagement/src/main/resources/base/element/string.json b/simcardmanagement/src/main/resources/base/element/string.json deleted file mode 100644 index 26b5007..0000000 --- a/simcardmanagement/src/main/resources/base/element/string.json +++ /dev/null @@ -1,248 +0,0 @@ -{ - "string": [ - { - "name": "simcardmanagement_desc", - "value": "description" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "card_1", - "value": "卡 1" - }, - { - "name": "card_2", - "value": "卡 2" - }, - { - "name": "card_1_set", - "value": "卡 1 设置" - }, - { - "name": "card_2_set", - "value": "卡 2 设置" - }, - { - "name": "type", - "value": "类型" - }, - { - "name": "entity_card", - "value": "实体卡" - }, - { - "name": "eSim_card", - "value": "eSIM卡" - }, - { - "name": "eSim_card_set", - "value": "eSIM卡设置" - }, - { - "name": "add_esim_communication", - "value": "添加 eSIM 卡来使用通信相关服务" - }, - { - "name": "add_esim_card", - "value": "添加 eSIM 卡" - }, - { - "name": "sim_card_manage", - "value": "SIM 卡管理" - }, - { - "name": "default_mobile_data", - "value": "默认移动数据" - }, - { - "name": "intellect_change_inter_card", - "value": "智能切换上网卡" - }, - { - "name": "intellect_change_inter_card_bottom", - "value": "根据网络质量状况和通话状态,暂时切换至" - }, - { - "name": "intellect_change_inter_card_bottom_2", - "value": "上网,需消耗" - }, - { - "name": "intellect_change_inter_card_bottom_3", - "value": "流量" - }, - { - "name": "go_to_set", - "value": "前往设置" - }, - { - "name": "package_limit", - "value": "套餐限额" - }, - { - "name": "default_dial_card", - "value": "默认拨号卡" - }, - { - "name": "not_set", - "value": "不设置" - }, - { - "name": "call_transfer_between_two_cards", - "value": "双卡间呼叫转移" - }, - { - "name": "call_forwarding", - "value": "一卡来电无法呼入时,呼转至另一张卡" - }, - { - "name": "closed", - "value": "已关闭" - }, - { - "name": "long_sentence", - "value": "为保证此功能正常开启,请确保 SIM 卡对应手机号准确无误且已开通呼叫等待服务。资费详情,请咨询当地运营商。" - }, - { - "name": "check_phone_number", - "value": "检查手机号" - }, - { - "name": "select_call_forwarding_method", - "value": "选择呼叫转移方式" - }, - { - "name": "Card_1_call_forwarding_to_card_2", - "value": "卡 1 呼叫转移至卡 2" - }, - { - "name": "Card_2_call_forwarding_to_card_1", - "value": "卡 2 呼叫转移至卡 1" - }, - { - "name": "switch_on_at_the_same_time", - "value": "开关同时打开,表明已启用“卡 1 和卡 2 互相呼叫转移”" - }, - { - "name": "confirm", - "value": "确认" - }, - { - "name": "stop_use", - "value": "停用" - }, - { - "name": "stop_use_card", - "value": "停用%s" - }, - { - "name": "cancel", - "value": "取消" - }, - { - "name": "set", - "value": "设置" - }, - { - "name": "opening_on_this_function", - "value": "开启该功能会消耗" - }, - { - "name": "card_1_phone", - "value": "卡 1 手机号" - }, - { - "name": "sim_headName", - "value": "SIM 卡管理" - }, - { - "name": "sim_not_enabled", - "value": "未启用" - }, - { - "name": "sim_enabled", - "value": "启用" - }, - { - "name": "sim_no_service", - "value": "无服务" - }, - { - "name": "sim_no_card_inserted", - "value": "未插卡" - }, - { - "name": "sim_card_one_no_space", - "value": "卡1" - }, - { - "name": "sim_card_two_no_space", - "value": "卡2" - }, - { - "name": "sim_add_esim", - "value": "添加eSIM" - }, - { - "name": "sim_card_name", - "value": "卡名称" - }, - { - "name": "sim_phone_number", - "value": "手机号" - }, - { - "name": "sim_edit", - "value": "编辑%s信息" - }, - { - "name": "sim_information", - "value": "信息" - }, - { - "name": "sim_stop_information", - "value": "正在%s%s。请稍后···" - }, - { - "name": "sim_mobile_data_change", - "value": "默认移动数据将切换至%s。切换过程中,数据业务、打电话等功能将不可用。是否停用%s?" - }, - { - "name": "sim_package_limit", - "value": "设置%s套餐限额" - }, - { - "name": "sim_additional_costs", - "value": "开启该功能会消耗%s流量,设置套餐限额后可智能提醒,避免产生额外费用。" - }, - { - "name": "sim_null_character", - "value": " " - }, - { - "name": "china_mobile", - "value": "中国移动" - }, - { - "name": "GET_NETWORK_INFO", - "value": "获取网络信息权限" - }, - { - "name": "SET_TELEPHONY_STATE", - "value": "设置卡的状态" - }, - { - "name": "GET_TELEPHONY_STATE", - "value": "获取卡的状态" - }, - { - "name": "MANAGE_SECURE_SETTINGS", - "value": "管理安全设置" - } - ] -} \ No newline at end of file diff --git a/simcardmanagement/src/main/resources/base/media/ic_Radiobtn_off.png b/simcardmanagement/src/main/resources/base/media/ic_Radiobtn_off.png deleted file mode 100644 index 3143060..0000000 Binary files a/simcardmanagement/src/main/resources/base/media/ic_Radiobtn_off.png and /dev/null differ diff --git a/simcardmanagement/src/main/resources/base/media/ic_Radiobtn_on.png b/simcardmanagement/src/main/resources/base/media/ic_Radiobtn_on.png deleted file mode 100644 index 8b42f33..0000000 Binary files a/simcardmanagement/src/main/resources/base/media/ic_Radiobtn_on.png and /dev/null differ diff --git a/simcardmanagement/src/main/resources/base/media/ic_back.svg b/simcardmanagement/src/main/resources/base/media/ic_back.svg deleted file mode 100644 index 429ef25..0000000 --- a/simcardmanagement/src/main/resources/base/media/ic_back.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - Public/ic_back - - - - - \ No newline at end of file diff --git a/simcardmanagement/src/main/resources/base/media/next_icon.png b/simcardmanagement/src/main/resources/base/media/next_icon.png deleted file mode 100644 index 633f04b..0000000 Binary files a/simcardmanagement/src/main/resources/base/media/next_icon.png and /dev/null differ diff --git a/simcardmanagement/src/main/resources/base/media/phone.png b/simcardmanagement/src/main/resources/base/media/phone.png deleted file mode 100644 index 4ebda48..0000000 Binary files a/simcardmanagement/src/main/resources/base/media/phone.png and /dev/null differ diff --git a/simcardmanagement/src/main/resources/base/media/phoneOff.png b/simcardmanagement/src/main/resources/base/media/phoneOff.png deleted file mode 100644 index c3fe675..0000000 Binary files a/simcardmanagement/src/main/resources/base/media/phoneOff.png and /dev/null differ diff --git a/simcardmanagement/src/main/resources/base/media/redact.png b/simcardmanagement/src/main/resources/base/media/redact.png deleted file mode 100644 index d306fa6..0000000 Binary files a/simcardmanagement/src/main/resources/base/media/redact.png and /dev/null differ diff --git a/simcardmanagement/src/main/resources/base/media/redactOff.png b/simcardmanagement/src/main/resources/base/media/redactOff.png deleted file mode 100644 index 74efb8f..0000000 Binary files a/simcardmanagement/src/main/resources/base/media/redactOff.png and /dev/null differ diff --git a/simcardmanagement/src/main/resources/base/profile/main_pages.json b/simcardmanagement/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 50b961e..0000000 --- a/simcardmanagement/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/index" - ] -} diff --git a/simcardmanagement/src/main/resources/en_US/element/string.json b/simcardmanagement/src/main/resources/en_US/element/string.json deleted file mode 100644 index d360d2c..0000000 --- a/simcardmanagement/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,248 +0,0 @@ -{ - "string": [ - { - "name": "simcardmanagement_desc", - "value": "description" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "card_1", - "value": "card 1" - }, - { - "name": "card_2", - "value": "card 2" - }, - { - "name": "card_1_set", - "value": "card 1 set" - }, - { - "name": "card_2_set", - "value": "caard 2 set" - }, - { - "name": "type", - "value": "type" - }, - { - "name": "entity_card", - "value": "entity card" - }, - { - "name": "eSim_card", - "value": "eSIM card" - }, - { - "name": "eSim_card_set", - "value": "eSIM card set" - }, - { - "name": "add_esim_communication", - "value": "Add ESIM card to adapt to communication related services" - }, - { - "name": "add_esim_card", - "value": "Add eSIM card" - }, - { - "name": "sim_card_manage", - "value": "SIM card management" - }, - { - "name": "default_mobile_data", - "value": "defalut mobile data" - }, - { - "name": "intellect_change_inter_card", - "value": "intellect change internet card" - }, - { - "name": "intellect_change_inter_card_bottom", - "value": "According to the network quality status and call status, temporarily switch to" - }, - { - "name": "intellect_change_inter_card_bottom_2", - "value": "surfing the internet,consumption required" - }, - { - "name": "intellect_change_inter_card_bottom_3", - "value": "flow" - }, - { - "name": "go_to_set", - "value": "go to set" - }, - { - "name": "package_limit", - "value": "package limit" - }, - { - "name": "default_dial_card", - "value": "default dial card" - }, - { - "name": "not_set", - "value": "not set" - }, - { - "name": "call_transfer_between_two_cards", - "value": "call transfer between two cards" - }, - { - "name": "call_forwarding", - "value": "When an incoming call cannot be received from one card, the call will be transferred to another card" - }, - { - "name": "closed", - "value": "closed" - }, - { - "name": "long_sentence", - "value": "In order to ensure the normal opening of this function, please ensure that the mobile phone number corresponding to the SIM card is accurate and has opened the call waiting service. For tariff details, please consult the local operator." - }, - { - "name": "check_phone_number", - "value": "check phone number" - }, - { - "name": "select_call_forwarding_method", - "value": "select call forwarding method" - }, - { - "name": "Card_1_call_forwarding_to_card_2", - "value": "card 1 call forwarding to card 2" - }, - { - "name": "Card_2_call_forwarding_to_card_1", - "value": "card 2 call forwarding to card 1" - }, - { - "name": "switch_on_at_the_same_time", - "value": "When the switch is turned on at the same time, it indicates that 'call forwarding between card 1 and card 2' is enabled" - }, - { - "name": "confirm", - "value": "confirm" - }, - { - "name": "cancel", - "value": "cancel" - }, - { - "name": "set", - "value": "set" - }, - { - "name": "stop_use", - "value": "stop" - }, - { - "name": "stop_use_card", - "value": "stop%s" - }, - { - "name": "opening_on_this_function", - "value": "Opening this function will consume" - }, - { - "name": "card_1_phone", - "value": "Card 1 mobile number" - }, - { - "name": "sim_headName", - "value": "SIM card management" - }, - { - "name": "sim_not_enabled", - "value": "not enabled" - }, - { - "name": "sim_enabled", - "value": "enabled" - }, - { - "name": "sim_no_service", - "value": "no service" - }, - { - "name": "sim_no_card_inserted", - "value": "No card inserted" - }, - { - "name": "sim_card_one_no_space", - "value": "Card1" - }, - { - "name": "sim_card_two_no_space", - "value": "Card2" - }, - { - "name": "sim_add_esim", - "value": "Add eSIM" - }, - { - "name": "sim_card_name", - "value": "Card name" - }, - { - "name": "sim_phone_number", - "value": "Phone number" - }, - { - "name": "sim_edit", - "value": "Edit %s" - }, - { - "name": "sim_information", - "value": "Information" - }, - { - "name": "sim_stop_information", - "value": "Is%s%s。Please wait···" - }, - { - "name": "sim_mobile_data_change", - "value": "Default mobile data will be switched to%s。During the switching process, data services, phone calls and other functions will not be available. Deactivate or not%s?" - }, - { - "name": "sim_package_limit", - "value": "Set%spackage limit" - }, - { - "name": "sim_additional_costs", - "value": "Enabling this function will consume%s traffic. After setting the package limit, you can be reminded intelligently to avoid additional costs." - }, - { - "name": "sim_null_character", - "value": " " - }, - { - "name": "china_mobile", - "value": "China Mobile" - }, - { - "name": "GET_NETWORK_INFO", - "value": "get network info" - }, - { - "name": "SET_TELEPHONY_STATE", - "value": "set telephony state" - }, - { - "name": "GET_TELEPHONY_STATE", - "value": "get telephony state" - }, - { - "name": "MANAGE_SECURE_SETTINGS", - "value": "manage secure settings" - } - ] -} \ No newline at end of file