From 30cc1a5af8d388e3ce3120eaefb20f02b51b51ba Mon Sep 17 00:00:00 2001 From: tangzhigang1 Date: Tue, 25 Oct 2022 20:45:40 +0800 Subject: [PATCH] =?UTF-8?q?AR000HK93K=202022.10.25=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=A8=AA=E7=AB=96=E5=B1=8F=E6=97=8B=E8=BD=AC=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: tangzhigang1 --- .../src/main/ets/com/ohos/model/AutoRotateService.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/features/autorotatecomponent/src/main/ets/com/ohos/model/AutoRotateService.ts b/features/autorotatecomponent/src/main/ets/com/ohos/model/AutoRotateService.ts index 37db8d8e..3bfe1762 100644 --- a/features/autorotatecomponent/src/main/ets/com/ohos/model/AutoRotateService.ts +++ b/features/autorotatecomponent/src/main/ets/com/ohos/model/AutoRotateService.ts @@ -79,12 +79,14 @@ export class AutoRotateService { async changeSwitch(status: boolean): Promise { screen.setScreenRotationLocked(!status).then((err, data) => { + this.updateAutoRotateSwitchStatus(); if (err.code) { Log.showDebug(TAG, `changeSwitch, error: ${JSON.stringify(err)}`); + } else { + Log.showDebug(TAG, `changeSwitch success, isAutoRotate: ${JSON.stringify(status)}`); } - this.updateAutoRotateSwitchStatus(); - Log.showDebug(TAG, `changeSwitch success, isAutoRotate: ${JSON.stringify(status)}`); }); + this.updateAutoRotateSwitchStatus(); } }