support launch screenlock by SystemUI

Signed-off-by: yangpeng85 <yangpeng85@huawei.com>
This commit is contained in:
yangpeng85 2022-08-05 15:19:38 +08:00
parent 409058131b
commit d1642b0e43
41 changed files with 80 additions and 74 deletions

3
.gitignore vendored
View File

@ -2,4 +2,5 @@
/local.properties /local.properties
/.idea /.idea
**/build **/build
/features/**/build /features/**/build
/.hvigor

View File

@ -1,15 +1,15 @@
{ {
"app": { "app": {
"bundleName": "com.ohos.screenlock", "bundleName": "com.ohos.systemui",
"vendor": "example", "vendor": "ohos",
"versionCode": 1000000, "versionCode": 1000000,
"versionName": "1.0.0", "versionName": "1.0.0",
"icon": "$media:app_icon", "icon": "$media:app_icon",
"label": "$string:app_name", "label": "$string:app_name",
"distributedNotificationEnabled": true, "distributedNotificationEnabled": true,
"singleton": true, "singleton": true,
"keepAlive":true, "keepAlive": true,
"minAPIVersion": 9, "minAPIVersion": 8,
"targetAPIVersion": 9 "targetAPIVersion": 9
} }
} }

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/* /*
* Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/** /**
* Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
@ -30,7 +31,7 @@ export type TimeEventArgs = {
timeFormat: boolean; timeFormat: boolean;
}; };
const TAG = "TimeManager"; const TAG = "TimeManagerSc";
const URI_VAR = "dataability:///com.ohos.settingsdata.DataAbility"; const URI_VAR = "dataability:///com.ohos.settingsdata.DataAbility";
const TIME_FORMAT_KEY = settings.date.TIME_FORMAT; const TIME_FORMAT_KEY = settings.date.TIME_FORMAT;
const TIME_SUBSCRIBE_INFO = { const TIME_SUBSCRIBE_INFO = {

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/* /*
* Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
@ -38,7 +39,7 @@ export const WINDOW_SHOW_HIDE_EVENT = "WindowShowHideEvent";
export const WINDOW_RESIZE_EVENT = "WindowResizeEvent"; export const WINDOW_RESIZE_EVENT = "WindowResizeEvent";
type WindowHandle = typeof Window.Window; type WindowHandle = typeof Window.Window;
const TAG = "WindowManager"; const TAG = "WindowManagerSc";
const SYSTEM_WINDOW_TYPE_MAP: { [key in WindowType]: number } = { const SYSTEM_WINDOW_TYPE_MAP: { [key in WindowType]: number } = {
SystemUi_StatusBar: 2108, SystemUi_StatusBar: 2108,
SystemUi_NavigationBar: 2112, SystemUi_NavigationBar: 2112,

View File

@ -22,7 +22,7 @@ import { Callback, createEventBus, EventBus } from "./EventBus";
export type unsubscribe = () => void; export type unsubscribe = () => void;
export type Events = string | string[]; export type Events = string | string[];
const TAG = "EventManager"; const TAG = "EventManagerSc";
class EventManager { class EventManager {
mEventBus: EventBus<string>; mEventBus: EventBus<string>;

View File

@ -3,7 +3,7 @@
"name": "common", "name": "common",
"type": "har", "type": "har",
"deviceTypes": [ "deviceTypes": [
"phone", "default",
"tablet" "tablet"
], ],
"uiSyntax": "ets" "uiSyntax": "ets"

View File

@ -6,7 +6,7 @@
"description": "$string:entry_desc", "description": "$string:entry_desc",
"mainElement": "MainAbility", "mainElement": "MainAbility",
"deviceTypes": [ "deviceTypes": [
"phone", "default",
"tablet" "tablet"
], ],
"deliveryWithInstall": true, "deliveryWithInstall": true,
@ -21,6 +21,8 @@
"icon": "$media:icon", "icon": "$media:icon",
"label": "$string:MainAbility_label", "label": "$string:MainAbility_label",
"visible": true, "visible": true,
"startWindowIcon": "$media:icon",
"startWindowBackground": "$color:startWindowBackground",
"skills": [ "skills": [
{ {
"entities": [ "entities": [

View File

@ -0,0 +1,8 @@
{
"color": [
{
"name": "startWindowBackground",
"value": "#ffffff"
}
]
}

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/* /*
* Copyright (c) 2022 Huawei Device Co., Ltd. * Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
@ -25,7 +26,7 @@ import {
POLICY, POLICY,
} from "../../../../../../common/src/main/ets/default/commonEvent/CommonEventManager"; } from "../../../../../../common/src/main/ets/default/commonEvent/CommonEventManager";
const TAG = "BatteryComponent-batteryModel"; const TAG = "BatteryComponent-batteryModelSc";
const DEFAULT_PROGRESS = 100; const DEFAULT_PROGRESS = 100;
const SUBSCRIBE_INFO = { const SUBSCRIBE_INFO = {
events: [commonEvent.Support.COMMON_EVENT_BATTERY_CHANGED], events: [commonEvent.Support.COMMON_EVENT_BATTERY_CHANGED],

View File

@ -3,7 +3,7 @@
"name": "batterycomponent", "name": "batterycomponent",
"type": "har", "type": "har",
"deviceTypes": [ "deviceTypes": [
"phone", "default",
"tablet" "tablet"
], ],
"uiSyntax": "ets" "uiSyntax": "ets"

View File

@ -3,7 +3,7 @@
"name": "clockcomponent", "name": "clockcomponent",
"type": "har", "type": "har",
"deviceTypes": [ "deviceTypes": [
"phone", "default",
"tablet" "tablet"
], ],
"uiSyntax": "ets" "uiSyntax": "ets"

View File

@ -3,7 +3,7 @@
"name": "datetimecomponent", "name": "datetimecomponent",
"type": "har", "type": "har",
"deviceTypes": [ "deviceTypes": [
"phone", "default",
"tablet" "tablet"
], ],
"uiSyntax": "ets" "uiSyntax": "ets"

View File

@ -28,8 +28,8 @@ export default class CommonUtil {
static startWant(want, triggerInfo?: any) { static startWant(want, triggerInfo?: any) {
let info = (triggerInfo) ? triggerInfo : DEFAULT_INFO; let info = (triggerInfo) ? triggerInfo : DEFAULT_INFO;
Log.showDebug(TAG, `startWant ${JSON.stringify(want)}, info ${JSON.stringify(info)}`); Log.showDebug(TAG, `startWant ${JSON.stringify(want)}, info ${JSON.stringify(info)}`);
WantAgent.trigger(want, info, ((err, data) => { WantAgent.trigger(want, info, ((data) => {
Log.showDebug(TAG, `wantAgent trigger err ${JSON.stringify(err)} data ${JSON.stringify(data)}`); Log.showDebug(TAG, `wantAgent trigger data ${JSON.stringify(data)}`);
})); }));
} }

View File

@ -13,8 +13,6 @@
* limitations under the License. * limitations under the License.
*/ */
import notification from '@ohos.notification';
import NotificationSubscriber from '@ohos.notificationSubscriber';
import Log from '../../../../../../../../../common/src/main/ets/default/Log'; import Log from '../../../../../../../../../common/src/main/ets/default/Log';
import NotificationManager from './NotificationManager'; import NotificationManager from './NotificationManager';
import ParseDataUtil from './ParseDataUtil'; import ParseDataUtil from './ParseDataUtil';
@ -23,7 +21,7 @@ import CommonUtil from '../common/CommonUtil';
import createOrGet from "../../../../../../../../../common/src/main/ets/default/SingleInstanceHelper"; import createOrGet from "../../../../../../../../../common/src/main/ets/default/SingleInstanceHelper";
import DistributionManager from './NotificationDistributionManager'; import DistributionManager from './NotificationDistributionManager';
const TAG = 'NotificationService'; const TAG = 'NotificationServiceSc';
interface NotificationListener { interface NotificationListener {
userId: number; userId: number;

View File

@ -13,14 +13,12 @@
* limitations under the License. * limitations under the License.
*/ */
import Notification from '@ohos.notification';
import AccountManager from '@ohos.account.osAccount'; import AccountManager from '@ohos.account.osAccount';
import Log from '../../../../../../../../../common/src/main/ets/default/Log'; import Log from '../../../../../../../../../common/src/main/ets/default/Log';
import BundleManager from '../../../../../../../../../common/src/main/ets/default/abilitymanager/bundleManager'; import BundleManager from '../../../../../../../../../common/src/main/ets/default/abilitymanager/bundleManager';
import AbilityManager from '../../../../../../../../../common/src/main/ets/default/abilitymanager/abilityManager'; import AbilityManager from '../../../../../../../../../common/src/main/ets/default/abilitymanager/abilityManager';
import DistributionManager from './NotificationDistributionManager';
import NotificationManager from './NotificationManager'; import NotificationManager from './NotificationManager';
import Constants, {NotificationItemData} from '../common/constants'; import {NotificationItemData} from '../common/constants';
import {NotificationConfig} from './NotificationConfig'; import {NotificationConfig} from './NotificationConfig';
const TAG = 'Notification_ParseDataUtil'; const TAG = 'Notification_ParseDataUtil';
@ -39,11 +37,8 @@ type NotificationContent = {
} }
async function getUserId(uid) { async function getUserId(uid) {
let userId = await AccountManager.getAccountManager().getOsAccountLocalIdFromUid(uid) let userId = await AccountManager.getAccountManager().getOsAccountLocalIdFromUid(uid);
.catch((err)=>{ Log.showInfo(TAG, `getOsAccountLocalIdFromUid uid = ${uid}, userId = ${userId}`);
Log.showError(TAG, `getOsAccountLocalIdFromUid error error: ${JSON.stringify(err)}`);
})
Log.showDebug(TAG, `getOsAccountLocalIdFromUid uid = ${uid}, userId = ${userId}`);
return userId; return userId;
} }
@ -112,8 +107,8 @@ export default class ParseDataUtil {
let context = AbilityManager.getContext()??AbilityManager.getContext(AbilityManager.ABILITY_NAME_SCREEN_LOCK); let context = AbilityManager.getContext()??AbilityManager.getContext(AbilityManager.ABILITY_NAME_SCREEN_LOCK);
let item = await BundleManager.getResourceManager(TAG, context, bundleName); let item = await BundleManager.getResourceManager(TAG, context, bundleName);
let appMessage = { let appMessage = {
appName: labelId > 0 ? await item.getString(labelId) : '', appName: parseInt(labelId) > 0 ? await item.getString(parseInt(labelId)) : '',
icon: iconId > 0 ? await item.getMediaBase64(iconId) : null icon: parseInt(iconId) > 0 ? await item.getMediaBase64(parseInt(iconId)) : null
}; };
if (appMessage.icon != null && appMessage.appName) { if (appMessage.icon != null && appMessage.appName) {
appDataMap.set(bundleName, appMessage); appDataMap.set(bundleName, appMessage);

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/* /*
* Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -27,8 +27,8 @@ type NotificationLayoutConfig = {
@Component @Component
export default struct NotificationListComponent { export default struct NotificationListComponent {
@Provide('notificationUpdate') update: number = 0; @Provide('notificationUpdateSc') update: number = 0;
@StorageLink('notificationList') notificationList: any[] = [] @StorageLink('notificationListSc') notificationList: any[] = []
private config: NotificationLayoutConfig = { private config: NotificationLayoutConfig = {
itemMargin: Layout.ITEM_MARGIN itemMargin: Layout.ITEM_MARGIN
} }

View File

@ -28,7 +28,7 @@ const TAG = 'NoticeItem-GeneralItem';
@Component @Component
export default struct GeneralItem { export default struct GeneralItem {
@Consume('notificationUpdate') updateFlag: number; @Consume('notificationUpdateSc') updateFlag: number;
@State hasPicture: boolean = false @State hasPicture: boolean = false
@State @Watch('expandChange') isExpand: boolean = false @State @Watch('expandChange') isExpand: boolean = false
@State needExpand: boolean = true @State needExpand: boolean = true

View File

@ -24,7 +24,7 @@ const TAG = 'NoticeItem-GroupItem';
@Component @Component
export default struct GroupItem { export default struct GroupItem {
@Consume('notificationUpdate') updateFlag: number; @Consume('notificationUpdateSc') updateFlag: number;
@State distributedDeviceName: string = '' @State distributedDeviceName: string = ''
@State @Watch('expandChange') toExpand: boolean = false; @State @Watch('expandChange') toExpand: boolean = false;
private groupData: any[] = [] private groupData: any[] = []

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/* /*
* Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
@ -16,8 +17,6 @@
import Log from '../../../../../../../../../common/src/main/ets/default/Log'; import Log from '../../../../../../../../../common/src/main/ets/default/Log';
import SwitchUserManager from '../../../../../../../../../common/src/main/ets/default/SwitchUserManager'; import SwitchUserManager from '../../../../../../../../../common/src/main/ets/default/SwitchUserManager';
import media from '@ohos.multimedia.media'; import media from '@ohos.multimedia.media';
import vibrator from '@ohos.vibrator';
import wantAgent from '@ohos.wantAgent';
import SourceType from '@ohos.notification' import SourceType from '@ohos.notification'
import NotificationService from '../model/NotificationService' import NotificationService from '../model/NotificationService'
import NotificationWindowManager from '../model/NotificationWindowManager'; import NotificationWindowManager from '../model/NotificationWindowManager';
@ -129,7 +128,7 @@ export class ViewModel {
Log.showDebug(TAG, `updateNotification length: ${this.mNotificationList.length}`); Log.showDebug(TAG, `updateNotification length: ${this.mNotificationList.length}`);
this.sortNotification() this.sortNotification()
let notificationList = this.groupByGroupName(); let notificationList = this.groupByGroupName();
AppStorage.SetOrCreate('notificationList', notificationList); AppStorage.SetOrCreate('notificationListSc', notificationList);
} }
groupByGroupName(): any[]{ groupByGroupName(): any[]{

View File

@ -3,7 +3,7 @@
"name": "noticeitem", "name": "noticeitem",
"type": "har", "type": "har",
"deviceTypes": [ "deviceTypes": [
"phone", "default",
"tablet" "tablet"
], ],
"uiSyntax": "ets" "uiSyntax": "ets"

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/* /*
* Copyright (c) 2022 Huawei Device Co., Ltd. * Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -150,9 +150,9 @@ export class ScreenLockService {
lockScreen() { lockScreen() {
Trace.start(Trace.CORE_METHOD_SHOW_LOCK_SCREEN); Trace.start(Trace.CORE_METHOD_SHOW_LOCK_SCREEN);
Log.showDebug(TAG, `lockScreen`); Log.showDebug(TAG, `lockScreen`);
let length = Router.getLength() let length = parseInt(Router.getLength())
Log.showDebug(TAG, `Router.getLength: ${length}`) Log.showDebug(TAG, `Router.getLength: ${length}`)
for (let index = 1;index < length; index++) { for (let index = 1; index < length; index++) {
Log.showInfo(TAG, `back to index`); Log.showInfo(TAG, `back to index`);
Router.back(); Router.back();
} }

View File

@ -3,7 +3,7 @@
"name": "screenlock", "name": "screenlock",
"type": "har", "type": "har",
"deviceTypes": [ "deviceTypes": [
"phone", "default",
"tablet" "tablet"
], ],
"uiSyntax": "ets" "uiSyntax": "ets"

View File

@ -3,7 +3,7 @@
"name": "shortcutcomponent", "name": "shortcutcomponent",
"type": "har", "type": "har",
"deviceTypes": [ "deviceTypes": [
"phone", "default",
"tablet" "tablet"
], ],
"uiSyntax": "ets" "uiSyntax": "ets"

View File

@ -3,7 +3,7 @@
"name": "signalcomponent", "name": "signalcomponent",
"type": "har", "type": "har",
"deviceTypes": [ "deviceTypes": [
"phone", "default",
"tablet" "tablet"
], ],
"uiSyntax": "ets" "uiSyntax": "ets"

View File

@ -3,7 +3,7 @@
"name": "wallpapercomponent", "name": "wallpapercomponent",
"type": "har", "type": "har",
"deviceTypes": [ "deviceTypes": [
"phone", "default",
"tablet" "tablet"
], ],
"uiSyntax": "ets" "uiSyntax": "ets"

View File

@ -3,7 +3,7 @@
"name": "wificomponent", "name": "wificomponent",
"type": "har", "type": "har",
"deviceTypes": [ "deviceTypes": [
"phone", "default",
"tablet" "tablet"
], ],
"uiSyntax": "ets" "uiSyntax": "ets"

View File

@ -1,18 +1,19 @@
{ {
"license":"ISC", "license": "ISC",
"devDependencies":{}, "devDependencies": {},
"name":"screenlock", "name": "systemui",
"ohos":{ "ohos": {
"org":"huawei", "org": "huawei",
"directoryLevel":"project", "directoryLevel": "project",
"buildTool":"hvigor" "buildTool": "hvigor"
}, },
"description":"example description", "description": "example description",
"repository":{}, "repository": {},
"version":"1.0.0", "version": "1.0.0",
"dependencies":{ "dependencies": {
"@ohos/hvigor-ohos-plugin":"1.0.6", "@ohos/hvigor-ohos-plugin": "1.1.6",
"hypium":"^1.0.0", "hypium": "^1.0.0",
"@ohos/hvigor":"1.0.6" "@ohos/hvigor": "1.1.6",
} "@ohos/hypium": "1.0.1"
} }
}

View File

@ -31,7 +31,6 @@ export default struct CustomPassword {
aboutToAppear() { aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear`) Log.showInfo(TAG, `aboutToAppear`)
setAppBgColor('#00000000')
CommonStyleManager.setAbilityPageName(TAG) CommonStyleManager.setAbilityPageName(TAG)
let configInfo = AbilityManager.getAbilityData(AbilityManager.ABILITY_NAME_STATUS_BAR, 'rect') let configInfo = AbilityManager.getAbilityData(AbilityManager.ABILITY_NAME_STATUS_BAR, 'rect')
this.mHeightPx = configInfo.height this.mHeightPx = configInfo.height

View File

@ -31,7 +31,6 @@ export default struct DigitalPassword {
aboutToAppear() { aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear`) Log.showInfo(TAG, `aboutToAppear`)
setAppBgColor('#00000000')
CommonStyleManager.setAbilityPageName(TAG) CommonStyleManager.setAbilityPageName(TAG)
let configInfo = AbilityManager.getAbilityData(AbilityManager.ABILITY_NAME_STATUS_BAR, 'rect') let configInfo = AbilityManager.getAbilityData(AbilityManager.ABILITY_NAME_STATUS_BAR, 'rect')
Log.showInfo(TAG, `configMaxWidth${JSON.stringify(configInfo.height)}`) Log.showInfo(TAG, `configMaxWidth${JSON.stringify(configInfo.height)}`)

View File

@ -71,7 +71,7 @@ struct Index {
} }
onBackPress(): boolean { onBackPress(): boolean {
let length = Router.getLength() let length = parseInt(Router.getLength())
Log.showInfo(TAG, `onBackPress length: ${length}`) Log.showInfo(TAG, `onBackPress length: ${length}`)
if (length > 1) { if (length > 1) {
Router.back() Router.back()

View File

@ -31,7 +31,6 @@ export default struct MixedPassword {
aboutToAppear() { aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear`) Log.showInfo(TAG, `aboutToAppear`)
setAppBgColor('#00000000')
CommonStyleManager.setAbilityPageName(TAG) CommonStyleManager.setAbilityPageName(TAG)
let configInfo = AbilityManager.getAbilityData(AbilityManager.ABILITY_NAME_STATUS_BAR, 'rect') let configInfo = AbilityManager.getAbilityData(AbilityManager.ABILITY_NAME_STATUS_BAR, 'rect')
Log.showDebug(TAG, `configMaxWidth${JSON.stringify(configInfo.height)}`) Log.showDebug(TAG, `configMaxWidth${JSON.stringify(configInfo.height)}`)

View File

@ -4,7 +4,7 @@
"type": "feature", "type": "feature",
"srcEntrance": "./ets/Application/AbilityStage.ts", "srcEntrance": "./ets/Application/AbilityStage.ts",
"description": "$string:pc_desc", "description": "$string:pc_desc",
"mainElement": "ServiceExtAbility", "mainElement": "com.ohos.systemui.screenlock.ServiceExtAbility",
"deviceTypes": [ "deviceTypes": [
"tablet" "tablet"
], ],
@ -73,7 +73,7 @@
], ],
"extensionAbilities": [ "extensionAbilities": [
{ {
"name": "ServiceExtAbility", "name": "com.ohos.systemui.screenlock.ServiceExtAbility",
"srcEntrance": "./ets/ServiceExtAbility/ServiceExtAbility.ts", "srcEntrance": "./ets/ServiceExtAbility/ServiceExtAbility.ts",
"description": "$string:MainAbility_desc", "description": "$string:MainAbility_desc",
"icon": "$media:icon", "icon": "$media:icon",

View File

@ -31,7 +31,6 @@ export default struct CustomPassword {
aboutToAppear() { aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear`) Log.showInfo(TAG, `aboutToAppear`)
setAppBgColor('#00000000')
CommonStyleManager.setAbilityPageName(TAG) CommonStyleManager.setAbilityPageName(TAG)
let configInfo = AbilityManager.getAbilityData(AbilityManager.ABILITY_NAME_STATUS_BAR, 'rect') let configInfo = AbilityManager.getAbilityData(AbilityManager.ABILITY_NAME_STATUS_BAR, 'rect')
Log.showDebug(TAG, `configMaxWidth${JSON.stringify(configInfo.height)}`) Log.showDebug(TAG, `configMaxWidth${JSON.stringify(configInfo.height)}`)

View File

@ -31,7 +31,6 @@ export default struct DigitalPassword {
aboutToAppear() { aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear`) Log.showInfo(TAG, `aboutToAppear`)
setAppBgColor('#00000000')
CommonStyleManager.setAbilityPageName(TAG) CommonStyleManager.setAbilityPageName(TAG)
let configInfo = AbilityManager.getAbilityData(AbilityManager.ABILITY_NAME_STATUS_BAR, 'rect') let configInfo = AbilityManager.getAbilityData(AbilityManager.ABILITY_NAME_STATUS_BAR, 'rect')
Log.showDebug(TAG, `configMaxWidth${JSON.stringify(configInfo.height)}`) Log.showDebug(TAG, `configMaxWidth${JSON.stringify(configInfo.height)}`)

View File

@ -72,7 +72,7 @@ struct Index {
} }
onBackPress(): boolean { onBackPress(): boolean {
let length = Router.getLength() let length = parseInt(Router.getLength())
Log.showDebug(TAG, `onBackPress length: ${length}`) Log.showDebug(TAG, `onBackPress length: ${length}`)
if (length > 1) { if (length > 1) {
Router.back() Router.back()

View File

@ -31,7 +31,6 @@ export default struct MixedPassword {
aboutToAppear() { aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear`) Log.showInfo(TAG, `aboutToAppear`)
setAppBgColor('#00000000')
CommonStyleManager.setAbilityPageName(TAG) CommonStyleManager.setAbilityPageName(TAG)
let configInfo = AbilityManager.getAbilityData(AbilityManager.ABILITY_NAME_STATUS_BAR, 'rect') let configInfo = AbilityManager.getAbilityData(AbilityManager.ABILITY_NAME_STATUS_BAR, 'rect')
Log.showDebug(TAG, `configMaxWidth${JSON.stringify(configInfo.height)}`) Log.showDebug(TAG, `configMaxWidth${JSON.stringify(configInfo.height)}`)

View File

@ -111,6 +111,8 @@ export default struct SlideScreenlock {
} }
.alignItems(HorizontalAlign.Center) .alignItems(HorizontalAlign.Center)
.width(Constants.NOTIFICATION_AREA_WIDTH) .width(Constants.NOTIFICATION_AREA_WIDTH)
.borderWidth("4vp")
.borderColor(Color.Green)
} }
.width(Constants.FULL_CONTAINER_WIDTH) .width(Constants.FULL_CONTAINER_WIDTH)
.height(Constants.FULL_CONTAINER_HEIGHT) .height(Constants.FULL_CONTAINER_HEIGHT)

View File

@ -4,9 +4,9 @@
"type": "feature", "type": "feature",
"srcEntrance": "./ets/Application/AbilityStage.ts", "srcEntrance": "./ets/Application/AbilityStage.ts",
"description": "$string:phone_desc", "description": "$string:phone_desc",
"mainElement": "ServiceExtAbility", "mainElement": "com.ohos.systemui.screenlock.ServiceExtAbility",
"deviceTypes": [ "deviceTypes": [
"phone" "default"
], ],
"deliveryWithInstall": true, "deliveryWithInstall": true,
"installationFree": false, "installationFree": false,
@ -70,7 +70,7 @@
], ],
"extensionAbilities": [ "extensionAbilities": [
{ {
"name": "ServiceExtAbility", "name": "com.ohos.systemui.screenlock.ServiceExtAbility",
"srcEntrance": "./ets/ServiceExtAbility/ServiceExtAbility.ts", "srcEntrance": "./ets/ServiceExtAbility/ServiceExtAbility.ts",
"description": "$string:MainAbility_desc", "description": "$string:MainAbility_desc",
"icon": "$media:icon", "icon": "$media:icon",