diff --git a/liveviewlockscreenlibrary/build-profile.json5 b/liveviewlockscreenlibrary/build-profile.json5 index cda3307123ec7c43181580a86ef7e82a18319a34..312d38eb08629793b3484c7373213f22840c8d82 100644 --- a/liveviewlockscreenlibrary/build-profile.json5 +++ b/liveviewlockscreenlibrary/build-profile.json5 @@ -8,7 +8,7 @@ "arkOptions": { "obfuscation": { "ruleOptions": { - "enable": false, + "enable": true, "files": [ "./obfuscation-rules.txt" ] diff --git a/liveviewlockscreenlibrary/src/main/ets/liveview/LockScreenPage.ets b/liveviewlockscreenlibrary/src/main/ets/liveview/LockScreenPage.ets index 702675d935ed4b7523a96e546e596cfc1e2036fa..a16002716cb73df652d4185d43b7ba764203cf52 100644 --- a/liveviewlockscreenlibrary/src/main/ets/liveview/LockScreenPage.ets +++ b/liveviewlockscreenlibrary/src/main/ets/liveview/LockScreenPage.ets @@ -22,7 +22,6 @@ let storage: LocalStorage = LocalStorage.getShared(); @Entry(storage) @Component export struct LockScreenPage { - // [Start layoutBasedOnVerticalBreakpoint] @StorageLink('currentHeightBreakpoint') currentHeightBreakpoint: string = BreakpointTypeEnum.SM; @LocalStorageProp('laneData') roadInfo: LaneData | undefined = undefined; @@ -42,6 +41,4 @@ export struct LockScreenPage { .width('100%') .height('100%') } - - // [End layoutBasedOnVerticalBreakpoint] } \ No newline at end of file diff --git a/liveviewlockscreenlibrary/src/main/ets/pages/LiveViewLockScreenPage.ets b/liveviewlockscreenlibrary/src/main/ets/pages/LiveViewLockScreenPage.ets index 511d61468fab881fcb3c9abb2faa48894062a3b9..4b33d94a0948c950676b91f3e8547979d8836121 100644 --- a/liveviewlockscreenlibrary/src/main/ets/pages/LiveViewLockScreenPage.ets +++ b/liveviewlockscreenlibrary/src/main/ets/pages/LiveViewLockScreenPage.ets @@ -107,4 +107,4 @@ export struct LiveViewLockScreenPage { .width('100%') .height('100%') } -} +} \ No newline at end of file diff --git a/liveviewlockscreenlibrary/src/main/ets/utils/LiveView.ets b/liveviewlockscreenlibrary/src/main/ets/utils/LiveView.ets index 71759a2e5716325f1aa13cbbf4116fa2aa7b4522..cc8fc390d0abcadbd29f0d057e55445c98e3e41e 100644 --- a/liveviewlockscreenlibrary/src/main/ets/utils/LiveView.ets +++ b/liveviewlockscreenlibrary/src/main/ets/utils/LiveView.ets @@ -14,12 +14,8 @@ */ import { appManager, WantAgent, wantAgent } from '@kit.AbilityKit'; -// [Start startContinuousRunningTask] import { backgroundTaskManager } from '@kit.BackgroundTasksKit'; -// [StartExclude startContinuousRunningTask] -// [Start pushCommonEvent] import { BusinessError, commonEventManager } from '@kit.BasicServicesKit'; -// [StartExclude pushCommonEvent] import { hilog } from '@kit.PerformanceAnalysisKit'; import { RouteData } from '../model/RouteDataModel'; import { LiveViewUtil } from './LiveViewUtil'; @@ -54,7 +50,6 @@ export class LiveView { // Initialize live view and start background tasks this.liveViewController.startLiveView(getRouteData()).then(() => { this.startContinuousRunningTask(); - // [Start getRunningProcessInfo] // Set up periodic state checking this.updateInterval = setInterval(() => { // Monitor application state changes @@ -62,10 +57,8 @@ export class LiveView { hilog.info(0x0000, TAG, '%{public}s', 'Success to getRunningProcessInformation'); // Handle background state if (data[0].state === appManager.ProcessState.STATE_BACKGROUND) { - // [StartExclude getRunningProcessInfo] let routeInfo: RouteData = getRouteData(); this.liveViewController.updateLiveView(routeInfo); - // [EndExclude pushCommonEvent] // Prepare common event data let options: commonEventManager.CommonEventPublishData = { data: 'data', @@ -83,33 +76,27 @@ export class LiveView { hilog.info(0x0000, TAG, '%{public}s', 'Succeeded in publishing commonEvent.') } }); - // [End pushCommonEvent] - // [EndExclude getRunningProcessInfo] } }).catch((error: BusinessError) => { hilog.error(0x0000, TAG, '%{public}s', `Failed to getRunningProcessInformation. code is ${error.code} message is ${error.message}`); }); }, 2000) - // [End getRunningProcessInfo] }) } // Cleanup method to stop all live view activities public finishLiveView() { - // [Start clearPeriodicUpdates] // Clear periodic updates if (this.updateInterval !== undefined) { clearInterval(this.updateInterval); this.updateInterval = undefined; hilog.info(0x0000, TAG, '%{public}s', 'Timer has been cleared'); } - // [End clearPeriodicUpdates] // Shutdown live view components this.liveViewController.closeLiveView(); - // [Start stopBackgroundRunning] // Stop background tasks try { backgroundTaskManager.stopBackgroundRunning(this.context).then(() => { @@ -122,10 +109,8 @@ export class LiveView { hilog.error(0x0000, TAG, '%{public}s', `Operation stopBackgroundRunning failed. code is ${(error as BusinessError).code} message is ${(error as BusinessError).message}`); } - // [End stopBackgroundRunning] } - // [EndExclude startContinuousRunningTask] // Internal method to manage background tasks private startContinuousRunningTask() { // Configure WantAgent for background operation @@ -165,6 +150,4 @@ export class LiveView { `Failed to Operation getWantAgent. code is ${(error as BusinessError).code} message is ${(error as BusinessError).message}`); } } - - // [End startContinuousRunningTask] } \ No newline at end of file diff --git a/liveviewlockscreenlibrary/src/main/ets/utils/LiveViewUtil.ets b/liveviewlockscreenlibrary/src/main/ets/utils/LiveViewUtil.ets index a76b662c36fcb18658a6bf64f4bf2a201d5349ed..e860c886ba4fc630377d133eda8db940ccab7111 100644 --- a/liveviewlockscreenlibrary/src/main/ets/utils/LiveViewUtil.ets +++ b/liveviewlockscreenlibrary/src/main/ets/utils/LiveViewUtil.ets @@ -15,9 +15,7 @@ import { application, Want, wantAgent } from '@kit.AbilityKit'; import { BusinessError } from '@kit.BasicServicesKit'; -// [Start createLiveView] import { liveViewManager } from '@kit.LiveViewKit'; -// [StartExclude createLiveView] import { hilog } from '@kit.PerformanceAnalysisKit'; import { RouteData } from '../model/RouteDataModel'; @@ -60,7 +58,6 @@ export class LiveViewUtil { } } - // [Start closeLiveView] // Close live view. public async closeLiveView() { // Ensure that the sequence is greater than the current live window page. @@ -77,8 +74,6 @@ export class LiveViewUtil { return; } - // [End closeLiveView] - private static async isLiveViewEnabled(): Promise { return await liveViewManager.isLiveViewEnabled(); } @@ -120,7 +115,6 @@ export class LiveViewUtil { } private async createPrimaryLiveVie(): Promise { - // [EndExclude createLiveView] // Construct live window request body. let liveView: liveViewManager.LiveView = { id: 0, @@ -148,7 +142,6 @@ export class LiveViewUtil { } } }; - // [End createLiveView] return liveView; } diff --git a/liveviewlockscreenlibrary/src/main/resources/base/element/string.json b/liveviewlockscreenlibrary/src/main/resources/base/element/string.json index 056f708939384c86af3ce060ad37bf096b118abd..46b8d3ab1ee3378f2247858c69af17356f2f2399 100644 --- a/liveviewlockscreenlibrary/src/main/resources/base/element/string.json +++ b/liveviewlockscreenlibrary/src/main/resources/base/element/string.json @@ -72,10 +72,6 @@ "name": "then", "value": "然后" }, - { - "name": "toast", - "value": "提醒:锁屏沉浸实况窗须申请相关权限才可体验" - }, { "name": "Continue", "value": "继续导航" diff --git a/liveviewlockscreenlibrary/src/main/resources/en_US/element/string.json b/liveviewlockscreenlibrary/src/main/resources/en_US/element/string.json index 2e470b4c847a0a9c7624df589800eadcc1801ca2..a12041fb40f87c6fd7c777f15c5467e1ab32c217 100644 --- a/liveviewlockscreenlibrary/src/main/resources/en_US/element/string.json +++ b/liveviewlockscreenlibrary/src/main/resources/en_US/element/string.json @@ -72,10 +72,6 @@ "name": "then", "value": "Then" }, - { - "name": "toast", - "value": "Tip: You must apply for relevant permissions to experience the lock screen live view." - }, { "name": "Continue", "value": "Continue" diff --git a/liveviewlockscreenlibrary/src/main/resources/zh_CN/element/string.json b/liveviewlockscreenlibrary/src/main/resources/zh_CN/element/string.json index 056f708939384c86af3ce060ad37bf096b118abd..46b8d3ab1ee3378f2247858c69af17356f2f2399 100644 --- a/liveviewlockscreenlibrary/src/main/resources/zh_CN/element/string.json +++ b/liveviewlockscreenlibrary/src/main/resources/zh_CN/element/string.json @@ -72,10 +72,6 @@ "name": "then", "value": "然后" }, - { - "name": "toast", - "value": "提醒:锁屏沉浸实况窗须申请相关权限才可体验" - }, { "name": "Continue", "value": "继续导航" diff --git a/liveviewlockscreensample/build-profile.json5 b/liveviewlockscreensample/build-profile.json5 index b695582d3680556f4cce2ec518f65720a9413ca3..808380f3b726e2036a3d6cf5fb9b0fd9513a8215 100644 --- a/liveviewlockscreensample/build-profile.json5 +++ b/liveviewlockscreensample/build-profile.json5 @@ -20,9 +20,6 @@ "targets": [ { "name": "default" - }, - { - "name": "ohosTest", } ] } \ No newline at end of file diff --git a/liveviewlockscreensample/obfuscation-rules.txt b/liveviewlockscreensample/obfuscation-rules.txt index 46686c4feca708e7a0936210a2ddac65938089c6..272efb6ca3f240859091bbbfc7c5802d52793b0b 100644 --- a/liveviewlockscreensample/obfuscation-rules.txt +++ b/liveviewlockscreensample/obfuscation-rules.txt @@ -19,4 +19,5 @@ -enable-property-obfuscation -enable-toplevel-obfuscation +-enable-filename-obfuscation -enable-export-obfuscation \ No newline at end of file diff --git a/liveviewlockscreensample/oh-package-lock.json5 b/liveviewlockscreensample/oh-package-lock.json5 index 3142a4d186e58aeedd0e4cf7e662f76251746c1e..0246ee2f885578d27fa3f93669b2d81e875c4fae 100644 --- a/liveviewlockscreensample/oh-package-lock.json5 +++ b/liveviewlockscreensample/oh-package-lock.json5 @@ -1,6 +1,7 @@ { "meta": { - "stableOrder": true + "stableOrder": true, + "enableUnifiedLockfile": false }, "lockfileVersion": 3, "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", diff --git a/liveviewlockscreensample/src/main/module.json5 b/liveviewlockscreensample/src/main/module.json5 index ff9557df5d81e97ce64a72087baecec5377f7532..fca9f251ef7a501e5c91610ee798793572429b50 100644 --- a/liveviewlockscreensample/src/main/module.json5 +++ b/liveviewlockscreensample/src/main/module.json5 @@ -1,7 +1,7 @@ { "module": { "name": "liveviewlockscreensample", - "type": "entry", + "type": "feature", "description": "$string:module_desc", "mainElement": "EntryAbility", "deviceTypes": [ @@ -21,7 +21,7 @@ "label": "$string:EntryAbility_label", "startWindowIcon": "$media:startIcon", "startWindowBackground": "$color:start_window_background", - "exported": true, + "exported": false, "backgroundModes": [ 'location' ], @@ -37,7 +37,6 @@ ] } ], - // [Start addLiveViewLockScreenExtensionAbilityName] "extensionAbilities": [ { // Keep it consistent with LiveViewLockScreenExtensionAbility name in live view instance @@ -48,8 +47,6 @@ "exported": false } ], - // [End addLiveViewLockScreenExtensionAbilityName] - // [Start requestPermissions] "requestPermissions": [ { "name": "ohos.permission.KEEP_BACKGROUND_RUNNING", @@ -62,6 +59,5 @@ } }, ], - // [End requestPermissions] } } \ No newline at end of file