From 4dfa02403a0a37a6bd9eabd32704be05391cefde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=8F=8B=E6=9D=BE?= Date: Wed, 26 Jun 2024 10:44:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9hap=E5=BC=B9=E6=A1=86=20Signe?= =?UTF-8?q?d-off-by:=20=E9=82=B9=E5=8F=8B=E6=9D=BE=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AppScope/app.json5 | 4 ++-- feature/ota/src/main/ets/manager/OtaUpdateManager.ets | 2 ++ feature/ota/src/main/ets/manager/StateManager.ets | 1 + product/oh/base/src/main/ets/ServiceExtAbility/service.ts | 5 ++--- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/AppScope/app.json5 b/AppScope/app.json5 index b9626ec..2d0b59c 100644 --- a/AppScope/app.json5 +++ b/AppScope/app.json5 @@ -3,8 +3,8 @@ "bundleName": "com.ohos.updateapp", "debug": false, "vendor": "example", - "versionCode": 2040000100, - "versionName": "204.0.0.100", + "versionCode": 2040000105, + "versionName": "204.0.0.105", "icon": "$media:app_icon", "label": "$string:app_name", "distributedNotificationEnabled": true diff --git a/feature/ota/src/main/ets/manager/OtaUpdateManager.ets b/feature/ota/src/main/ets/manager/OtaUpdateManager.ets index 2cf7834..a176b45 100644 --- a/feature/ota/src/main/ets/manager/OtaUpdateManager.ets +++ b/feature/ota/src/main/ets/manager/OtaUpdateManager.ets @@ -369,9 +369,11 @@ export class OtaUpdateManager { public async handleWant(want: Want, context: common.Context): Promise { let action: string = want?.action ?? ''; if (await NotificationManager.handleAction(action, context)) { + this.log('handleWant:' + FormatUtils.stringify(want)); return; } let eventInfo = this.wantParser(want); + this.log('handleWant:' + ' eventInfo is ${FormatUtils.stringify(eventInfo)}'); if (!eventInfo?.eventId) { this.log('eventInfo?.eventId is null'); return; diff --git a/feature/ota/src/main/ets/manager/StateManager.ets b/feature/ota/src/main/ets/manager/StateManager.ets index 0697c26..ebdd7dd 100644 --- a/feature/ota/src/main/ets/manager/StateManager.ets +++ b/feature/ota/src/main/ets/manager/StateManager.ets @@ -422,6 +422,7 @@ export class DownloadSuccess extends BaseState { async notify(context?: common.Context, eventId?: update.EventId): Promise { let isABInstall = await VersionUtils.isABInstall(); + LogUtils.info('StateManager:', 'notify ab flag ' + isABInstall + ',eventId:' + eventId); if (eventId == update.EventId.EVENT_DOWNLOAD_SUCCESS && isABInstall) { OtaUpdateManager.getInstance().upgrade(update.Order.INSTALL); return; diff --git a/product/oh/base/src/main/ets/ServiceExtAbility/service.ts b/product/oh/base/src/main/ets/ServiceExtAbility/service.ts index 6f6a25e..2171c11 100644 --- a/product/oh/base/src/main/ets/ServiceExtAbility/service.ts +++ b/product/oh/base/src/main/ets/ServiceExtAbility/service.ts @@ -70,10 +70,9 @@ export default class ServiceExtAbility extends Extension { }, this.connectTimeout * 1000); let want: Want = { - parameters: { - parameters: FormatUtils.parseJson(message) - } + parameters: FormatUtils.parseJson(message) }; + LogUtils.log(ServiceExtAbility.TAG, 'onConnect:' + FormatUtils.stringify(want)); OtaUpdateManager.getInstance().handleWant(want, globalThis.extensionContext); } -- Gitee