• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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"
17import { PixelMapMock } from "../multimedia"
18
19export function mockBundleManager() {
20
21  const ArrayNumberMock = ["[PC preview] unknown array number"]
22  const ArrayStringMock = ["[PC preview] unknown array string"]
23  const LauncherAbilityInfosMock = [
24    {
25      abilityInfo: {
26        bundleName: "[PC preview] unknown bundle name",
27        name: "[PC preview] unknown name",
28        label: "[PC preview] unknown label",
29        description: "[PC preview] unknown description",
30        icon: "[PC preview] unknown icon",
31        labelId: "[PC preview] unknown label id",
32        descriptionId: "[PC preview] unknown description id",
33        iconId: "[PC preview] unknown icon id",
34        moduleName: "[PC preview] unknown module name",
35        process: "[PC preview] unknown process",
36        targetAbility: "[PC preview] unknown target ability",
37        backgroundModes: "[PC preview] unknown background modes",
38        isVisible: "[PC preview] unknown is visible",
39        formEnabled: "[PC preview] unknown form enabled",
40        type: "[PC preview] unknown type",
41        subType: "[PC preview] unknown sub type",
42        orientation: "[PC preview] unknown orientation",
43        launchMode: "[PC preview] unknown launch mode",
44        permissions: ["[PC preview] unknown permission"],
45        deviceTypes: ["[PC preview] unknown device type"],
46        deviceCapabilities: ["[PC preview] unknown device capability"],
47        readPermission: "[PC preview] unknown read permission",
48        writePermission: "[PC preview] unknown write permission",
49        applicationInfo: {
50          packageName: "[PC preview] unknown package name",
51          className: "[PC preview] unknown class name",
52          name: "[PC preview] unknown name",
53          labelId: "[PC preview] unknown label id",
54          iconId: "[PC preview] unknown icon id",
55          sourceDir: "[PC preview] unknown source dir",
56          flags: "[PC preview] unknown flags",
57          customizeData: {
58            key: "[PC preview] unknown key",
59            value: {
60              CustomizeData: {
61                name: "[PC preview] unknown name",
62                value: "[PC preview] unknown value",
63              }
64            }
65          }
66        },
67        formEntity: "[PC preview] unknown form entity",
68        minFormHeight: "[PC preview] unknown min form height",
69        defaultFormHeight: "[PC preview] unknown default form height",
70        minFormWidth: "[PC preview] unknown min form width",
71        uri: "[PC preview] unknown uri",
72        customizeData: {
73          key: "[PC preview] unknown key",
74          value: [
75            {
76              CustomizeData: {
77                name: "[PC preview] unknown name",
78                value: "[PC preview] unknown value",
79              },
80            },
81            {
82              CustomizeData: {
83                name: "[PC preview] unknown name",
84                value: "[PC preview] unknown value",
85              },
86            }
87          ]
88        },
89      },
90      elementName: {
91        deviceId: "[PC preview] unknown device id",
92        bundleName: "[PC preview] unknown bundle name",
93        abilityName: "[PC preview] unknown ability name",
94        uri: "[PC preview] unknown uri",
95        shortName: "[PC preview] unknown short name",
96      },
97      userId: "[PC preview] unknown user id",
98      installTime: "[PC preview] unknown install time",
99    },
100  ]
101  const ModeleUsageRecordsMock = [
102    {
103      bundleName: "[PC preview] unknown bundle name",
104      appLabelId: "[PC preview] unknown app label id",
105      name: "[PC preview] unknown name",
106      labelId: "[PC preview] unknown label id",
107      descriptionId: "[PC preview] unknown description id",
108      abilityName: "[PC preview] unknown ability name",
109      abilityLabelId: "[PC preview] unknown ability label id",
110      abilityDescriptionId: "[PC preview] unknown ability description id",
111      abilityIconId: "[PC preview] unknown ability icon id",
112      launchedCount: "[PC preview] unknown launched count",
113      lastLaunchTime: "[PC preview] unknown last launch time",
114      isRemoved: "[PC preview] unknown is removed",
115      installationFreeSupported: "[PC preview] unknown installation free supported",
116    },
117  ]
118  const ShortcutInfosMock = [
119    {
120      id: "[PC preview] unknown id",
121      bundleName: "[PC preview] unknown bundle name",
122      hostAbility: "[PC preview] unknown host ability",
123      icon: "[PC preview] unknown icon",
124      label: "[PC preview] unknown label",
125      disableMessage: "[PC preview] unknown disable message",
126      wants: [
127        {
128          targetBundle: "[PC preview] unknown target bundle",
129          targetClass: "[PC preview] unknown target class",
130        }],
131      isStatic: "[PC preview] unknown is static",
132      isHomeShortcut: "[PC preview] unknown is home shortcut",
133      isEnabled: "[PC preview] unknown is enabled",
134    },
135  ]
136  const WantMock = {
137    deviceId: "[PC preview] unknown device id",
138    bundleName: "[PC preview] unknown bundle name",
139    abilityName: "[PC preview] unknown ability name",
140    uri: "[PC preview] unknown uri",
141    type: "[PC preview] unknown type",
142    action: "[PC preview] unknown action",
143    entities: "[PC preview] unknown entities",
144    flags: "[PC preview] unknown flags",
145  }
146  const BundleInstallerMock = {}
147  const BundleInfoMock = {
148    name: "[PC preview] unknown name",
149    type: "[PC preview] unknown type",
150    appId: "[PC preview] unknown app id",
151    uid: "[PC preview] unknown uid",
152    installTime: "[PC preview] unknown install time",
153    updateTime: "[PC preview] unknown up date time",
154    appInfo: {
155      packageName: "[PC preview] unknown package name",
156      className: "[PC preview] unknown class name",
157      name: "[PC preview] unknown name",
158      labelId: "[PC preview] unknown label id",
159      iconId: "[PC preview] unknown icon id",
160      sourceDir: "[PC preview] unknown source dir",
161      flags: "[PC preview] unknown flags",
162      customizeData: {
163        key: "[PC preview] unknown key",
164        value: {
165          CustomizeData: {
166            name: "[PC preview] unknown name",
167            value: "[PC preview] unknown value",
168          }
169        }
170      }
171    },
172    abilityInfo: [
173      {
174        bundleName: "[PC preview] unknown bundle name",
175        name: "[PC preview] unknown name",
176        label: "[PC preview] unknown label",
177        description: "[PC preview] unknown description",
178        icon: "[PC preview] unknown icon",
179        labelId: "[PC preview] unknown label id",
180        descriptionId: "[PC preview] unknown description id",
181        iconId: "[PC preview] unknown icon id",
182        moduleName: "[PC preview] unknown module name",
183        process: "[PC preview] unknown process",
184        targetAbility: "[PC preview] unknown target ability",
185        backgroundModes: "[PC preview] unknown background modes",
186        isVisible: "[PC preview] unknown is visible",
187        formEnabled: "[PC preview] unknown form enabled",
188        type: "[PC preview] unknown type",
189        subType: "[PC preview] unknown sub type",
190        orientation: "[PC preview] unknown orientation",
191        launchMode: "[PC preview] unknown launch mode",
192        permissions: ["[PC preview] unknown permission"],
193        deviceTypes: ["[PC preview] unknown device type"],
194        deviceCapabilities: ["[PC preview] unknown device capability"],
195        readPermission: "[PC preview] unknown read permission",
196        writePermission: "[PC preview] unknown write permission",
197        applicationInfo: {
198          packageName: "[PC preview] unknown package name",
199          className: "[PC preview] unknown class name",
200          name: "[PC preview] unknown name",
201          labelId: "[PC preview] unknown label id",
202          iconId: "[PC preview] unknown icon id",
203          sourceDir: "[PC preview] unknown source dir",
204          flags: "[PC preview] unknown flags",
205          customizeData: {
206            key: "[PC preview] unknown key",
207            value: {
208              CustomizeData: {
209                name: "[PC preview] unknown name",
210                value: "[PC preview] unknown value",
211              }
212            }
213          }
214        },
215        formEntity: "[PC preview] unknown form entity",
216        minFormHeight: "[PC preview] unknown min form height",
217        defaultFormHeight: "[PC preview] unknown default form height",
218        minFormWidth: "[PC preview] unknown min form width",
219        defaultFormWidth: "[PC preview] unknown default form width",
220        uri: "[PC preview] unknown uri",
221        customizeData: {
222          key: "[PC preview] unknown key",
223          value: [
224            {
225              CustomizeData: {
226                name: "[PC preview] unknown name",
227                value: "[PC preview] unknown value",
228              },
229            },
230            {
231              CustomizeData: {
232                name: "[PC preview] unknown name",
233                value: "[PC preview] unknown value",
234              },
235            }
236          ]
237        },
238      }
239    ],
240    reqPermissions: ["[PC preview] unknown repermission"],
241    reqPermissionDetails: [
242      {
243        name: "[PC preview] unknown name",
244        reason: "[PC preview] unknown reason",
245        usedScene: {
246          abilities: ["[PC preview] unknown ability"],
247          when: "[PC preview] unknown when",
248        }
249      }
250    ],
251    vendor: "[PC preview] unknown vendor",
252    versionCode: "[PC preview] unknown versionCode",
253    versionName: "[PC preview] unknown versionName",
254    compatibleVersion: "[PC preview] unknown compatibleVersion",
255    targetVersion: "[PC preview] unknown targetVersion",
256    isCompressNativeLibs: "[PC preview] unknown isCompressNativeLibs",
257    hapModuleInfo: [
258      {
259        name: "[PC preview] unknown name",
260        description: "[PC preview] unknown desciption",
261        descriptionId: "[PC preview] unknown description id",
262        icon: "[PC preview] unknown icon",
263        label: "[PC preview] unknown label",
264        labelId: "[PC preview] unknown label id",
265        iconId: "[PC preview] unknown iconid",
266        backgroundImg: "[PC preview] unknown back ground img",
267        supportedModes: "[PC preview] unknown supported modes",
268        reqCapabilities: ["[PC preview] unknown reqcapability"],
269        deviceTypes: ["[PC preview] unknown device type"],
270        abilityInfo: [
271          {
272            bundleName: "[PC preview] unknown bundle name",
273            name: "[PC preview] unknown name",
274            label: "[PC preview] unknown label",
275            description: "[PC preview] unknown description",
276            icon: "[PC preview] unknown icon",
277            labelId: "[PC preview] unknown label id",
278            descriptionId: "[PC preview] unknown description id",
279            iconId: "[PC preview] unknown icon id",
280            moduleName: "[PC preview] unknown module name",
281            process: "[PC preview] unknown process",
282            targetAbility: "[PC preview] unknown target ability",
283            backgroundModes: "[PC preview] unknown back ground modes",
284            isVisible: "[PC preview] unknown is visible",
285            formEnabled: "[PC preview] unknown form enabled",
286            type: "[PC preview] unknown bundle.AbilityType",
287            subType: " [PC preview] unknown bundle.AbilitySubType",
288            orientation: "[PC preview] unknown bundle.DisplayOrientation",
289            launchMode: " [PC preview] unknown bundle.LaunchMode",
290            permissions: ["[PC preview] unknown permission"],
291            deviceTypes: ["[PC preview] unknown device type"],
292            deviceCapabilities: ["[PC preview] unknown device capability "],
293            readPermission: "[PC preview] unknown read permission",
294            writePermission: "[PC preview] unknown write permission",
295            applicationInfo: {
296              packageName: "[PC preview] unknown package name",
297              className: "[PC preview] unknown class name",
298              name: "[PC preview] unknown name",
299              labelId: "[PC preview] unknown label id",
300              iconId: "[PC preview] unknown icon id",
301              sourceDir: "[PC preview] unknown source dir",
302              flags: "[PC preview] unknown flags",
303              customizeData: {
304                key: "[PC preview] unknown key",
305                value: {
306                  CustomizeData: {
307                    name: "[PC preview] unknown name",
308                    value: "[PC preview] unknown value",
309                  }
310                }
311              }
312            },
313            formEntity: "[PC preview] unknown form entity",
314            minFormHeight: "[PC preview] unknown min form height",
315            defaultFormHeight: "[PC preview] unknown default form height",
316            minFormWidth: "[PC preview] unknown min form width",
317            defaultFormWidth: "[PC preview] unknown default form width",
318            uri: "[PC preview] unknown uri",
319            customizeData: {
320              key: "[PC preview] unknown key",
321              value: [
322                {
323                  CustomizeData: {
324                    name: "[PC preview] unknown name",
325                    value: "[PC preview] unknown value",
326                  },
327                },
328                {
329                  CustomizeData: {
330                    name: "[PC preview] unknown name",
331                    value: "[PC preview] unknown value",
332                  },
333                }
334              ]
335            },
336          }
337        ],
338        moduleName: "[PC preview] unknown module name",
339        mainAbilityName: "[PC preview] unknown main ability name",
340        installationFree: "[PC preview] unknown installation free",
341      }
342    ],
343    entryModuleName: "[PC preview] unknown entry module name",
344    cpuAbi: "[PC preview] unknown cpu abi",
345    isSilentInstallation: "[PC preview] unknown is silent installation",
346    minCompatibleVersionCode: "[PC preview] unknown min compatible version code",
347    entryInstallationFree: "[PC preview] unknown entry installation free",
348  }
349  const PermissionDefMock = {
350    name: "[PC preview] unknown name",
351    permissionFlags: "[PC preview] unknown permission flags",
352    grantMode: "[PC preview] unknown grant mode",
353    availableScope: "[PC preview] unknown available scope",
354    labelRes: "[PC preview] unknown label res",
355    descriptionRes: "[PC preview] unknown description res",
356    group: "[PC preview] unknown group",
357    usageInfo: "[PC preview] unknown usage info",
358    reminderDesc: "[PC preview] unknown reminder desc",
359    reminderIcon: "[PC preview] unknown reminder icon"
360  }
361  const PermissionDefsMock = [
362    {
363      name: "[PC preview] unknown name",
364      permissionFlags: "[PC preview] unknown permission flags",
365      grantMode: "[PC preview] unknown grant mode",
366      availableScope: "[PC preview] unknown available scope",
367      labelRes: "[PC preview] unknown label res",
368      descriptionRes: "[PC preview] unknown description res",
369      group: "[PC preview] unknown group",
370      usageInfo: "[PC preview] unknown usage info",
371      reminderDesc: "[PC preview] unknown reminder desc",
372      reminderIcon: "[PC preview] unknown reminder icon"
373    }
374  ]
375  const BundlePackInfoMock = {
376    packages: [
377      {
378        deviceType: ["[PC preview] unknown device type"],
379        name: "[PC preview] unknown name",
380        moduleType: "[PC preview] unknown module type",
381        deliveryWithInstall: "[PC preview] unknown deliver with install",
382      }
383    ],
384    summary: {
385      app: {
386        bundleName: "[PC preview] unknown bundle name",
387        version: {
388          minCompatibleVersionCode: "[PC preview] unknown min compatible version code",
389          name: "[PC preview] unknown name",
390          code: " [PC preview] unknown code",
391        }
392      },
393      modules: [
394        {
395          apiVersion: {
396            releaseType: "[PC preview] unknown release type",
397            compatible: "[PC preview] unknown compatible",
398            target: "[PC preview] unknown target",
399          },
400          deviceType: ["[PC preview] unknown device type"],
401          distro: {
402            deliveryWithInstall: "[PC preview] unknown deliver with install",
403            installationFree: "[PC preview] unknown installation free",
404            moduleName: "[PC preview] unknown module name",
405            moduleType: "[PC preview] unknown module type",
406            mainAbility: "[PC preview] unknown main ability",
407          },
408          abilities: [
409            {
410              name: "[PC preview] unknown name",
411              label: "[PC preview] unknown label",
412              visible: '[PC preview] unknown visible',
413              forms: [
414                {
415                  name: "[PC preview] unknown name",
416                  type: "[PC preview] unknown type",
417                  updateEnabled: "[PC preview] unknown update enabled",
418                  scheduledUpateTime: "[PC preview] unknown scheduled updte time",
419                  updateDuration: "[PC preview] unknown update duration",
420                  supportDimensions: ["[PC preview] unknown support dimension"],
421                  defaultDimension: "[PC preview] unknown default dimension",
422                }
423              ]
424            }
425          ]
426        }
427      ]
428    },
429  }
430  const ApplicationInfosMock = [
431    {
432      packageName: "[PC preview] unknown package name",
433      className: "[PC preview] unknown class name",
434      name: "[PC preview] unknown name",
435      labelId: "[PC preview] unknown label id",
436      iconId: "[PC preview] unknown icon id",
437      sourceDir: "[PC preview] unknown source dir",
438      flags: "[PC preview] unknown flags",
439      customizeData: {
440        key: "[PC preview] unknown key",
441        value: {
442          CustomizeData: {
443            name: "[PC preview] unknown name",
444            value: "[PC preview] unknown value",
445          }
446        }
447      }
448    },
449  ]
450
451  const AbilityInfosMock = [
452    {
453      bundleName: "[PC preview] unknown bundle name",
454      name: "[PC preview] unknown name",
455      label: "[PC preview] unknown label",
456      description: "[PC preview] unknown descrption",
457      icon: "[PC preview] unknown icon",
458      labelId: "[PC preview] unknown label id",
459      descriptionId: "[PC preview] unknown description id",
460      iconId: "[PC preview] unknown icon id",
461      moduleName: "[PC preview] unknown module name",
462      process: "[PC preview] unknown process",
463      targetAbility: "[PC preview] unknown target ability",
464      backgroundModes: "[PC preview] unknown background modes ",
465      isVisible: "[PC preview] unknown is visible",
466      formEnabled: "[PC preview] unknown form enabled",
467      type: "[PC preview] unknown bundle.AbilityType",
468      subType: "[PC preview] unknown bundle.AbilitySubType",
469      orientation: "[PC preview] unknown bundle.DisplayOrientation",
470      launchMode: "[PC preview] unknown bundle.LaunchMode",
471      permissions: ["[PC preview] unknown  permission"],
472      deviceTypes: ["[PC preview] unknown device type"],
473      deviceCapabilities: ["[PC preview] unknown device capability"],
474      readPermission: "[PC preview] unknown read permission",
475      writePermission: "[PC preview] unknown write permission",
476      applicationInfo: {
477        packageName: "[PC preview] unknown package name",
478        className: "[PC preview] unknown class name",
479        name: "[PC preview] unknown name",
480        labelId: "[PC preview] unknown label id",
481        iconId: "[PC preview] unknown icon id",
482        sourceDir: "[PC preview] unknown source dir",
483        flags: "[PC preview] unknown flags",
484        customizeData: {
485          key: "[PC preview] unknown key",
486          value: {
487            CustomizeData: {
488              name: "[PC preview] unknown name",
489              value: "[PC preview] unknown value",
490            }
491          }
492        }
493      },
494      formEntity: "[PC preview] unknown form entitty",
495      minFormHeight: "[PC preview] unknown minForm Height",
496      defaultFormHeight: "[PC preview] unknown default Form Height",
497      minFormWidth: "[PC preview] unknown default min Form Width",
498      defaultFormWidth: "[PC preview] unknown default form width",
499      uri: "[PC preview] unknown uri",
500      customizeData: {
501        key: "[PC preview] unknown key",
502        value: [
503          {
504            CustomizeData: {
505              name: "[PC preview] unknown name",
506              value: "[PC preview] unknown value",
507            },
508          },
509          {
510            CustomizeData: {
511              name: "[PC preview] unknown name",
512              value: "[PC preview] unknown value",
513            },
514          }
515        ]
516      },
517    }
518  ]
519  const AbilityInfoMock = {
520    bundleName: "[PC preview] unknown bundle name",
521    name: "[PC preview] unknown name",
522    label: "[PC preview] unknown label",
523    description: "[PC preview] unknown descrption",
524    icon: "[PC preview] unknown icon",
525    labelId: "[PC preview] unknown label id",
526    descriptionId: "[PC preview] unknown description id",
527    iconId: "[PC preview] unknown icon id",
528    moduleName: "[PC preview] unknown module name",
529    process: "[PC preview] unknown process",
530    targetAbility: "[PC preview] unknown target ability",
531    backgroundModes: "[PC preview] unknown background modes ",
532    isVisible: "[PC preview] unknown is visible",
533    formEnabled: "[PC preview] unknown form enabled",
534    type: "[PC preview] unknown bundle.AbilityType",
535    subType: "[PC preview] unknown bundle.AbilitySubType",
536    orientation: "[PC preview] unknown bundle.DisplayOrientation",
537    launchMode: "[PC preview] unknown bundle.LaunchMode",
538    permissions: ["[PC preview] unknown  permission"],
539    deviceTypes: ["[PC preview] unknown device type"],
540    deviceCapabilities: ["[PC preview] unknown device capability"],
541    readPermission: "[PC preview] unknown read permission",
542    writePermission: "[PC preview] unknown write permission",
543    applicationInfo: {
544      packageName: "[PC preview] unknown package name",
545      className: "[PC preview] unknown class name",
546      name: "[PC preview] unknown name",
547      labelId: "[PC preview] unknown label id",
548      iconId: "[PC preview] unknown icon id",
549      sourceDir: "[PC preview] unknown source dir",
550      flags: "[PC preview] unknown flags",
551      customizeData: {
552        key: "[PC preview] unknown key",
553        value: {
554          CustomizeData: {
555            name: "[PC preview] unknown name",
556            value: "[PC preview] unknown value",
557          }
558        }
559      }
560    },
561    formEntity: "[PC preview] unknown form entitty",
562    minFormHeight: "[PC preview] unknown minForm Height",
563    defaultFormHeight: "[PC preview] unknown default Form Height",
564    minFormWidth: "[PC preview] unknown default min Form Width",
565    defaultFormWidth: "[PC preview] unknown default form width",
566    uri: "[PC preview] unknown uri",
567    customizeData: {
568      key: "[PC preview] unknown key",
569      value: [
570        {
571          CustomizeData: {
572            name: "[PC preview] unknown name",
573            value: "[PC preview] unknown value",
574          },
575        },
576        {
577          CustomizeData: {
578            name: "[PC preview] unknown name",
579            value: "[PC preview] unknown value",
580          },
581        }
582      ]
583    },
584  }
585  const ApplicationInfoMock = {
586    packageName: "[PC preview] unknown package name",
587    className: "[PC preview] unknown class name",
588    name: "[PC preview] unknown name",
589    labelId: "[PC preview] unknown label id",
590    iconId: "[PC preview] unknown icon id",
591    sourceDir: "[PC preview] unknown source dir",
592    flags: "[PC preview] unknown flags",
593    customizeData: {
594      key: "[PC preview] unknown key",
595      value: {
596        CustomizeData: {
597          name: "[PC preview] unknown name",
598          value: "[PC preview] unknown value",
599        }
600      }
601    }
602  }
603
604  const BundleInfosMock = [
605    {
606      name: "[PC preview] unknown name",
607      type: "[PC preview] unknown type",
608      appId: "[PC preview] unknown app id",
609      uid: "[PC preview] unknown uid",
610      installTime: "[PC preview] unknown install time",
611      updateTime: "[PC preview] unknown up date time",
612      appInfo: {
613        packageName: "[PC preview] unknown package name",
614        className: "[PC preview] unknown class name",
615        name: "[PC preview] unknown name",
616        labelId: "[PC preview] unknown label id",
617        iconId: "[PC preview] unknown icon id",
618        sourceDir: "[PC preview] unknown source dir",
619        flags: "[PC preview] unknown flags",
620        customizeData: {
621          key: "[PC preview] unknown key",
622          value: {
623            CustomizeData: {
624              name: "[PC preview] unknown name",
625              value: "[PC preview] unknown value",
626            }
627          }
628        }
629      },
630      abilityInfo: [
631        {
632          bundleName: "[PC preview] unknown bundle name",
633          name: "[PC preview] unknown name",
634          label: "[PC preview] unknown label",
635          description: "[PC preview] unknown description",
636          icon: "[PC preview] unknown icon",
637          labelId: "[PC preview] unknown label id",
638          descriptionId: "[PC preview] unknown description id",
639          iconId: "[PC preview] unknown icon id",
640          moduleName: "[PC preview] unknown module name",
641          process: "[PC preview] unknown process",
642          targetAbility: "[PC preview] unknown target ability",
643          backgroundModes: "[PC preview] unknown background modes",
644          isVisible: "[PC preview] unknown is visible",
645          formEnabled: "[PC preview] unknown form enabled",
646          type: "[PC preview] unknown type",
647          subType: "[PC preview] unknown sub type",
648          orientation: "[PC preview] unknown orientation",
649          launchMode: "[PC preview] unknown launch mode",
650          permissions: ["[PC preview] unknown permission"],
651          deviceTypes: ["[PC preview] unknown device type"],
652          deviceCapabilities: ["[PC preview] unknown device capability"],
653          readPermission: "[PC preview] unknown read permission",
654          writePermission: "[PC preview] unknown write permission",
655          applicationInfo: {
656            packageName: "[PC preview] unknown package name",
657            className: "[PC preview] unknown class name",
658            name: "[PC preview] unknown name",
659            labelId: "[PC preview] unknown label id",
660            iconId: "[PC preview] unknown icon id",
661            sourceDir: "[PC preview] unknown source dir",
662            flags: "[PC preview] unknown flags",
663            customizeData: {
664              key: "[PC preview] unknown key",
665              value: {
666                CustomizeData: {
667                  name: "[PC preview] unknown name",
668                  value: "[PC preview] unknown value",
669                }
670              }
671            }
672          },
673          formEntity: "[PC preview] unknown form entity",
674          minFormHeight: "[PC preview] unknown min form height",
675          defaultFormHeight: "[PC preview] unknown default form height",
676          minFormWidth: "[PC preview] unknown min form width",
677          defaultFormWidth: "[PC preview] unknown default form width",
678          uri: "[PC preview] unknown uri",
679          customizeData: {
680            key: "[PC preview] unknown key",
681            value: [
682              {
683                CustomizeData: {
684                  name: "[PC preview] unknown name",
685                  value: "[PC preview] unknown value",
686                },
687              },
688              {
689                CustomizeData: {
690                  name: "[PC preview] unknown name",
691                  value: "[PC preview] unknown value",
692                },
693              }
694            ]
695          },
696        }
697      ],
698      reqPermissions: ["[PC preview] unknown repermission"],
699      reqPermissionDetails: [
700        {
701          name: "[PC preview] unknown name",
702          reason: "[PC preview] unknown reason",
703          usedScene: {
704            abilities: ["[PC preview] unknown ability"],
705            when: "[PC preview] unknown when",
706          }
707        }
708      ],
709      vendor: "[PC preview] unknown vendor",
710      versionCode: "[PC preview] unknown versionCode",
711      versionName: "[PC preview] unknown versionName",
712      compatibleVersion: "[PC preview] unknown compatibleVersion",
713      targetVersion: "[PC preview] unknown targetVersion",
714      isCompressNativeLibs: "[PC preview] unknown isCompressNativeLibs",
715      hapModuleInfo: [
716        {
717          name: "[PC preview] unknown name",
718          description: "[PC preview] unknown desciption",
719          descriptionId: "[PC preview] unknown description id",
720          icon: "[PC preview] unknown icon",
721          label: "[PC preview] unknown label",
722          labelId: "[PC preview] unknown label id",
723          iconId: "[PC preview] unknown iconid",
724          backgroundImg: "[PC preview] unknown back ground img",
725          supportedModes: "[PC preview] unknown supported modes",
726          reqCapabilities: ["[PC preview] unknown reqcapability"],
727          deviceTypes: ["[PC preview] unknown device type"],
728          abilityInfo: [
729            {
730              bundleName: "[PC preview] unknown bundle name",
731              name: "[PC preview] unknown name",
732              label: "[PC preview] unknown label",
733              description: "[PC preview] unknown description",
734              icon: "[PC preview] unknown icon",
735              labelId: "[PC preview] unknown label id",
736              descriptionId: "[PC preview] unknown description id",
737              iconId: "[PC preview] unknown icon id",
738              moduleName: "[PC preview] unknown module name",
739              process: "[PC preview] unknown process",
740              targetAbility: "[PC preview] unknown target ability",
741              backgroundModes: "[PC preview] unknown back ground modes",
742              isVisible: "[PC preview] unknown is visible",
743              formEnabled: "[PC preview] unknown form enabled",
744              type: "[PC preview] unknown bundle.AbilityType",
745              subType: " [PC preview] unknown bundle.AbilitySubType",
746              orientation: "[PC preview] unknown bundle.DisplayOrientation",
747              launchMode: " [PC preview] unknown bundle.LaunchMode",
748              permissions: ["[PC preview] unknown permission"],
749              deviceTypes: ["[PC preview] unknown device type"],
750              deviceCapabilities: ["[PC preview] unknown device capability "],
751              readPermission: "[PC preview] unknown read permission",
752              writePermission: "[PC preview] unknown write permission",
753              applicationInfo: {
754                packageName: "[PC preview] unknown package name",
755                className: "[PC preview] unknown class name",
756                name: "[PC preview] unknown name",
757                labelId: "[PC preview] unknown label id",
758                iconId: "[PC preview] unknown icon id",
759                sourceDir: "[PC preview] unknown source dir",
760                flags: "[PC preview] unknown flags",
761                customizeData: {
762                  key: "[PC preview] unknown key",
763                  value: {
764                    CustomizeData: {
765                      name: "[PC preview] unknown name",
766                      value: "[PC preview] unknown value",
767                    }
768                  }
769                }
770              },
771              formEntity: "[PC preview] unknown form entity",
772              minFormHeight: "[PC preview] unknown min form height",
773              defaultFormHeight: "[PC preview] unknown default form height",
774              minFormWidth: "[PC preview] unknown min form width",
775              defaultFormWidth: "[PC preview] unknown default form width",
776              uri: "[PC preview] unknown uri",
777              customizeData: {
778                key: "[PC preview] unknown key",
779                value: [
780                  {
781                    CustomizeData: {
782                      name: "[PC preview] unknown name",
783                      value: "[PC preview] unknown value",
784                    },
785                  },
786                  {
787                    CustomizeData: {
788                      name: "[PC preview] unknown name",
789                      value: "[PC preview] unknown value",
790                    },
791                  }
792                ]
793              },
794            }
795          ],
796          moduleName: "[PC preview] unknown module name",
797          mainAbilityName: "[PC preview] unknown main ability name",
798          installationFree: "[PC preview] unknown installation free",
799        }
800      ],
801      entryModuleName: "[PC preview] unknown entry module name",
802      cpuAbi: "[PC preview] unknown cpu abi",
803      isSilentInstallation: "[PC preview] unknown is silent installation",
804      minCompatibleVersionCode: "[PC preview] unknown min compatible version code",
805      entryInstallationFree: "[PC preview] unknown entry installation free"
806    }
807  ]
808  const BundleOptionsMock = {
809    userId: "[PC preview] unknown user id",
810    networkId: "[PC preview] unknown network id",
811  }
812  const LauncherAbilityInfoMock = {
813    abilityInfo: {
814      bundleName: "[PC preview] unknown bundle name",
815      name: "[PC preview] unknown name",
816      label: "[PC preview] unknown label",
817      description: "[PC preview] unknown description",
818      icon: "[PC preview] unknown icon",
819      labelId: "[PC preview] unknown label id",
820      descriptionId: "[PC preview] unknown description id",
821      iconId: "[PC preview] unknown icon id",
822      moduleName: "[PC preview] unknown module name",
823      process: "[PC preview] unknown process",
824      targetAbility: "[PC preview] unknown target ability",
825      backgroundModes: "[PC preview] unknown background modes",
826      isVisible: "[PC preview] unknown is visible",
827      formEnabled: "[PC preview] unknown form enabled",
828      type: "[PC preview] unknown type",
829      subType: "[PC preview] unknown sub type",
830      orientation: "[PC preview] unknown orientation",
831      launchMode: "[PC preview] unknown launch mode",
832      permissions: ["[PC preview] unknown permission"],
833      deviceTypes: ["[PC preview] unknown device type"],
834      deviceCapabilities: ["[PC preview] unknown device capability"],
835      readPermission: "[PC preview] unknown read permission",
836      writePermission: "[PC preview] unknown write permission",
837      applicationInfo: {
838        packageName: "[PC preview] unknown package name",
839        className: "[PC preview] unknown class name",
840        name: "[PC preview] unknown name",
841        labelId: "[PC preview] unknown label id",
842        iconId: "[PC preview] unknown icon id",
843        sourceDir: "[PC preview] unknown source dir",
844        flags: "[PC preview] unknown flags",
845        customizeData: {
846          key: "[PC preview] unknown key",
847          value: {
848            CustomizeData: {
849              name: "[PC preview] unknown name",
850              value: "[PC preview] unknown value",
851            }
852          }
853        }
854      },
855      formEntity: "[PC preview] unknown form entity",
856      minFormHeight: "[PC preview] unknown min form height",
857      defaultFormHeight: "[PC preview] unknown default form height",
858      minFormWidth: "[PC preview] unknown min form width",
859      uri: "[PC preview] unknown uri",
860      customizeData: {
861        key: "[PC preview] unknown key",
862        value: [
863          {
864            CustomizeData: {
865              name: "[PC preview] unknown name",
866              value: "[PC preview] unknown value",
867            },
868          },
869          {
870            CustomizeData: {
871              name: "[PC preview] unknown name",
872              value: "[PC preview] unknown value",
873            },
874          }
875        ]
876      },
877    },
878    elementName: {
879      deviceId: "[PC preview] unknown device id",
880      bundleName: "[PC preview] unknown bundle name",
881      abilityName: "[PC preview] unknown ability name",
882      uri: "[PC preview] unknown uri",
883      shortName: "[PC preview] unknown short name",
884    },
885    userId: "[PC preview] unknown user id",
886    installTime: "[PC preview] unknown install time",
887  }
888
889const ExtensionAbilityInfoMock = [
890  {
891    bundleName: "[PC preview] unknown bundle name",
892    moduleName: "[PC preview] unknown module name",
893    name: "[PC preview] unknown name",
894    labelId: "[PC preview] unknown label id",
895    descriptionId: "[PC preview] unknown description id",
896    iconId: "[PC preview] unknown icon id",
897    isVisible: "[PC preview] unknown is visible",
898    extensionAbilityType: "[PC preview] unknown extension abilityType",
899    permissions: "[PC preview] unknown permissions",
900    applicationInfo: "[PC preview] unknown application info",
901    metadata: "[PC preview] unknown metadata",
902    enabled: "[PC preview] unknown enabled",
903    readPermission: "[PC preview] unknown read permission",
904    writePermission: "[PC preview] unknown write permission",
905  }
906]
907
908  const ModuleUpdateFlagMock = {
909    FLAG_MODULE_UPGRADE_CHECK: 0,
910    FLAG_MODULE_UPGRADE_INSTALL: 1,
911    FLAG_MODULE_UPGRADE_INSTALL_WITH_CONFIG_WINDOWS: 2,
912  }
913  const BundleFlagMock = {
914    GET_BUNDLE_DEFAULT: 0x00000000,
915    GET_BUNDLE_WITH_ABILITIES: 0x00000001,
916    GET_ABILITY_INFO_WITH_PERMISSION: 0x00000002,
917    GET_ABILITY_INFO_WITH_APPLICATION: 0x00000004,
918    GET_APPLICATION_INFO_WITH_PERMISSION: 0x00000008,
919    GET_BUNDLE_WITH_REQUESTED_PERMISSION: 0x00000010,
920    GET_ALL_APPLICATION_INFO: 0xFFFF0000,
921  }
922  const ColorModeMock = {
923    AUTO_MODE: -1,
924    DARK_MODE: 0,
925    LIGHT_MODE: 1,
926  }
927  const ModuleRemoveFlagMock = {
928    FLAG_MODULE_NOT_USED_BY_FORM: 0,
929    FLAG_MODULE_USED_BY_FORM: 1,
930    FLAG_MODULE_NOT_USED_BY_SHORTCUT: 2,
931    FLAG_MODULE_USED_BY_SHORTCUT: 3,
932  }
933  const SignatureCompareResultMock = {
934    SIGNATURE_MATCHED: 0,
935    SIGNATURE_NOT_MATCHED: 1,
936    SIGNATURE_UNKNOWN_BUNDLE: 2,
937  }
938  const ShortcutExistenceMock = {
939    SHORTCUT_EXISTENCE_EXISTS: 0,
940    SHORTCUT_EXISTENCE_NOT_EXISTS: 1,
941    SHORTCUT_EXISTENCE_UNKNOWN: 2,
942  }
943  const QueryShortCutFlagMock = {
944    QUERY_SHORYCUT_HOME: 0,
945  }
946  const GrantStatusMock = {
947    PERMISSION_DENIED: -1,
948    PERMISSION_GRANTED: 0,
949  }
950  const AbilityTypeMock = {
951    UNKNOWN: 0,
952    PAGE: 1,
953    SERVICE: 2,
954    DATA: 3
955  }
956  const AbilitySubTypeMock = {
957    UNSPECIFIED: 0,
958    CA: 1,
959  }
960  const DisplayOrientationMock = {
961    UNSPECIFIED: 0,
962    LANDSCAPE: 1,
963    PORTRAIT: 2,
964    FOLLOW_RECENT: 3
965  }
966  const LaunchModeMock = {
967    SINGLETON: 0,
968    STANDARD: 1,
969  }
970  const InstallErrorCodeMock = {
971    SUCCESS: 0,
972    STATUS_INSTALL_FAILURE: 1,
973    STATUS_INSTALL_FAILURE_ABORTED: 2,
974    STATUS_INSTALL_FAILURE_INVALID: 3,
975    STATUS_INSTALL_FAILURE_CONFLICT: 4,
976    STATUS_INSTALL_FAILURE_STORAGE: 5,
977    STATUS_INSTALL_FAILURE_INCOMPATIBLE: 6,
978    STATUS_UNINSTALL_FAILURE: 7,
979    STATUS_UNINSTALL_FAILURE_BLOCKE: 8,
980    STATUS_UNINSTALL_FAILURE_ABORTED: 9,
981    STATUS_UNINSTALL_FAILURE_CONFLICT: 10,
982    STATUS_INSTALL_FAILURE_DOWNLOAD_TIMEOUT: 0x0B,
983    STATUS_INSTALL_FAILURE_DOWNLOAD_FAILED: 0x0C,
984    STATUS_ABILITY_NOT_FOUND: 0x40,
985    STATUS_BMS_SERVICE_ERROR: 0x41
986  }
987  const BundleErrorMock = {
988    REMOTE_EXCEPTION: 0,
989    SECURITY_EXCEPTION: 1
990  }
991
992  global.ohosplugin.bundle = {
993    getBundleInfo: function (...args) {
994      console.warn("bundle.getBundleInfo interface mocked in the Previewer. How this interface works on the" +
995        " Previewer may be different from that on a real device.")
996      const len = args.length;
997      if (typeof args[len - 1] === 'function') {
998        args[len - 1].call(this, paramMock.businessErrorMock, BundleInfoMock)
999      } else {
1000        return new Promise((resolve) => {
1001          resolve(BundleInfoMock)
1002        });
1003      }
1004    },
1005    getBundleInstaller: function (...args) {
1006      console.warn("bundle.getBundleInstaller interface mocked in the Previewer. How this interface works on the" +
1007        " Previewer may be different from that on a real device.")
1008      const len = args.length
1009      if (typeof args[len - 1] === 'function') {
1010        args[len - 1].call(this, paramMock.businessErrorMock, BundleInstallerMock)
1011      } else {
1012        return new Promise((resolve) => {
1013          resolve(BundleInstallerMock)
1014        });
1015      }
1016    },
1017    getApplicationInfo: function (...args) {
1018      console.warn("bundle.getApplicationInfo interface mocked in the Previewer. How this interface works on the" +
1019        " Previewer may be different from that on a real device.")
1020      const len = args.length
1021      if (typeof args[len - 1] === 'function') {
1022        args[len - 1].call(this, paramMock.businessErrorMock, ApplicationInfoMock)
1023      } else {
1024        return new Promise((resolve) => {
1025          resolve(ApplicationInfoMock)
1026        });
1027      }
1028    },
1029    queryAbilityByWant: function (...args) {
1030      console.warn("bundle.queryAbilityByWant interface mocked in the Previewer. How this interface works on the" +
1031        " Previewer may be different from that on a real device.")
1032      const len = args.length
1033      if (typeof args[len - 1] === 'function') {
1034        args[len - 1].call(this, paramMock.businessErrorMock, AbilityInfosMock)
1035      } else {
1036        return new Promise((resolve) => {
1037          resolve(AbilityInfosMock)
1038        });
1039      }
1040    },
1041    getAllBundleInfo: function (...args) {
1042      console.warn("bundle.getAllBundleInfo interface mocked in the Previewer. How this interface works on the" +
1043        " Previewer may be different from that on a real device.")
1044      const len = args.length
1045      if (typeof args[len - 1] === 'function') {
1046        args[len - 1].call(this, paramMock.businessErrorMock, BundleInfosMock)
1047      } else {
1048        return new Promise((resolve) => {
1049          resolve(BundleInfosMock)
1050        });
1051      }
1052    },
1053    getBundlesForUid: function (...args) {
1054      console.warn("bundle.getBundlesForUid interface mocked in the Previewer. How this interface works on the" +
1055        " Previewer may be different from that on a real device.")
1056      const len = args.length
1057      if (typeof args[len - 1] === 'function') {
1058        args[len - 1].call(this, paramMock.businessErrorMock, ArrayStringMock)
1059      } else {
1060        return new Promise((resolve) => {
1061          resolve(ArrayStringMock)
1062        });
1063      }
1064    },
1065    getAllApplicationInfo: function (...args) {
1066      console.warn("bundle.getAllApplicationInfo interface mocked in the Previewer. How this interface works on the" +
1067        " Previewer may be different from that on a real device.")
1068      const len = args.length
1069      if (typeof args[len - 1] === 'function') {
1070        args[len - 1].call(this, paramMock.businessErrorMock, ApplicationInfosMock)
1071      } else {
1072        return new Promise((resolve) => {
1073          resolve(ApplicationInfosMock)
1074        });
1075      }
1076    },
1077    getSystemAvailableCapabilities: function (...args) {
1078      console.warn("bundle.getSystemAvailableCapabilities interface mocked in the Previewer. How this interface works on the" +
1079        " Previewer may be different from that on a real device.")
1080      const len = args.length
1081      if (typeof args[len - 1] === 'function') {
1082        args[len - 1].call(this, paramMock.businessErrorMock, ArrayStringMock)
1083      } else {
1084        return new Promise((resolve) => {
1085          resolve(ArrayStringMock)
1086        });
1087      }
1088    },
1089    hasSystemCapability: function (...args) {
1090      console.warn("bundle.hasSystemCapability interface mocked in the Previewer. How this interface works on the" +
1091        " Previewer may be different from that on a real device.")
1092      const len = args.length
1093      if (typeof args[len - 1] === 'function') {
1094        args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramBooleanMock)
1095      } else {
1096        return new Promise((resolve) => {
1097          resolve(paramMock.paramBooleanMock)
1098        });
1099      }
1100    },
1101    getBundleGids: function (...args) {
1102      console.warn("bundle.getBundleGids interface mocked in the Previewer. How this interface works on the" +
1103        " Previewer may be different from that on a real device.")
1104      const len = args.length
1105      if (typeof args[len - 1] === 'function') {
1106        args[len - 1].call(this, paramMock.businessErrorMock, ArrayNumberMock)
1107      } else {
1108        return new Promise((resolve) => {
1109          resolve(ArrayNumberMock)
1110        });
1111      }
1112    },
1113    checkPublicKeys: function (...args) {
1114      console.warn("bundle.checkPublicKeys interface mocked in the Previewer. How this interface works on the" +
1115        " Previewer may be different from that on a real device.")
1116      const len = args.length
1117      if (typeof args[len - 1] === 'function') {
1118        args[len - 1].call(this, paramMock.businessErrorMock, SignatureCompareResultMock.SIGNATURE_MATCHED)
1119      } else {
1120        return new Promise((resolve) => {
1121          resolve(SignatureCompareResultMock.SIGNATURE_MATCHED)
1122        });
1123      }
1124    },
1125    getNameForUid: function (...args) {
1126      console.warn("bundle.getNameForUid interface mocked in the Previewer. How this interface works on the" +
1127        " Previewer may be different from that on a real device.")
1128      const len = args.length
1129      if (typeof args[len - 1] === 'function') {
1130        args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramStringMock)
1131      } else {
1132        return new Promise((resolve) => {
1133          resolve(paramMock.paramStringMock)
1134        });
1135      }
1136    },
1137    getBundleArchiveInfo: function (...args) {
1138      console.warn("bundle.getBundleArchiveInfo interface mocked in the Previewer. How this interface works on the" +
1139        " Previewer may be different from that on a real device.")
1140      const len = args.length
1141      if (typeof args[len - 1] === 'function') {
1142        args[len - 1].call(this, paramMock.businessErrorMock, BundleInfoMock)
1143      } else {
1144        return new Promise((resolve) => {
1145          resolve(BundleInfoMock)
1146        });
1147      }
1148    },
1149    isSafeMode: function (...args) {
1150      console.warn("bundle.isSafeMode interface mocked in the Previewer. How this interface works on the" +
1151        " Previewer may be different from that on a real device.")
1152      const len = args.length
1153      if (typeof args[len - 1] === 'function') {
1154        args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramBooleanMock)
1155      } else {
1156        return new Promise((resolve) => {
1157          resolve(paramMock.paramBooleanMock)
1158        });
1159      }
1160    },
1161    getLaunchWantForBundle: function (...args) {
1162      console.warn("bundle.getLaunchWantForBundle interface mocked in the Previewer. How this interface works on the" +
1163        " Previewer may be different from that on a real device.")
1164      const len = args.length
1165      if (typeof args[len - 1] === 'function') {
1166        args[len - 1].call(this, paramMock.businessErrorMock, WantMock)
1167      } else {
1168        return new Promise((resolve) => {
1169          resolve(WantMock)
1170        });
1171      }
1172    },
1173    setApplicationEnabled: function (...args) {
1174      console.warn("bundle.setApplicationEnabled interface mocked in the Previewer. How this interface works on the" +
1175        " Previewer may be different from that on a real device.")
1176      const len = args.length
1177      if (typeof args[len - 1] === 'function') {
1178        args[len - 1].call(this, paramMock.businessErrorMock)
1179      } else {
1180        return new Promise((resolve) => {
1181          resolve()
1182        });
1183      }
1184    },
1185    setAbilityEnabled: function (...args) {
1186      console.warn("bundle.setAbilityEnabled interface mocked in the Previewer. How this interface works on the" +
1187        " Previewer may be different from that on a real device.")
1188      const len = args.length
1189      if (typeof args[len - 1] === 'function') {
1190        args[len - 1].call(this, paramMock.businessErrorMock)
1191      } else {
1192        return new Promise((resolve) => {
1193          resolve()
1194        });
1195      }
1196    },
1197    isApplicationEnabled: function (...args) {
1198      console.warn("bundle.isApplicationEnabled interface mocked in the Previewer. How this interface works on the" +
1199        " Previewer may be different from that on a real device.")
1200      const len = args.length
1201      if (typeof args[len - 1] === 'function') {
1202        args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramBooleanMock)
1203      } else {
1204        return new Promise((resolve) => {
1205          resolve(paramMock.paramBooleanMock)
1206        });
1207      }
1208    },
1209    isAbilityEnabled: function (...args) {
1210      console.warn("bundle.isAbilityEnabled interface mocked in the Previewer. How this interface works on the" +
1211        " Previewer may be different from that on a real device.")
1212      const len = args.length
1213      if (typeof args[len - 1] === 'function') {
1214        args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramBooleanMock)
1215      } else {
1216        return new Promise((resolve) => {
1217          resolve(paramMock.paramBooleanMock)
1218        });
1219      }
1220    },
1221    cleanBundleCacheFiles: function (...args) {
1222      console.warn("bundle.cleanBundleCacheFiles interface mocked in the Previewer. How this interface works on the" +
1223        " Previewer may be different from that on a real device.")
1224      const len = args.length
1225      if (typeof args[len - 1] === 'function') {
1226        args[len - 1].call(this, paramMock.businessErrorMock)
1227      } else {
1228        return new Promise((resolve) => {
1229          resolve()
1230        });
1231      }
1232    },
1233    startShortcut: function (...args) {
1234      console.warn("bundle.startShortcut interface mocked in the Previewer. How this interface works on the" +
1235        " Previewer may be different from that on a real device.")
1236      const len = args.length
1237      if (typeof args[len - 1] === 'function') {
1238        args[len - 1].call(this, paramMock.businessErrorMock)
1239      } else {
1240        return new Promise((resolve) => {
1241          resolve()
1242        });
1243      }
1244    },
1245    getAppType: function (...args) {
1246      console.warn("bundle.getAppType interface mocked in the Previewer. How this interface works on the" +
1247        " Previewer may be different from that on a real device.")
1248      const len = args.length
1249      if (typeof args[len - 1] === 'function') {
1250        args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramStringMock)
1251      } else {
1252        return new Promise((resolve) => {
1253          resolve(paramMock.paramStringMock)
1254        });
1255      }
1256    },
1257    isShortcutExist: function (...args) {
1258      console.warn("bundle.isShortcutExist interface mocked in the Previewer. How this interface works on the" +
1259        " Previewer may be different from that on a real device.")
1260      const len = args.length
1261      if (typeof args[len - 1] === 'function') {
1262        args[len - 1].call(this, paramMock.businessErrorMock, ShortcutExistenceMock.SHORTCUT_EXISTENCE_EXISTS)
1263      } else {
1264        return new Promise((resolve) => {
1265          resolve(ShortcutExistenceMock.SHORTCUT_EXISTENCE_EXISTS)
1266        });
1267      }
1268    },
1269    isHomeShortcutSupported: function (...args) {
1270      console.warn("bundle.isHomeShortcutSupported interface mocked in the Previewer. How this interface works on the" +
1271        " Previewer may be different from that on a real device.")
1272      const len = args.length
1273      if (typeof args[len - 1] === 'function') {
1274        args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramBooleanMock)
1275      } else {
1276        return new Promise((resolve) => {
1277          resolve(paramMock.paramBooleanMock)
1278        });
1279      }
1280    },
1281    addHomeShortcut: function (...args) {
1282      console.warn("bundle.addHomeShortcut interface mocked in the Previewer. How this interface works on the" +
1283        " Previewer may be different from that on a real device.")
1284      const len = args.length
1285      if (typeof args[len - 1] === 'function') {
1286        args[len - 1].call(this, paramMock.businessErrorMock)
1287      } else {
1288        return new Promise((resolve) => {
1289          resolve()
1290        });
1291      }
1292    },
1293    updateShortcuts: function (...args) {
1294      console.warn("bundle.updateShortcuts interface mocked in the Previewer. How this interface works on the" +
1295        " Previewer may be different from that on a real device.")
1296      const len = args.length
1297      if (typeof args[len - 1] === 'function') {
1298        args[len - 1].call(this, paramMock.businessErrorMock)
1299      } else {
1300        return new Promise((resolve) => {
1301          resolve()
1302        });
1303      }
1304    },
1305    disableHomeShortcuts: function (...args) {
1306      console.warn("bundle.disableHomeShortcuts interface mocked in the Previewer. How this interface works on the" +
1307        " Previewer may be different from that on a real device.")
1308      const len = args.length
1309      if (typeof args[len - 1] === 'function') {
1310        args[len - 1].call(this, paramMock.businessErrorMock)
1311      } else {
1312        return new Promise((resolve) => {
1313          resolve()
1314        });
1315      }
1316    },
1317    enableHomeShortcuts: function (...args) {
1318      console.warn("bundle.enableHomeShortcuts interface mocked in the Previewer. How this interface works on the" +
1319        " Previewer may be different from that on a real device.")
1320      const len = args.length
1321      if (typeof args[len - 1] === 'function') {
1322        args[len - 1].call(this, paramMock.businessErrorMock)
1323      } else {
1324        return new Promise((resolve) => {
1325          resolve()
1326        });
1327      }
1328    },
1329    getAllHomeShortcutInfo: function (...args) {
1330      console.warn("bundle.getAllHomeShortcutInfo interface mocked in the Previewer. How this interface works on the" +
1331        " Previewer may be different from that on a real device.")
1332      const len = args.length
1333      if (typeof args[len - 1] === 'function') {
1334        args[len - 1].call(this, paramMock.businessErrorMock, ShortcutInfosMock)
1335      } else {
1336        return new Promise((resolve) => {
1337          resolve(ShortcutInfosMock)
1338        });
1339      }
1340    },
1341    getAppsGrantedPermissions: function (...args) {
1342      console.warn("bundle.getAppsGrantedPermissions interface mocked in the Previewer. How this interface works on the" +
1343        " Previewer may be different from that on a real device.")
1344      const len = args.length
1345      if (typeof args[len - 1] === 'function') {
1346        args[len - 1].call(this, paramMock.businessErrorMock, ArrayStringMock)
1347      } else {
1348        return new Promise((resolve) => {
1349          resolve(ArrayStringMock)
1350        });
1351      }
1352    },
1353    getAbilityIcon: function (...args) {
1354      console.warn("bundle.getAbilityIcon interface mocked in the Previewer. How this interface works on the" +
1355        " Previewer may be different from that on a real device.")
1356      const len = args.length
1357      if (typeof args[len - 1] === 'function') {
1358        args[len - 1].call(this, paramMock.businessErrorMock, PixelMapMock)
1359      } else {
1360        return new Promise((resolve) => {
1361          resolve(PixelMapMock)
1362        });
1363      }
1364    },
1365    getAbilityLabel: function (...args) {
1366      console.warn("bundle.getAbilityLabel interface mocked in the Previewer. How this interface works on the" +
1367        " Previewer may be different from that on a real device.")
1368      const len = args.length
1369      if (typeof args[len - 1] === 'function') {
1370        args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramStringMock)
1371      } else {
1372        return new Promise((resolve) => {
1373          resolve(paramMock.paramStringMock)
1374        });
1375      }
1376    },
1377    getClearUserDataFlag: function (...args) {
1378      console.warn("bundle.getClearUserDataFlag interface mocked in the Previewer. How this interface works on the" +
1379        " Previewer may be different from that on a real device.")
1380      const len = args.length
1381      if (typeof args[len - 1] === 'function') {
1382        args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramBooleanMock)
1383      } else {
1384        return new Promise((resolve) => {
1385          resolve(paramMock.paramBooleanMock)
1386        });
1387      }
1388    },
1389    setClearUserDataFlag: function (...args) {
1390      console.warn("bundle.setClearUserDataFlag interface mocked in the Previewer. How this interface works on the" +
1391        " Previewer may be different from that on a real device.")
1392      const len = args.length
1393      if (typeof args[len - 1] === 'function') {
1394        args[len - 1].call(this, paramMock.businessErrorMock)
1395      } else {
1396        return new Promise((resolve) => {
1397          resolve()
1398        });
1399      }
1400    },
1401    getBundlePackInfo: function (...args) {
1402      console.warn("bundle.getBundlePackInfo interface mocked in the Previewer. How this interface works on the" +
1403        " Previewer may be different from that on a real device.")
1404      const len = args.length
1405      if (typeof args[len - 1] === 'function') {
1406        args[len - 1].call(this, paramMock.businessErrorMock, BundlePackInfoMock)
1407      } else {
1408        return new Promise((resolve) => {
1409          resolve(BundlePackInfoMock)
1410        });
1411      }
1412    },
1413    getAbilityList: function (...args) {
1414      console.warn("bundle.getAbilityList interface mocked in the Previewer. How this interface works on the" +
1415        " Previewer may be different from that on a real device.")
1416      const len = args.length
1417      if (typeof args[len - 1] === 'function') {
1418        args[len - 1].call(this, paramMock.businessErrorMock, LauncherAbilityInfosMock)
1419      } else {
1420        return new Promise((resolve) => {
1421          resolve(LauncherAbilityInfosMock)
1422        });
1423      }
1424    },
1425    getAbilityInfo: function (...args) {
1426      console.warn("bundle.getAbilityInfo interface mocked in the Previewer. How this interface works on the" +
1427        " Previewer may be different from that on a real device.")
1428      const len = args.length
1429      if (typeof args[0] === 'string') {
1430        if (typeof args[len - 1] === 'function') {
1431          args[len - 1].call(this, paramMock.businessErrorMock, AbilityInfoMock)
1432        } else {
1433          return new Promise((resolve) => {
1434            resolve(AbilityInfoMock)
1435          });
1436        }
1437      } else if (typeof args[0] === 'object') {
1438        if (typeof args[len - 1] === 'function') {
1439          args[len - 1].call(this, paramMock.businessErrorMock, LauncherAbilityInfoMock)
1440        } else {
1441          return new Promise((resolve) => {
1442            resolve(LauncherAbilityInfoMock)
1443          });
1444        }
1445      }
1446    },
1447    isBundleEnabled: function (...args) {
1448      console.warn("bundle.isBundleEnabled interface mocked in the Previewer. How this interface works on the" +
1449        " Previewer may be different from that on a real device.")
1450      const len = args.length
1451      if (typeof args[len - 1] === 'function') {
1452        args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramBooleanMock)
1453      } else {
1454        return new Promise((resolve) => {
1455          resolve(paramMock.paramBooleanMock)
1456        });
1457      }
1458    },
1459    getPermissionDef: function (...args) {
1460      console.warn("bundle.getPermissionDef interface mocked in the Previewer. How this interface works on the" +
1461        " Previewer may be different from that on a real device.")
1462      const len = args.length
1463      if (typeof args[len - 1] === 'function') {
1464        args[len - 1].call(this, paramMock.businessErrorMock, PermissionDefMock)
1465      } else {
1466        return new Promise((resolve) => {
1467          resolve(PermissionDefMock)
1468        });
1469      }
1470    },
1471    getPermissionGroupDef: function (...args) {
1472      console.warn("bundle.getPermissionGroupDef interface mocked in the Previewer. How this interface works on the" +
1473        " Previewer may be different from that on a real device.")
1474      const len = args.length
1475      if (typeof args[len - 1] === 'function') {
1476        args[len - 1].call(this, paramMock.businessErrorMock, PermissionDefMock)
1477      } else {
1478        return new Promise((resolve) => {
1479          resolve(PermissionDefMock)
1480        });
1481      }
1482    },
1483    getAllPermissionGroupDefs: function (...args) {
1484      console.warn("bundle.getAllPermissionGroupDefs interface mocked in the Previewer. How this interface works on the" +
1485        " Previewer may be different from that on a real device.")
1486      const len = args.length
1487      if (typeof args[len - 1] === 'function') {
1488        args[len - 1].call(this, paramMock.businessErrorMock, PermissionDefsMock)
1489      } else {
1490        return new Promise((resolve) => {
1491          resolve(PermissionDefsMock)
1492        });
1493      }
1494    },
1495    getPermissionDefByGroup: function (...args) {
1496      console.warn("bundle.getPermissionDefByGroup interface mocked in the Previewer. How this interface works on the" +
1497        " Previewer may be different from that on a real device.")
1498      const len = args.length
1499      if (typeof args[len - 1] === 'function') {
1500        args[len - 1].call(this, paramMock.businessErrorMock, PermissionDefsMock)
1501      } else {
1502        return new Promise((resolve) => {
1503          resolve(PermissionDefsMock)
1504        });
1505      }
1506    },
1507    getModuleUsageRecords: function (...args) {
1508      console.warn("bundle.getModuleUsageRecords interface mocked in the Previewer. How this interface works on the" +
1509        " Previewer may be different from that on a real device.")
1510      const len = args.length
1511      if (typeof args[len - 1] === 'function') {
1512        args[len - 1].call(this,paramMock.businessErrorMock,ModeleUsageRecordsMock)
1513      } else {
1514        return new Promise((resolve) => {
1515          resolve(ModeleUsageRecordsMock)
1516        });
1517      }
1518    },
1519    queryExtensionAbilityInfosByWant: function (...args) {
1520      console.warn("bundle.queryExtensionAbilityInfosByWant interface mocked in the Previewer. How this interface works on the" +
1521        " Previewer may be different from that on a real device.")
1522      const len = args.length
1523      if (typeof args[len - 1] === 'function') {
1524        args[len - 1].call(this,paramMock.businessErrorMock,ExtensionAbilityInfoMock)
1525      } else {
1526        return new Promise((resolve) => {
1527          resolve(ExtensionAbilityInfoMock)
1528        });
1529      }
1530    }
1531  }
1532}
1533