1/* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16import { paramMock } from "../utils" 17export const LockInfo = { 18 lockType: LockType, 19 password: "[PC Preview] unknow password", 20 state: LockState, 21} 22export const LockType = { 23 PIN_LOCK: 1, 24 FDN_LOCK: 2, 25}; 26export const LockState = { 27 LOCK_OFF: 0, 28 LOCK_ON: 1, 29}; 30export const PersoLockType = { 31 PN_PIN_LOCK: "[PC Preview] unknow PN_PIN_LOCK", 32 PN_PUK_LOCK: "[PC Preview] unknow PN_PUK_LOCK", 33 PU_PIN_LOCK: "[PC Preview] unknow PU_PIN_LOCK", 34 PU_PUK_LOCK: "[PC Preview] unknow PU_PUK_LOCK", 35 PP_PIN_LOCK: "[PC Preview] unknow PP_PIN_LOCK", 36 PP_PUK_LOCK: "[PC Preview] unknow PP_PUK_LOCK", 37 PC_PIN_LOCK: "[PC Preview] unknow PC_PIN_LOCK", 38 PC_PUK_LOCK: "[PC Preview] unknow PC_PUK_LOCK", 39 SIM_PIN_LOCK: "[PC Preview] unknow SIM_PIN_LOCK", 40 SIM_PUK_LOCK: "[PC Preview] unknow SIM_PUK_LOCK", 41}; 42export const PersoLockInfo = { 43 lockType: PersoLockType, 44 password: "[PC Preview] unknow password", 45} 46export const DiallingNumbersInfo = { 47 alphaTag: "[PC Preview] unknow alphaTag", 48 number: "[PC Preview] unknow number", 49 recordNumber: "[PC Preview] unknow recordNumber", 50 pin2: "[PC Preview] unknow pin2", 51} 52export const CardType = { 53 UNKNOWN_CARD: -1, 54 SINGLE_MODE_SIM_CARD: 10, 55 SINGLE_MODE_USIM_CARD: 20, 56 SINGLE_MODE_RUIM_CARD: 30, 57 DUAL_MODE_CG_CARD: 40, 58 CT_NATIONAL_ROAMING_CARD: 41, 59 CU_DUAL_MODE_CARD: 42, 60 DUAL_MODE_TELECOM_LTE_CARD: 43, 61 DUAL_MODE_UG_CARD: 50, 62 SINGLE_MODE_ISIM_CARD: 60 63}; 64export const IccAccountInfo = { 65 simId: "[PC Preview] unknow simId", 66 slotIndex: "[PC Preview] unknow slotIndex", 67 isEsim: "[PC Preview] unknow isEsim", 68 isActive: "[PC Preview] unknow isActive", 69 iccId: "[PC Preview] unknow iccId", 70 showName: "[PC Preview] unknow showName", 71 showNumber: "[PC Preview] unknow showNumber", 72} 73export const SimState = { 74 SIM_STATE_UNKNOWN: "[PC Preview] unknow SIM_STATE_UNKNOWN", 75 SIM_STATE_NOT_PRESENT: "[PC Preview] unknow SIM_STATE_NOT_PRESENT", 76 SIM_STATE_LOCKED: "[PC Preview] unknow SIM_STATE_LOCKED", 77 SIM_STATE_NOT_READY: "[PC Preview] unknow SIM_STATE_NOT_READY", 78 SIM_STATE_READY: "[PC Preview] unknow SIM_STATE_READY", 79 SIM_STATE_LOADED: "[PC Preview] unknow SIM_STATE_LOADED", 80}; 81export const ContactType = { 82 GENERAL_CONTACT: 1, 83 FIXED_DIALING: 2, 84}; 85export const OperatorConfig = { 86 field: "[PC Preview] unknow field", 87 value: "[PC Preview] unknow value" 88} 89export const LockStatusResponse = { 90 result: "[PC Preview] unknow result", 91 remain: "[PC Preview] unknow remain", 92} 93export function mockSim() { 94 const sim = { 95 ContactType, 96 SimState, 97 CardType, 98 PersoLockType, 99 LockState, 100 LockType, 101 isSimActive: function (...args) { 102 console.warn("telephony.sim.isSimActive interface mocked in the Previewer. How this interface works on the Previewer may" + 103 " be different from that on a real device.") 104 const len = args.length 105 if (typeof args[len - 1] === 'function') { 106 args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramBooleanMock); 107 } else { 108 return new Promise((resolve, reject) => { 109 resolve(paramMock.paramBooleanMock); 110 }) 111 } 112 }, 113 getDefaultVoiceSlotId: function (...args) { 114 console.warn("telephony.sim.getDefaultVoiceSlotId interface mocked in the Previewer. How this interface works on the Previewer may" + 115 " be different from that on a real device.") 116 const len = args.length 117 if (typeof args[len - 1] === 'function') { 118 args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramNumberMock); 119 } else { 120 return new Promise((resolve, reject) => { 121 resolve(paramMock.paramNumberMock); 122 }) 123 } 124 }, 125 hasOperatorPrivileges: function (...args) { 126 console.warn("telephony.sim.hasOperatorPrivileges interface mocked in the Previewer. How this interface works on the Previewer may" + 127 " be different from that on a real device.") 128 const len = args.length 129 if (typeof args[len - 1] === 'function') { 130 args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramBooleanMock); 131 } else { 132 return new Promise((resolve, reject) => { 133 resolve(paramMock.paramBooleanMock); 134 }) 135 } 136 }, 137 getISOCountryCodeForSim: function (...args) { 138 console.warn("telephony.sim.getISOCountryCodeForSim interface mocked in the Previewer. How this interface works on the Previewer may" + 139 " be different from that on a real device.") 140 const len = args.length 141 if (typeof args[len - 1] === 'function') { 142 args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramStringMock); 143 } else { 144 return new Promise((resolve, reject) => { 145 resolve(paramMock.paramStringMock); 146 }) 147 } 148 }, 149 getSimOperatorNumeric: function (...args) { 150 console.warn("telephony.sim.getSimOperatorNumeric interface mocked in the Previewer. How this interface works on the Previewer may" + 151 " be different from that on a real device.") 152 const len = args.length 153 if (typeof args[len - 1] === 'function') { 154 args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramStringMock); 155 } else { 156 return new Promise((resolve, reject) => { 157 resolve(paramMock.paramStringMock); 158 }) 159 } 160 }, 161 getSimSpn: function (...args) { 162 console.warn("telephony.sim.getSimSpn interface mocked in the Previewer. How this interface works on the Previewer may" + 163 " be different from that on a real device.") 164 const len = args.length 165 if (typeof args[len - 1] === 'function') { 166 args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramStringMock); 167 } else { 168 return new Promise((resolve, reject) => { 169 resolve(paramMock.paramStringMock); 170 }) 171 } 172 }, 173 getSimState: function (...args) { 174 console.warn("telephony.sim.getSimState interface mocked in the Previewer. How this interface works on the Previewer may" + 175 " be different from that on a real device.") 176 const len = args.length 177 if (typeof args[len - 1] === 'function') { 178 args[len - 1].call(this, paramMock.businessErrorMock, SimState); 179 } else { 180 return new Promise((resolve, reject) => { 181 resolve(SimState); 182 }) 183 } 184 }, 185 getLockState: function (...args) { 186 console.warn("telephony.sim.getLockState interface mocked in the Previewer. How this interface works on the Previewer may" + 187 " be different from that on a real device.") 188 const len = args.length 189 if (typeof args[len - 1] === 'function') { 190 args[len - 1].call(this, paramMock.businessErrorMock, LockState); 191 } else { 192 return new Promise((resolve, reject) => { 193 resolve(LockState); 194 }) 195 } 196 }, 197 getCardType: function (...args) { 198 console.warn("telephony.sim.getCardType interface mocked in the Previewer. How this interface works on the Previewer may" + 199 " be different from that on a real device.") 200 const len = args.length 201 if (typeof args[len - 1] === 'function') { 202 args[len - 1].call(this, paramMock.businessErrorMock, CardType); 203 } else { 204 return new Promise((resolve, reject) => { 205 resolve(CardType); 206 }) 207 } 208 }, 209 getSimIccId: function (...args) { 210 console.warn("telephony.sim.getSimIccId interface mocked in the Previewer. How this interface works on the Previewer may" + 211 " be different from that on a real device.") 212 const len = args.length 213 if (typeof args[len - 1] === 'function') { 214 args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramStringMock); 215 } else { 216 return new Promise((resolve, reject) => { 217 resolve(paramMock.paramStringMock); 218 }) 219 } 220 }, 221 getVoiceMailIdentifier: function (...args) { 222 console.warn("telephony.sim.getVoiceMailIdentifier interface mocked in the Previewer. How this interface works on the Previewer may" + 223 " be different from that on a real device.") 224 const len = args.length 225 if (typeof args[len - 1] === 'function') { 226 args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramStringMock); 227 } else { 228 return new Promise((resolve, reject) => { 229 resolve(paramMock.paramStringMock); 230 }) 231 } 232 }, 233 getVoiceMailNumber: function (...args) { 234 console.warn("telephony.sim.getVoiceMailNumber interface mocked in the Previewer. How this interface works on the Previewer may" + 235 " be different from that on a real device.") 236 const len = args.length 237 if (typeof args[len - 1] === 'function') { 238 args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramStringMock); 239 } else { 240 return new Promise((resolve, reject) => { 241 resolve(paramMock.paramStringMock); 242 }) 243 } 244 }, 245 getVoiceMailCount: function (...args) { 246 console.warn("telephony.sim.getVoiceMailCount interface mocked in the Previewer. How this interface works on the Previewer may" + 247 " be different from that on a real device.") 248 const len = args.length 249 if (typeof args[len - 1] === 'function') { 250 args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramNumberMock); 251 } else { 252 return new Promise((resolve, reject) => { 253 resolve(paramMock.paramNumberMock); 254 }) 255 } 256 }, 257 getSimTelephoneNumber: function (...args) { 258 console.warn("telephony.sim.getSimTelephoneNumber interface mocked in the Previewer. How this interface works on the Previewer may" + 259 " be different from that on a real device.") 260 const len = args.length 261 if (typeof args[len - 1] === 'function') { 262 args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramStringMock); 263 } else { 264 return new Promise((resolve, reject) => { 265 resolve(paramMock.paramStringMock); 266 }) 267 } 268 }, 269 getSimGid1: function (...args) { 270 console.warn("telephony.sim.getSimGid1 interface mocked in the Previewer. How this interface works on the Previewer may" + 271 " be different from that on a real device.") 272 const len = args.length 273 if (typeof args[len - 1] === 'function') { 274 args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramStringMock); 275 } else { 276 return new Promise((resolve, reject) => { 277 resolve(paramMock.paramStringMock); 278 }) 279 } 280 }, 281 getSimTeleNumberIdentifier: function (...args) { 282 console.warn("telephony.sim.getSimTeleNumberIdentifier interface mocked in the Previewer. How this interface works on the Previewer may" + 283 " be different from that on a real device.") 284 const len = args.length 285 if (typeof args[len - 1] === 'function') { 286 args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramStringMock); 287 } else { 288 return new Promise((resolve, reject) => { 289 resolve(paramMock.paramStringMock); 290 }) 291 } 292 }, 293 getLine1NumberFromImpu: function (...args) { 294 console.warn("telephony.sim.getLine1NumberFromImpu interface mocked in the Previewer. How this interface works on the Previewer may" + 295 " be different from that on a real device.") 296 const len = args.length 297 if (typeof args[len - 1] === 'function') { 298 args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramStringMock); 299 } else { 300 return new Promise((resolve, reject) => { 301 resolve(paramMock.paramStringMock); 302 }) 303 } 304 }, 305 getMaxSimCount: function () { 306 console.warn("telephony.sim.getMaxSimCount interface mocked in the Previewer. How this interface works on the Previewer may" + 307 " be different from that on a real device.") 308 return paramMock.paramNumberMock; 309 }, 310 getIMSI: function (...args) { 311 console.warn("telephony.sim.getIMSI interface mocked in the Previewer. How this interface works on the Previewer may" + 312 " be different from that on a real device.") 313 const len = args.length 314 if (typeof args[len - 1] === 'function') { 315 args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramStringMock); 316 } else { 317 return new Promise((resolve, reject) => { 318 resolve(paramMock.paramStringMock); 319 }) 320 } 321 }, 322 hasSimCard: function (...args) { 323 console.warn("telephony.sim.hasSimCard interface mocked in the Previewer. How this interface works on the Previewer may" + 324 " be different from that on a real device.") 325 const len = args.length 326 if (typeof args[len - 1] === 'function') { 327 args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramBooleanMock); 328 } else { 329 return new Promise((resolve, reject) => { 330 resolve(paramMock.paramBooleanMock); 331 }) 332 } 333 }, 334 getSimAccountInfo: function (...args) { 335 console.warn("telephony.sim.getSimAccountInfo interface mocked in the Previewer. How this interface works on the Previewer may" + 336 " be different from that on a real device.") 337 const len = args.length 338 if (typeof args[len - 1] === 'function') { 339 args[len - 1].call(this, paramMock.businessErrorMock, IccAccountInfo); 340 } else { 341 return new Promise((resolve, reject) => { 342 resolve(IccAccountInfo); 343 }) 344 } 345 }, 346 getActiveSimAccountInfoList: function (...args) { 347 console.warn("telephony.sim.getActiveSimAccountInfoList interface mocked in the Previewer. How this interface works on the Previewer may" + 348 " be different from that on a real device.") 349 const len = args.length 350 if (typeof args[len - 1] === 'function') { 351 args[len - 1].call(this, paramMock.businessErrorMock, [IccAccountInfo]); 352 } else { 353 return new Promise((resolve, reject) => { 354 resolve([IccAccountInfo]); 355 }) 356 } 357 }, 358 setDefaultVoiceSlotId: function (...args) { 359 console.warn("telephony.sim.setDefaultVoiceSlotId interface mocked in the Previewer. How this interface works on the Previewer may" + 360 " be different from that on a real device.") 361 const len = args.length 362 if (typeof args[len - 1] === 'function') { 363 args[len - 1].call(this, paramMock.businessErrorMock); 364 } else { 365 return new Promise((resolve, reject) => { 366 resolve(); 367 }) 368 } 369 }, 370 activateSim: function (...args) { 371 console.warn("telephony.sim.activateSim interface mocked in the Previewer. How this interface works on the Previewer may" + 372 " be different from that on a real device.") 373 const len = args.length 374 if (typeof args[len - 1] === 'function') { 375 args[len - 1].call(this, paramMock.businessErrorMock); 376 } else { 377 return new Promise((resolve, reject) => { 378 resolve(); 379 }) 380 } 381 }, 382 setVoiceMailInfo: function (...args) { 383 console.warn("telephony.sim.setVoiceMailInfo interface mocked in the Previewer. How this interface works on the Previewer may" + 384 " be different from that on a real device.") 385 const len = args.length 386 if (typeof args[len - 1] === 'function') { 387 args[len - 1].call(this, paramMock.businessErrorMock); 388 } else { 389 return new Promise((resolve, reject) => { 390 resolve(); 391 }) 392 } 393 }, 394 deactivateSim: function (...args) { 395 console.warn("telephony.sim.deactivateSim interface mocked in the Previewer. How this interface works on the Previewer may" + 396 " be different from that on a real device.") 397 const len = args.length 398 if (typeof args[len - 1] === 'function') { 399 args[len - 1].call(this, paramMock.businessErrorMock); 400 } else { 401 return new Promise((resolve, reject) => { 402 resolve(); 403 }) 404 } 405 }, 406 sendEnvelopeCmd: function (...args) { 407 console.warn("telephony.sim.sendEnvelopeCmd interface mocked in the Previewer. How this interface works on the Previewer may" + 408 " be different from that on a real device.") 409 const len = args.length 410 if (typeof args[len - 1] === 'function') { 411 args[len - 1].call(this, paramMock.businessErrorMock); 412 } else { 413 return new Promise((resolve, reject) => { 414 resolve(); 415 }) 416 } 417 }, 418 setShowName: function (...args) { 419 console.warn("telephony.sim.setShowName interface mocked in the Previewer. How this interface works on the Previewer may" + 420 " be different from that on a real device.") 421 const len = args.length 422 if (typeof args[len - 1] === 'function') { 423 args[len - 1].call(this, paramMock.businessErrorMock); 424 } else { 425 return new Promise((resolve, reject) => { 426 resolve(); 427 }) 428 } 429 }, 430 sendTerminalResponseCmd: function (...args) { 431 console.warn("telephony.sim.sendTerminalResponseCmd interface mocked in the Previewer. How this interface works on the Previewer may" + 432 " be different from that on a real device.") 433 const len = args.length 434 if (typeof args[len - 1] === 'function') { 435 args[len - 1].call(this, paramMock.businessErrorMock); 436 } else { 437 return new Promise((resolve, reject) => { 438 resolve(); 439 }) 440 } 441 }, 442 getShowName: function (...args) { 443 console.warn("telephony.sim.getShowName interface mocked in the Previewer. How this interface works on the Previewer may" + 444 " be different from that on a real device.") 445 const len = args.length 446 if (typeof args[len - 1] === 'function') { 447 args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramStringMock); 448 } else { 449 return new Promise((resolve, reject) => { 450 resolve(paramMock.paramStringMock); 451 }) 452 } 453 }, 454 setShowNumber: function (...args) { 455 console.warn("telephony.sim.setShowNumber interface mocked in the Previewer. How this interface works on the Previewer may" + 456 " be different from that on a real device.") 457 const len = args.length 458 if (typeof args[len - 1] === 'function') { 459 args[len - 1].call(this, paramMock.businessErrorMock); 460 } else { 461 return new Promise((resolve, reject) => { 462 resolve(); 463 }) 464 } 465 }, 466 getShowNumber: function (...args) { 467 console.warn("telephony.sim.getShowNumber interface mocked in the Previewer. How this interface works on the Previewer may" + 468 " be different from that on a real device.") 469 const len = args.length 470 if (typeof args[len - 1] === 'function') { 471 args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramStringMock); 472 } else { 473 return new Promise((resolve, reject) => { 474 resolve(paramMock.paramStringMock); 475 }) 476 } 477 }, 478 getOperatorConfigs: function (...args) { 479 console.warn("telephony.sim.getOperatorConfigs interface mocked in the Previewer. How this interface works on the Previewer may" + 480 " be different from that on a real device.") 481 const len = args.length 482 if (typeof args[len - 1] === 'function') { 483 args[len - 1].call(this, paramMock.businessErrorMock, [OperatorConfigMock]); 484 } else { 485 return new Promise((resolve, reject) => { 486 resolve([OperatorConfigMock]); 487 }) 488 } 489 }, 490 unlockPin: function (...args) { 491 console.warn("telephony.sim.unlockPin interface mocked in the Previewer. How this interface works on the Previewer may" + 492 " be different from that on a real device.") 493 const len = args.length 494 if (typeof args[len - 1] === 'function') { 495 args[len - 1].call(this, paramMock.businessErrorMock, LockStatusResponse); 496 } else { 497 return new Promise((resolve, reject) => { 498 resolve(LockStatusResponse); 499 }) 500 } 501 }, 502 unlockSimLock: function (...args) { 503 console.warn("telephony.sim.unlockSimLock interface mocked in the Previewer. How this interface works on the Previewer may" + 504 " be different from that on a real device.") 505 const len = args.length 506 if (typeof args[len - 1] === 'function') { 507 args[len - 1].call(this, paramMock.businessErrorMock, LockStatusResponse); 508 } else { 509 return new Promise((resolve, reject) => { 510 resolve(LockStatusResponse); 511 }) 512 } 513 }, 514 unlockPuk: function (...args) { 515 console.warn("telephony.sim.unlockPuk interface mocked in the Previewer. How this interface works on the Previewer may" + 516 " be different from that on a real device.") 517 const len = args.length 518 if (typeof args[len - 1] === 'function') { 519 args[len - 1].call(this, paramMock.businessErrorMock, LockStatusResponse); 520 } else { 521 return new Promise((resolve, reject) => { 522 resolve(LockStatusResponse); 523 }) 524 } 525 }, 526 alterPin: function (...args) { 527 console.warn("telephony.sim.alterPin interface mocked in the Previewer. How this interface works on the Previewer may" + 528 " be different from that on a real device.") 529 const len = args.length 530 if (typeof args[len - 1] === 'function') { 531 args[len - 1].call(this, paramMock.businessErrorMock, LockStatusResponse); 532 } else { 533 return new Promise((resolve, reject) => { 534 resolve(LockStatusResponse); 535 }) 536 } 537 }, 538 setLockState: function (...args) { 539 console.warn("telephony.sim.setLockState interface mocked in the Previewer. How this interface works on the Previewer may" + 540 " be different from that on a real device.") 541 const len = args.length 542 if (typeof args[len - 1] === 'function') { 543 args[len - 1].call(this, paramMock.businessErrorMock, LockStatusResponse); 544 } else { 545 return new Promise((resolve, reject) => { 546 resolve(LockStatusResponse); 547 }) 548 } 549 }, 550 unlockPin2: function (...args) { 551 console.warn("telephony.sim.unlockPin2 interface mocked in the Previewer. How this interface works on the Previewer may" + 552 " be different from that on a real device.") 553 const len = args.length 554 if (typeof args[len - 1] === 'function') { 555 args[len - 1].call(this, paramMock.businessErrorMock, LockStatusResponse); 556 } else { 557 return new Promise((resolve, reject) => { 558 resolve(LockStatusResponse); 559 }) 560 } 561 }, 562 unlockPuk2: function (...args) { 563 console.warn("telephony.sim.unlockPuk2 interface mocked in the Previewer. How this interface works on the Previewer may" + 564 " be different from that on a real device.") 565 const len = args.length 566 if (typeof args[len - 1] === 'function') { 567 args[len - 1].call(this, paramMock.businessErrorMock, LockStatusResponse); 568 } else { 569 return new Promise((resolve, reject) => { 570 resolve(LockStatusResponse); 571 }) 572 } 573 }, 574 alterPin2: function (...args) { 575 console.warn("telephony.sim.alterPin2 interface mocked in the Previewer. How this interface works on the Previewer may" + 576 " be different from that on a real device.") 577 const len = args.length 578 if (typeof args[len - 1] === 'function') { 579 args[len - 1].call(this, paramMock.businessErrorMock, LockStatusResponse); 580 } else { 581 return new Promise((resolve, reject) => { 582 resolve(LockStatusResponse); 583 }) 584 } 585 }, 586 queryIccDiallingNumbers: function (...args) { 587 console.warn("telephony.sim.queryIccDiallingNumbers interface mocked in the Previewer. How this interface works on the Previewer may" + 588 " be different from that on a real device.") 589 const len = args.length 590 if (typeof args[len - 1] === 'function') { 591 args[len - 1].call(this, paramMock.businessErrorMock, [DiallingNumbersInfo]); 592 } else { 593 return new Promise((resolve, reject) => { 594 resolve([DiallingNumbersInfo]); 595 }) 596 } 597 }, 598 addIccDiallingNumbers: function (...args) { 599 console.warn("telephony.sim.addIccDiallingNumbers interface mocked in the Previewer. How this interface works on the Previewer may" + 600 " be different from that on a real device.") 601 const len = args.length 602 if (typeof args[len - 1] === 'function') { 603 args[len - 1].call(this, paramMock.businessErrorMock); 604 } else { 605 return new Promise((resolve, reject) => { 606 resolve(); 607 }) 608 } 609 }, 610 delIccDiallingNumbers: function (...args) { 611 console.warn("telephony.sim.delIccDiallingNumbers interface mocked in the Previewer. How this interface works on the Previewer may" + 612 " be different from that on a real device.") 613 const len = args.length 614 if (typeof args[len - 1] === 'function') { 615 args[len - 1].call(this, paramMock.businessErrorMock); 616 } else { 617 return new Promise((resolve, reject) => { 618 resolve(); 619 }) 620 } 621 }, 622 updateIccDiallingNumbers: function (...args) { 623 console.warn("telephony.sim.updateIccDiallingNumbers interface mocked in the Previewer. How this interface works on the Previewer may" + 624 " be different from that on a real device.") 625 const len = args.length 626 if (typeof args[len - 1] === 'function') { 627 args[len - 1].call(this, paramMock.businessErrorMock); 628 } else { 629 return new Promise((resolve, reject) => { 630 resolve(); 631 }) 632 } 633 } 634 } 635 return sim 636}