mirror of
https://gitee.com/openharmony/security_privacy_center
synced 2024-11-26 17:31:16 +00:00
版本号及注释规范整改
This commit is contained in:
parent
24d6141b0e
commit
d31c0ec30f
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,3 +1,17 @@
|
||||
/**
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
{
|
||||
"apiType": "stageMode",
|
||||
"buildOption": {
|
||||
|
@ -1,3 +1,18 @@
|
||||
/**
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { hapTasks } from '@ohos/hvigor-ohos-plugin';
|
||||
|
||||
export default {
|
||||
|
@ -1,3 +1,17 @@
|
||||
/**
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
{
|
||||
"license": "",
|
||||
"devDependencies": {},
|
||||
|
@ -1,3 +1,18 @@
|
||||
/**
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import AbilityConstant from '@ohos.app.ability.AbilityConstant';
|
||||
import hilog from '@ohos.hilog';
|
||||
import UIAbility from '@ohos.app.ability.UIAbility';
|
||||
|
@ -1,3 +1,18 @@
|
||||
/**
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@Entry
|
||||
@Component
|
||||
struct Index {
|
||||
|
@ -1,3 +1,18 @@
|
||||
/**
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
{
|
||||
"app": {
|
||||
"signingConfigs": [
|
||||
@ -5,9 +20,9 @@
|
||||
"name": "default",
|
||||
"material": {
|
||||
"certpath": "signature/auto_ohos_default_security_privacy_center_com.ohos.certmanager.cer",
|
||||
"storePassword": "0000001A37024DC31259D322DB3DC82683D3CE6A1D567E83D9804E52C018E93152C260E218E096D39D12",
|
||||
"storePassword": "0000001AF4A5205DCC15B288A620B441F195D5C432826E337CD4E6FB53D6F3941F3ACAB2A58B39F2DD1A",
|
||||
"keyAlias": "openharmony application release",
|
||||
"keyPassword": "0000001A8D895754537EB5A2A9EDA581CAE2388163DF1FEA2486DFFCADD1BE9D3CC359D1279C62ED86A9",
|
||||
"keyPassword": "0000001A2617019B05D0B0A0E1770DD7079AA6849043AAE47F6E178A3E6D4F1C742726DE1992F25EA89D",
|
||||
"profile": "signature/auto_ohos_default_security_privacy_center_com.ohos.certmanager.p7b",
|
||||
"signAlg": "SHA256withECDSA",
|
||||
"storeFile": "signature/auto_ohos_default_security_privacy_center_com.ohos.certmanager.p12"
|
||||
@ -19,13 +34,9 @@
|
||||
"name": "default",
|
||||
"signingConfig": "default",
|
||||
"compileSdkVersion": 10,
|
||||
//指定OpenHarmony应用/服务编译时的版本git
|
||||
"compatibleSdkVersion": 10,
|
||||
//指定OpenHarmony应用/服务兼容的最低版本。
|
||||
"targetSdkVersion": 10,
|
||||
//指定OpenHarmony应用/服务目标版本。若没有设置,默认为compatibleSdkVersion
|
||||
"runtimeOS": "OpenHarmony",
|
||||
//指定为OpenHarmony
|
||||
}
|
||||
],
|
||||
"buildModeSet": [
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,3 +1,18 @@
|
||||
/**
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
{
|
||||
"license": "",
|
||||
"devDependencies": {},
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
@ -21,7 +21,7 @@ import Logger from '../utils/Logger';
|
||||
const TAG = 'BaseViewModel';
|
||||
|
||||
/**
|
||||
* 执行结果
|
||||
* results of enforcement
|
||||
*/
|
||||
export enum ProcessResult {
|
||||
FAIL = 0,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
@ -26,7 +26,7 @@ export default struct TitleBar {
|
||||
onBackClick?: () => void;
|
||||
|
||||
build() {
|
||||
// 分栏模式下首页不显示返回按钮
|
||||
// In column mode, the homepage does not display a return button
|
||||
Column() {
|
||||
Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) {
|
||||
Row() {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
@ -17,6 +17,8 @@ export default class HiSysEventConstant {
|
||||
static BUNDLE_NAME = 'com.ohos.security_privacy_center';
|
||||
static EVENT_DOMAIN = 'PRIVACY_UE';
|
||||
static ACCESS_CLICK_EVENT_NAME = 'SECU_PRIV_ENTRANCE';
|
||||
static MAIN_PERMISSION_LIST_EVENT_NAME = 'MAIN_PERMISSION_LIST'; // 设置-隐私与安全-隐私权限列表打点事件
|
||||
static PERMISSION_PAGE_LOCATION_EVENT_NAME = 'PERMISSION_PAGE_LOCATION'; //设置-隐私与安全-权限-访问我的位置信息开关
|
||||
// Settings - Privacy and Security - Privacy Permission List Management Event
|
||||
static MAIN_PERMISSION_LIST_EVENT_NAME = 'MAIN_PERMISSION_LIST';
|
||||
//Settings Privacy and Security Permissions Access My Location Information Switch
|
||||
static PERMISSION_PAGE_LOCATION_EVENT_NAME = 'PERMISSION_PAGE_LOCATION';
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
@ -14,34 +14,24 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* 路由地址配置
|
||||
* Routing address configuration
|
||||
*/
|
||||
export default class RouterConstant {
|
||||
// 首页
|
||||
// home page
|
||||
static INDEX_URL = 'pages/Index'
|
||||
// 权限管理
|
||||
static PERMISSION_MANAGEMENT_URL = 'pages/PermissionManagementPage'
|
||||
// 权限访问记录
|
||||
static PERMISSION_ACCESS_RECORD_URL = 'pages/PermissionAccessRecordPage'
|
||||
// 应用权限访问记录
|
||||
static PERMISSION_CONTROL_AND_RECORD_URL = 'pages/PermissionControlAndRecordPage'
|
||||
// 外部模块条换路径对应表
|
||||
static OUTSIDE_ROUTE_PAGE_MAP = new Map([
|
||||
['location_manager_settings', 'pages/PermissionManagementPage']
|
||||
])
|
||||
}
|
||||
|
||||
/**
|
||||
* 页面进入方式,需和设置保持一致
|
||||
* 当设置传入backMode为1时,点返回跳转到拉起页面
|
||||
* The page entry method needs to be consistent with the settings
|
||||
* When setting the incoming backMode to 1, click return to jump to the pull-up page
|
||||
*/
|
||||
export enum PageRouteMode {
|
||||
/**
|
||||
* 内部跳转
|
||||
* Internal jump
|
||||
*/
|
||||
INSIDE,
|
||||
/**
|
||||
* 外部跳转
|
||||
* External jump
|
||||
*/
|
||||
OUTSIDE
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
@ -34,7 +34,7 @@ const DST_ABILITY_MODE = 1;
|
||||
//UIAbility access method
|
||||
const DST_UIABILITY_MODE = 0;
|
||||
|
||||
//数据库唯一标识符
|
||||
//Database unique identifier
|
||||
const DISPLAY_ONLY_PRIMARY_USER = 'ONLY_PRIMARY_USER';
|
||||
const DISPLAY_ONLY_SUB_USER = 'ONLY_SUB_USER';
|
||||
const MAIN_USER_ID = 100;
|
||||
@ -46,7 +46,7 @@ const DISPLAY_MODEL_CARD = 'card';
|
||||
const DISPLAY_MODEL_LIST = 'list';
|
||||
|
||||
export class AutoMenuManager {
|
||||
// 默认的配置信息,key is bundle name, value is config
|
||||
// Default configuration information,key is bundle name, value is config
|
||||
private _defaultMenuConfigMap: HashMap<string, DefaultMenuConfig> = new HashMap();
|
||||
// key is bundle name, value is id.
|
||||
private _defaultBusinessIdMap: HashMap<string, string> = new HashMap();
|
||||
@ -72,9 +72,9 @@ export class AutoMenuManager {
|
||||
* @returns The all menu config
|
||||
*/
|
||||
async getMenuConfigFromBms(context: Context, userId: number): Promise<MenuConfig[]> {
|
||||
// 获取所有配置信息,内部会检查权限
|
||||
// Obtain all configuration information and internally check permissions
|
||||
let allPkgConfigList: MenuConfig[] = await this._readConfigFromBms(context);
|
||||
// 适配businessId
|
||||
// Adapt to businessId
|
||||
for (let index = 0; index < allPkgConfigList.length; index++) {
|
||||
const item = allPkgConfigList[index];
|
||||
if (item.businessId === null || item.businessId === undefined || item.businessId.length === 0) {
|
||||
@ -82,7 +82,7 @@ export class AutoMenuManager {
|
||||
}
|
||||
}
|
||||
Logger.info(TAG, 'getMenuConfigFromBms allPkgConfigList: ' + JSON.stringify(allPkgConfigList));
|
||||
// 过滤不合法的配置信息
|
||||
// Filter illegal configuration information
|
||||
let verifiedPkgConfigList: MenuConfig[] = [];
|
||||
for (let index = 0; index < allPkgConfigList.length; index++) {
|
||||
const menuConfig = allPkgConfigList[index];
|
||||
@ -167,7 +167,7 @@ export class AutoMenuManager {
|
||||
}
|
||||
}
|
||||
|
||||
// 查询有功能接入的Ability信息
|
||||
// Query Ability information with functional access
|
||||
private async _readConfigFromBms(context: Context): Promise<MenuConfig[]> {
|
||||
let abilityInfoList: bundleManager.ExtensionAbilityInfo[] = [];
|
||||
let uiAbilityInfoList: bundleManager.AbilityInfo[] = [];
|
||||
@ -176,7 +176,7 @@ export class AutoMenuManager {
|
||||
} catch (err) {
|
||||
Logger.error(TAG, 'queryExtensionAbilityInfoOther error.')
|
||||
}
|
||||
// 查询通过uiAbility方式接入的信息
|
||||
// Query information accessed through uiAbility
|
||||
try {
|
||||
uiAbilityInfoList = await BundleInfoModel.queryAbilityInfoOther()
|
||||
} catch (err) {
|
||||
@ -185,7 +185,7 @@ export class AutoMenuManager {
|
||||
if (abilityInfoList.length === 0 && uiAbilityInfoList.length === 0) {
|
||||
return [];
|
||||
}
|
||||
// 检查功能接入的Ability权限
|
||||
// Check the Ability permissions for feature access
|
||||
let atManage: abilityAccessCtrl.AtManager = abilityAccessCtrl.createAtManager();
|
||||
let pkgConfigList: MenuConfig[] = [];
|
||||
for (let index = 0; index < abilityInfoList.length; index++) {
|
||||
@ -202,7 +202,7 @@ export class AutoMenuManager {
|
||||
Logger.info(TAG, 'checkAccessToken error: ' + abilityInfo.bundleName);
|
||||
}
|
||||
}
|
||||
// 检查功能通过uiAbility方式接入的Ability权限
|
||||
// Check the Ability permissions of the function accessed through uiAbility method
|
||||
for (let index = 0; index < uiAbilityInfoList.length; index++) {
|
||||
const uiAbilityInfo = uiAbilityInfoList[index];
|
||||
try {
|
||||
@ -220,10 +220,10 @@ export class AutoMenuManager {
|
||||
return pkgConfigList;
|
||||
}
|
||||
|
||||
// 读取接入方式配置信息转换为对应的数据类
|
||||
// Read access method configuration information and convert it to the corresponding data class
|
||||
private async _readConfigFromSingleAbilityInfo(context: Context,
|
||||
abilityInfo: bundleManager.ExtensionAbilityInfo | bundleManager.AbilityInfo): Promise<MenuConfig[]> {
|
||||
// 获取metaData数据
|
||||
// Get MetaData data
|
||||
let singleAbilityMenuConfigList: MenuConfig[] = [];
|
||||
for (let index = 0; index < abilityInfo.metadata.length; index++) {
|
||||
const metaData = abilityInfo.metadata[index];
|
||||
@ -232,7 +232,7 @@ export class AutoMenuManager {
|
||||
}
|
||||
let bundleName = abilityInfo.bundleName;
|
||||
let fileName = metaData.value;
|
||||
// 根据metaData获取json文件
|
||||
// Retrieve JSON files based on metaData
|
||||
let content: string = await this._getFileByMetaData(context, bundleName, fileName);
|
||||
if (StringUtil.isEmpty(content)) {
|
||||
continue;
|
||||
@ -245,14 +245,14 @@ export class AutoMenuManager {
|
||||
return singleAbilityMenuConfigList;
|
||||
}
|
||||
|
||||
// 根据包名查询metaData的json数据
|
||||
// Query the JSON data of metaData based on the package name
|
||||
private async _getFileByMetaData(context: Context, bundleName: string, fileName: string): Promise<string> {
|
||||
let resourceManager = resourceUtil.getBundleResourceManager(bundleName, context) as resourceManager.ResourceManager;
|
||||
return await RawFileUtil.getStringByFile(resourceManager, fileName);
|
||||
}
|
||||
|
||||
private async _verifyMenuConfig(context: Context, menuConfig: MenuConfig, userId: number): Promise<boolean> {
|
||||
// 根据卡片或列表模式进行分类验证,目前暂只支持列表方式
|
||||
// Classification verification based on card or list mode, currently only list mode is supported
|
||||
try {
|
||||
if (menuConfig.displayedMode === DISPLAY_MODEL_CARD
|
||||
|| menuConfig.displayedMode === DISPLAY_MODEL_LIST) {
|
||||
@ -264,7 +264,7 @@ export class AutoMenuManager {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 校验showControlAbilityUri
|
||||
// Verify showControlAbilityUri
|
||||
private async _verificationUri(context: Context, uri: string): Promise<string> {
|
||||
try {
|
||||
let data: dataShare.DataShareHelper = await dataShare.createDataShareHelper(context, uri, { isProxy: false });
|
||||
@ -309,7 +309,7 @@ export class AutoMenuManager {
|
||||
if (!_isValidResourceWithList) {
|
||||
return false;
|
||||
}
|
||||
// 校验主子用户配置,可选字段
|
||||
// Verify the configuration of primary and secondary users, optional fields
|
||||
if (menuConfig.displayUserConfig !== undefined) {
|
||||
let displayUserConfigRes = this._verificationPrimaryUser(menuConfig.displayUserConfig, userId);
|
||||
Logger.info(TAG, `displayUserConfigRes value is: ${displayUserConfigRes}`);
|
||||
@ -317,7 +317,7 @@ export class AutoMenuManager {
|
||||
return displayUserConfigRes;
|
||||
}
|
||||
}
|
||||
// 校验uri,可选字段
|
||||
// Verify uri, optional fields
|
||||
let showControlAbilityUri = menuConfig.showControlAbilityUri;
|
||||
if (showControlAbilityUri !== undefined) {
|
||||
let _verificationUriResult: string = await this._verificationUri(context, showControlAbilityUri);
|
||||
@ -341,13 +341,13 @@ export class AutoMenuManager {
|
||||
if (StringUtil.isEmpty(menuConfig.mainTitleResource)) {
|
||||
return false;
|
||||
}
|
||||
// 标题
|
||||
// title
|
||||
let titleResList = menuConfig.mainTitleResource.split(':');
|
||||
if (titleResList.length < 2) {
|
||||
Logger.error(TAG, 'titleResList length is error.')
|
||||
return false;
|
||||
}
|
||||
// 校验title
|
||||
// Verify title
|
||||
let value: string = await resourceManager?.getStringByName(titleResList[1]);
|
||||
if (value === '') {
|
||||
Logger.error(TAG, 'titlePromise is error.')
|
||||
@ -361,7 +361,7 @@ export class AutoMenuManager {
|
||||
return dstAbilityMode !== DST_ABILITY_MODE && dstAbilityMode !== DST_UIABILITY_MODE
|
||||
}
|
||||
|
||||
// 校验子用户
|
||||
// Verify sub users
|
||||
private _verificationPrimaryUser(displayUserConfig: string, userId: number): boolean {
|
||||
let isPrimaryUser: boolean = userId === MAIN_USER_ID;
|
||||
Logger.info(TAG, `verificationSubUser, displayUser: ${displayUserConfig}, isPrimaryUser: ${isPrimaryUser}`);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
@ -15,7 +15,6 @@
|
||||
|
||||
import hiSysEvent from '@ohos.hiSysEvent';
|
||||
import { BusinessError } from '@ohos.base';
|
||||
import { StringUtil } from './StringUtil';
|
||||
import Logger from './Logger';
|
||||
import HiSysEventConstant from '../constants/HiSysEventConstant';
|
||||
import GetSelfBundleInfoUtils from './GetSelfBundleInfoUtils';
|
||||
@ -27,9 +26,9 @@ export default class HiSysEventUtil {
|
||||
}
|
||||
|
||||
/**
|
||||
* 接入框架接入应用点击事件打点
|
||||
* Access framework access application click event management
|
||||
*
|
||||
* @params { clickedBundleName } 所点击的应用包名
|
||||
* @params { clickedBundleName } Click on the application package name
|
||||
*/
|
||||
static async reportAccessClick(clickedBundleName: string): Promise<void> {
|
||||
Logger.info(TAG,"reportAccessClick start.")
|
||||
@ -43,7 +42,8 @@ export default class HiSysEventUtil {
|
||||
}
|
||||
|
||||
/**
|
||||
* 访问我的位置信息点击打点事件
|
||||
* Access my location information and click on the management event
|
||||
* @params { operation } LOCATION
|
||||
*/
|
||||
static async reportLocationClick(operation: string): Promise<void> {
|
||||
Logger.info(TAG,"reportLocationClick start.")
|
||||
@ -57,7 +57,8 @@ export default class HiSysEventUtil {
|
||||
}
|
||||
|
||||
/**
|
||||
* 访问我的位置信息开关点击打点事件
|
||||
* Access My Location Information Switch Click on Dotting Event
|
||||
* @params { checkedState } Position information switch status; 1: On 0: Off
|
||||
*/
|
||||
static async reportLocationFlagClick(checkedState: number) {
|
||||
let versionName: string = await GetSelfBundleInfoUtils.getVersionName();
|
||||
@ -70,10 +71,10 @@ export default class HiSysEventUtil {
|
||||
}
|
||||
|
||||
/**
|
||||
* 界面点击操作打点
|
||||
* Click on the interface to operate the dots
|
||||
*
|
||||
* @param eventName 事件名
|
||||
* @param params 参数
|
||||
* @param eventName Event Name
|
||||
* @param params parameter
|
||||
*/
|
||||
static async reportClick(eventName: string, params: Record<string, string | number>): Promise<void> {
|
||||
let versionName: string = await GetSelfBundleInfoUtils.getVersionName();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
@ -15,7 +15,7 @@
|
||||
import hilog from '@ohos.hilog';
|
||||
|
||||
/**
|
||||
* 日志打印工具类
|
||||
* Log printing tool class
|
||||
*/
|
||||
class Logger {
|
||||
private domain: number;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
@ -21,15 +21,15 @@ const TAG: string = 'RawFileUtil';
|
||||
const UNICODE: string = 'utf-8';
|
||||
|
||||
/**
|
||||
* RawFile工具类
|
||||
* RawFile utility class
|
||||
*/
|
||||
export class RawFileUtil {
|
||||
/**
|
||||
* 获取指定的JSON文件的对象
|
||||
* Get the object of the specified JSON file
|
||||
*
|
||||
* @param resourceManager 资源管理器
|
||||
* @param fileName 文件名
|
||||
* @returns string格式的文件内容
|
||||
* @param resourceManager Resource Manager
|
||||
* @param fileName file name
|
||||
* @returns The file content in string format
|
||||
*/
|
||||
public static async getStringByFile(resourceManager: resmgr.ResourceManager, fileName: string): Promise<string> {
|
||||
Logger.info(TAG, `getFileContent. fileName: ${fileName}`);
|
||||
@ -48,11 +48,11 @@ export class RawFileUtil {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定的JSON文件的对象
|
||||
* Get the object of the specified JSON file
|
||||
*
|
||||
* @param context 上下文
|
||||
* @param fileName 文件名
|
||||
* @return string格式的文件内容
|
||||
* @param context context
|
||||
* @param fileName file name
|
||||
* @return The file content in string format
|
||||
*/
|
||||
public static async getRawFileByContext(context: Context, fileName: string): Promise<string> {
|
||||
Logger.info(TAG, `getFileContent. fileName: ${fileName}`);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
@ -23,7 +23,6 @@ const TAG = 'ResourceUtil'
|
||||
class ResourceUtil {
|
||||
/**
|
||||
* Obtains the resource name
|
||||
* 获取资源文件
|
||||
* @param resource Resource file
|
||||
* @returns Resource File Name
|
||||
*/
|
||||
@ -43,9 +42,9 @@ class ResourceUtil {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定包名资源管理器
|
||||
* @params bundleName 应用包名
|
||||
* @params context 上下文
|
||||
* Get the specified package name resource manager
|
||||
* @params bundleName Application package name
|
||||
* @params context context
|
||||
*/
|
||||
|
||||
getBundleResourceManager(bundleName: string, context: common.Context | null): resourceManager.ResourceManager | null {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
@ -14,20 +14,20 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* 字符串工具类
|
||||
* String Tool Class
|
||||
*/
|
||||
export class StringUtil {
|
||||
/**
|
||||
* 判断字符是否是空字符串
|
||||
* @Param stringValue 字符串
|
||||
* Determine whether a character is an empty string
|
||||
* @Param stringValue character string
|
||||
*/
|
||||
public static isEmpty(stringValue: string | null | undefined): boolean {
|
||||
return stringValue === undefined || stringValue === null || stringValue.length === 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断字符转是否是非空字符串
|
||||
* @params stringValue 字符串
|
||||
* Determine whether character conversion is a non empty string
|
||||
* @params stringValue character string
|
||||
*/
|
||||
public static isNotEmpty(stringValue: string | null | undefined): boolean {
|
||||
return stringValue !== undefined && stringValue !== null && stringValue.length !== 0;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
@ -30,7 +30,7 @@ import Logger from '../../common/utils/Logger';
|
||||
import common from '@ohos.app.ability.common';
|
||||
|
||||
const TAG = 'AutoMenu';
|
||||
// 该ability模式需继承自UIExtensionAbility
|
||||
// This ability pattern needs to inherit from UIExtensionAbility
|
||||
const DST_ABILITY_MODE = 1;
|
||||
// this mode is jump page
|
||||
const DST_PAGE_MODE = 2;
|
||||
@ -86,13 +86,13 @@ export class AutoMenuModel extends BaseModel {
|
||||
|
||||
async getMenuInfoListFromBms(context: Context): Promise<MenuInfo[]> {
|
||||
let userId: number = await this._getUserId();
|
||||
// 步骤一,获取配置数据
|
||||
// Obtain configuration data
|
||||
let menuConfigs: MenuConfig[] = await AutoMenuManager.getInstance().getMenuConfigFromBms(context, userId);
|
||||
Logger.info(TAG, 'getMenuInfoList menuConfigList: ' + JSON.stringify(menuConfigs));
|
||||
// 步骤二,转换为实际需要展示的数据
|
||||
// Convert to actual data that needs to be displayed
|
||||
let menuInfoList: MenuInfo[] = await this._convertMenuConfigToMenuInfo(context, menuConfigs, userId);
|
||||
Logger.info(TAG, 'getMenuInfoList menuInfoList: ' + JSON.stringify(menuInfoList));
|
||||
// 步骤三,排序
|
||||
// sort
|
||||
menuInfoList.sort((left: MenuInfo, right: MenuInfo) => {
|
||||
if (left.priority !== right.priority) {
|
||||
return right.priority - left.priority;
|
||||
@ -100,13 +100,13 @@ export class AutoMenuModel extends BaseModel {
|
||||
return left.bundleName.localeCompare(right.bundleName);
|
||||
}
|
||||
})
|
||||
// 步骤四,写入数据库缓存
|
||||
// Write to database cache
|
||||
this._refreshDb(context, menuInfoList);
|
||||
return menuInfoList;
|
||||
}
|
||||
|
||||
handleMenuClick(menuInfo: MenuInfo) {
|
||||
// 通过UIAbility方式接入框架
|
||||
// Accessing the framework through UIAbility
|
||||
if (menuInfo.dstAbilityMode === DST_UIABILITY_MODE) {
|
||||
let context = getContext() as common.UIAbilityContext;
|
||||
context.startAbility({
|
||||
@ -128,7 +128,7 @@ export class AutoMenuModel extends BaseModel {
|
||||
Logger.error(TAG, `Failed to jump to the second page.Code is ${err.code},message is ${err.message}`);
|
||||
})
|
||||
}
|
||||
// 跳转UIExtensionAbility
|
||||
// Jump UIExtensionAbility
|
||||
HiSysEventUtil.reportAccessClick(menuInfo.dstBundleName)
|
||||
if (menuInfo.dstAbilityMode === DST_ABILITY_MODE) {
|
||||
router.pushUrl({
|
||||
@ -194,7 +194,7 @@ export class AutoMenuModel extends BaseModel {
|
||||
return userId;
|
||||
}
|
||||
|
||||
// 获取配置的标题字符串资源
|
||||
// Get the configured title string resource
|
||||
private async _getConfigResString(context: Context, bundleName: string, res: string): Promise<string> {
|
||||
if (res === null || res === undefined) {
|
||||
return '';
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
@ -18,8 +18,8 @@ import MenuInfo from '../../common/bean/MenuInfo';
|
||||
|
||||
@Observed
|
||||
export class AutoMenuViewState extends BaseState {
|
||||
// 功能接入,列表数据
|
||||
// list data
|
||||
public listMenuList: MenuInfo[] = [];
|
||||
// 功能接入,卡片数据
|
||||
// card data
|
||||
public cardMenuList: MenuInfo[] = [];
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
@ -123,7 +123,7 @@ class BundleInfoModel {
|
||||
return result;
|
||||
}
|
||||
|
||||
// 获取所有应用信息关于功能接入
|
||||
// Get all application information about feature access
|
||||
getAllBundleInfoByFunctionAccess() {
|
||||
let modelFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_METADATA |
|
||||
bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION |
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
@ -59,7 +59,7 @@ struct Index {
|
||||
this.getBundleInfo();
|
||||
}
|
||||
|
||||
// 获取所有包信息
|
||||
// Get all package information
|
||||
getBundleInfo() {
|
||||
BundleInfoModel.getAllBundleInfoByFunctionAccess()
|
||||
.then(async (data: bundleManager.BundleInfo[]) => {
|
||||
@ -89,14 +89,14 @@ struct Index {
|
||||
|
||||
Scroll(this.scroller) {
|
||||
Column() {
|
||||
// 组件1 功能接入‘列表’
|
||||
// Function access' list 'component
|
||||
PrivacyProtectionListView({
|
||||
menuViewState: autoMenuViewModel.getViewState(),
|
||||
itemClickEvent: ((menuInfo: MenuInfo) => {
|
||||
autoMenuViewModel.processIntent(new AutoMenuClickIntent(menuInfo));
|
||||
})
|
||||
})
|
||||
// 组件2 位置信息
|
||||
// Location information component
|
||||
Row() {
|
||||
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
|
||||
Text($r('app.string.locationServicesTab'))
|
||||
@ -137,7 +137,7 @@ struct Index {
|
||||
.hoverEffect(HoverEffect.Highlight)
|
||||
.borderRadius(ResourceUtil.getFloatNumber($r('sys.float.ohos_id_corner_radius_default_l')) - 4)
|
||||
.onClick(async () => {
|
||||
// 定位服务打点
|
||||
// Positioning service management
|
||||
HiSysEventUtil.reportLocationClick('LOCATION')
|
||||
|
||||
router.pushUrl({
|
||||
@ -156,7 +156,7 @@ struct Index {
|
||||
}
|
||||
}
|
||||
.height(Constants.WIDTH_HEIGHT_FULL_SCREEN)
|
||||
.scrollable(ScrollDirection.Vertical) //滚动方向纵向
|
||||
.scrollable(ScrollDirection.Vertical)
|
||||
.edgeEffect(EdgeEffect.Spring)
|
||||
.margin({
|
||||
bottom: $r('app.float.index_margin_bottom')
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
@ -17,7 +17,6 @@ import ViewModel from '../model/locationServicesImpl/LocationViewModel';
|
||||
import Logger from '../common/utils/Logger';
|
||||
import HeadComponent from '../common/components/headComponent';
|
||||
import HiSysEventUtil from '../common/utils/HiSysEventUtil';
|
||||
import HiSysEventConstant from '../common/constants/HiSysEventConstant';
|
||||
|
||||
const TAG: string = 'LocationServicesPage'
|
||||
|
||||
@ -31,11 +30,16 @@ struct LocationServices {
|
||||
|
||||
build() {
|
||||
Column() {
|
||||
GridContainer({ gutter: 24, margin: 24}) {
|
||||
GridRow({ columns: { sm: 4, md: 6, lg: 8 }, gutter: 12 }) {
|
||||
GridCol({ span: { sm: 4, md: 6, lg: 8 }, offset: { sm: 0, md: 1, lg: 2 } }) {
|
||||
Column() {
|
||||
HeadComponent({ headName: $r('app.string.locationServicesTab'), isActive: true });
|
||||
|
||||
Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
|
||||
Flex({
|
||||
direction: FlexDirection.Row,
|
||||
justifyContent: FlexAlign.SpaceBetween,
|
||||
alignItems: ItemAlign.Center
|
||||
}) {
|
||||
Text($r('app.string.positionInformation'))
|
||||
.fontColor($r("app.color.font_color_182431"))
|
||||
.fontStyle(FontStyle.Normal)
|
||||
@ -52,10 +56,8 @@ struct LocationServices {
|
||||
if (isOn) {
|
||||
ViewModel.enableLocation();
|
||||
HiSysEventUtil.reportLocationFlagClick(1)
|
||||
|
||||
} else {
|
||||
ViewModel.disableLocation();
|
||||
|
||||
HiSysEventUtil.reportLocationFlagClick(0)
|
||||
}
|
||||
});
|
||||
@ -65,14 +67,9 @@ struct LocationServices {
|
||||
.backgroundColor($r("app.color.white_bg_color"))
|
||||
.borderRadius($r("sys.float.ohos_id_corner_radius_default_l"))
|
||||
}
|
||||
.useSizeType({
|
||||
sm: { span: 4, offset: 0 },
|
||||
md: { span: 6, offset: 1 },
|
||||
lg: { span: 8, offset: 2 }
|
||||
})
|
||||
}
|
||||
.width('100%')
|
||||
.height('100%')
|
||||
}
|
||||
.margin({ left: $r('app.float.grid_row_margin'), right: $r('app.float.grid_row_margin') })
|
||||
}
|
||||
.backgroundColor($r("sys.color.ohos_id_color_sub_background"))
|
||||
.width('100%')
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
@ -20,14 +20,13 @@ import MenuInfo from '../../common/bean/MenuInfo';
|
||||
|
||||
@Component
|
||||
export default struct PrivacyProtectionListView {
|
||||
// 功能接入卡片的数据
|
||||
// Function access list data
|
||||
@Prop menuViewState: AutoMenuViewState;
|
||||
private itemClickEvent = (menuInfo: MenuInfo) => {
|
||||
};
|
||||
|
||||
build() {
|
||||
Column() {
|
||||
//循环遍历渲染
|
||||
List({ space: Constants.DEFAULT_SPACE }) {
|
||||
ForEach(this.menuViewState.listMenuList, (item: MenuInfo) => {
|
||||
ListItem() {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,30 +0,0 @@
|
||||
[
|
||||
{
|
||||
"primaryKey": "lock_screen_password",
|
||||
"bundleName": "com.huawei.hmos.settings",
|
||||
"category": "lock_screen_password",
|
||||
"uxConfig": {
|
||||
"titleRes": "app.string.category_title_lock_screen_password",
|
||||
"contentRes": "app.string.category_desc_lock_screen_password",
|
||||
"iconRes": "app.media.ic_lock_password",
|
||||
"actionButtonRes": "app.string.button_go",
|
||||
"ignoreButtonRes": "app.string.button_ignore"
|
||||
},
|
||||
"urlConfig": {
|
||||
"bundleName": "com.huawei.hmos.settings",
|
||||
"abilityName": "com.huawei.hmos.settings.MainAbility",
|
||||
"uri": "lock_screen_password_title",
|
||||
"parameters": {
|
||||
"pushParams": {
|
||||
"action": "open_create_password_dialog"
|
||||
}
|
||||
}
|
||||
},
|
||||
"otherConfig": {
|
||||
"ignoreTimesKey": "ignoreLockScreenTimes",
|
||||
"ignoreTimestampKey": "ignoreLockScreenSetTimes",
|
||||
"priority": 300,
|
||||
"riskLevel": "HIGH"
|
||||
}
|
||||
}
|
||||
]
|
@ -1,47 +0,0 @@
|
||||
[
|
||||
{
|
||||
"titleNameId": "privacy_protect_proposition",
|
||||
"listType": "1",
|
||||
"jumperType": "uri",
|
||||
"uriResId": "privacy_protect_proposition_uri",
|
||||
"bundleName": "",
|
||||
"abilityName": "",
|
||||
"ueParam": "1"
|
||||
},
|
||||
{
|
||||
"titleNameId": "consumer_business_privacy_statement",
|
||||
"listType": "1",
|
||||
"jumperType": "uri",
|
||||
"uriResId": "consumer_business_privacy_statement_uri",
|
||||
"bundleName": "",
|
||||
"abilityName": "",
|
||||
"ueParam": "2"
|
||||
},
|
||||
{
|
||||
"titleNameId": "cookies_policy",
|
||||
"listType": "1",
|
||||
"jumperType": "uri",
|
||||
"uriResId": "cookies_policy_uri",
|
||||
"bundleName": "",
|
||||
"abilityName": "",
|
||||
"ueParam": "3"
|
||||
},
|
||||
{
|
||||
"titleNameId": "privacy_and_security_certification",
|
||||
"listType": "1",
|
||||
"jumperType": "uri",
|
||||
"uriResId": "privacy_and_security_certification_uri",
|
||||
"bundleName": "",
|
||||
"abilityName": "",
|
||||
"ueParam": "4"
|
||||
},
|
||||
{
|
||||
"titleNameId": "more_privacy_protection_information",
|
||||
"listType": "1",
|
||||
"jumperType": "uri",
|
||||
"uriResId": "more_privacy_protection_information_uri",
|
||||
"bundleName": "",
|
||||
"abilityName": "",
|
||||
"ueParam": "5"
|
||||
}
|
||||
]
|
@ -1,23 +0,0 @@
|
||||
[
|
||||
{
|
||||
"businessId": "lock_screen_password",
|
||||
"bundleName": "com.huawei.hmos.passwordvault",
|
||||
"priority": 9999
|
||||
},
|
||||
{
|
||||
"businessId": "high_safe_mode",
|
||||
"bundleName": "com.huawei.hmos.advsecmode",
|
||||
"priority": 8888
|
||||
},
|
||||
{
|
||||
"businessId": "data_and_privacy",
|
||||
"bundleName": "com.huawei.hmos.security.privacycenter",
|
||||
"priority": 7777
|
||||
},
|
||||
{
|
||||
"businessId": "hw_ads_service",
|
||||
"bundleName": "com.huawei.hmos.adsservice",
|
||||
"priority": 6666
|
||||
}
|
||||
|
||||
]
|
@ -1,21 +0,0 @@
|
||||
{
|
||||
"cardRuleList": [
|
||||
{
|
||||
"dstBundleName": "com.example.extensionabilitycard"
|
||||
}
|
||||
],
|
||||
"listRuleList": [
|
||||
{
|
||||
"dstBundleName": "com.huawei.hmos.passwordvault"
|
||||
},
|
||||
{
|
||||
"dstBundleName": "com.huawei.hmos.advsecmode"
|
||||
},
|
||||
{
|
||||
"dstBundleName": "com.huawei.hmos.security.privacycenter"
|
||||
},
|
||||
{
|
||||
"dstBundleName": "com.huawei.hmos.adsservice"
|
||||
}
|
||||
]
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
{
|
||||
"searchPages": [
|
||||
{
|
||||
"pageTitle": "string:privacy_ability_label",
|
||||
"pageDescription": "Privacy and security",
|
||||
"entryKey": "privacy_settings",
|
||||
"params": "",
|
||||
"searchItems": [
|
||||
{
|
||||
"itemName": "Privacy and security",
|
||||
"itemTitle": "$string:privacy_ability_label",
|
||||
"itemDescription": "",
|
||||
"icon": ""
|
||||
},
|
||||
{
|
||||
"itemName": "Permission Management",
|
||||
"itemTitle": "$string:search_item_permission_management",
|
||||
"itemDescription": "",
|
||||
"icon": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
@ -51,16 +51,14 @@ export default function BundleInfoBeanTest() {
|
||||
getSelfBundleInfoUtils.getVersionName()
|
||||
})
|
||||
it('HiSysEventUtilTest', 0, () => {
|
||||
HiSysEventUtil.reportAppPermJumpMorePerm('com.example.test', '1.0.0');
|
||||
HiSysEventUtil.reportAppPermissionJumpPage('com.example.test', '1.0.0', 'ohos.permission.Location');
|
||||
HiSysEventUtil.reportUpdateAppPermissionGroupState('com.example.test', '1.0.0', 'ohos.permission.Location', 'ALLOW', 1, 1)
|
||||
HiSysEventUtil.reportAccessClick('com.example.test');
|
||||
HiSysEventUtil.reportDataPrivacyClick('test');
|
||||
|
||||
HiSysEventUtil.reportLocationClick('LOCATION');
|
||||
HiSysEventUtil.reportLocationFlagClick(1);
|
||||
HiSysEventUtil.reportLocationFlagClick(0);
|
||||
let eventParams: Record<string, string> = {
|
||||
"PERMISSION_GROUP": 'ohos.permission.Location'
|
||||
}
|
||||
HiSysEventUtil.reportClick(HiSysEventConstant.PERMISSION_PAGE_SEARCH_EVENT_NAME, eventParams)
|
||||
HiSysEventUtil.reportClick(HiSysEventConstant.PERMISSION_PAGE_LOCATION_EVENT_NAME, eventParams)
|
||||
|
||||
})
|
||||
it('RawfileUtilTest', 0, () => {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
@ -13,16 +13,16 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
//检查的状态参数。用于设置应用权限组检查状态
|
||||
// 这是应用权限组的状态部分,仅包含选中的状态和权限组标志
|
||||
// Check the status parameters. Used to set application permission group check status
|
||||
// This is the status section of the application permission group, which only includes the selected status and permission group flag
|
||||
export class CheckedStateParameter {
|
||||
// 权限组检查状态
|
||||
// 有效的权限状态:ALLOW,ALLOW_ALL_THE_TIME,ALLOW_ONLY_WHILE_IN_USE,ASK_EACH_TIME,DENY,
|
||||
// Permission group check status
|
||||
// Valid permission status:ALLOW,ALLOW_ALL_THE_TIME,ALLOW_ONLY_WHILE_IN_USE,ASK_EACH_TIME,DENY,
|
||||
// MEDIA_ONLY,ALLOW_MANAGEMENT_OF_ALL_FILES
|
||||
checkedState: string;
|
||||
// 附加标志
|
||||
// Additional signs
|
||||
flagMask: number;
|
||||
// 附加标志
|
||||
// Additional signs
|
||||
flagValue: number;
|
||||
|
||||
constructor(checkedState: string, flagMask: number, flagValue: number) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
@ -19,15 +19,12 @@
|
||||
"@ohos/hvigor-ohos-plugin": "3.0.9"
|
||||
},
|
||||
"execution": {
|
||||
// "daemon": true, /* Enable daemon compilation. Default: true */
|
||||
// "incremental": true, /* Enable incremental compilation. Default: true */
|
||||
// "parallel": true, /* Enable parallel compilation. Default: true */
|
||||
// "typeCheck": false, /* Enable typeCheck. Default: false */
|
||||
|
||||
},
|
||||
"logging": {
|
||||
// "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */
|
||||
|
||||
},
|
||||
"debugging": {
|
||||
// "stacktrace": false /* Disable stacktrace compilation. Default: false */
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
2
hvigorw
2
hvigorw
@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
# Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
@ -12,6 +12,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
{
|
||||
"lockfileVersion": 1,
|
||||
"ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
|
||||
|
@ -1,3 +1,18 @@
|
||||
/**
|
||||
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
{
|
||||
"license": "",
|
||||
"devDependencies": {
|
||||
|
Loading…
Reference in New Issue
Block a user