• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2025-2025 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 router from '@ohos.router';
17
18const TAG = 'PrivacyLoadPage';
19
20@Entry
21@Component
22struct PrivacyLoadPage {
23  want: Want = {
24    bundleName: 'com.huawei.hmos.location',
25    abilityName: 'LocationPrivacyDetailAbility',
26    parameters: {
27      'ability.want.params.uiExtensionType': 'sys/commonUI'
28    }
29  }
30
31  build() {
32    Row() {
33      Column() {
34        UIExtensionComponent(this.want)
35          .size({ width: '100%', height: '100%' })
36          .onRemoteReady((proxy) => {})
37          .onReceive((data) => {
38            console.info(TAG, 'on receive ' + data['action']);
39            if (data['action'] === 'exit') {
40              router.clear();
41            }
42          })
43          .onTerminated((data) => {
44            console.info(TAG, 'onTerminated ' + data?.code);
45            if (data?.code === 100) {
46              router.clear();
47            }
48          })
49          .onError((error) => {})
50      }
51      .width('100%')
52    }
53    .height('100%')
54  }
55}