diff --git a/display/AppScope/app.json b/display/AppScope/app.json index c4e9d0b90f360e0ac8e0f84ffb8e901b65aaf702..bfc8e70ec0bf34e9c9427f02d811b4bc34080c71 100644 --- a/display/AppScope/app.json +++ b/display/AppScope/app.json @@ -2,8 +2,8 @@ "app": { "bundleName": "com.ohos.devicemanagerui", "vendor": "example", - "versionCode": 1000035, - "versionName": "1.0.35", + "versionCode": 1000036, + "versionName": "1.0.36", "icon": "$media:app_icon", "label": "$string:app_name", "minAPIVersion": 10, diff --git a/display/entry/src/main/ets/pages/ConfirmDialog.ets b/display/entry/src/main/ets/pages/ConfirmDialog.ets index 43a0bd10a0b8a510340fcc811da3c3057ed2523c..fdbd39dfb2fad2df764350400f687ff39dcec097 100644 --- a/display/entry/src/main/ets/pages/ConfirmDialog.ets +++ b/display/entry/src/main/ets/pages/ConfirmDialog.ets @@ -308,6 +308,14 @@ struct ConfirmCustomDialog { console.log(TAG + 'onKeyEvent eventType: ' + event?.type) this.onCancel(); } + if (event && event?.keyCode === KeyCode.KEYCODE_POWER && event?.type === KeyType.Down) { + console.log(TAG + 'onKeyEvent eventType: ' + event?.type) + return; + } + if (event && event?.keyCode === KeyCode.KEYCODE_POWER && event?.type === KeyType.Up) { + console.log(TAG + 'onKeyEvent eventType: ' + event?.type) + this.onCancel(); + } }) .onClick(() => { this.onCancel(); diff --git a/display/entry/src/main/ets/pages/PinDialog.ets b/display/entry/src/main/ets/pages/PinDialog.ets index df0408e3a4e0cad107f9319d53e5c9da29eae90c..4c76df2a824c42eeceb7cc7e00f3c4018516822b 100644 --- a/display/entry/src/main/ets/pages/PinDialog.ets +++ b/display/entry/src/main/ets/pages/PinDialog.ets @@ -136,6 +136,18 @@ struct PinCustomDialog { this.cancel(); this.setUserOperation(ACTION_CANCEL_PINCODE_DISPLAY); } + if (event && event?.keyCode === KeyCode.KEYCODE_POWER && event?.type === KeyType.Down) { + console.log(TAG + 'onKeyEvent eventType: ' + event?.type) + return; + } + if (event && event?.keyCode === KeyCode.KEYCODE_POWER && event?.type === KeyType.Up) { + console.log(TAG + 'onKeyEvent eventType: ' + event?.type) + if (this.controller) { + this.controller.close(); + } + this.cancel(); + this.setUserOperation(ACTION_CANCEL_PINCODE_DISPLAY); + } }) .onClick(() => { if (this.controller) {