Showing
3 changed files
with
10 additions
and
5 deletions
| @@ -4,7 +4,7 @@ import UIAbility from '@ohos.app.ability.UIAbility'; | @@ -4,7 +4,7 @@ import UIAbility from '@ohos.app.ability.UIAbility'; | ||
| 4 | import Want from '@ohos.app.ability.Want'; | 4 | import Want from '@ohos.app.ability.Want'; |
| 5 | import window from '@ohos.window'; | 5 | import window from '@ohos.window'; |
| 6 | import { BusinessError } from '@ohos.base'; | 6 | import { BusinessError } from '@ohos.base'; |
| 7 | -import { DeviceUtil, EmitterEventId, EmitterUtils, Logger, WindowModel } from 'wdKit'; | 7 | +import { DeviceUtil, EmitterEventId, EmitterUtils, Logger, SPHelper, WindowModel } from 'wdKit'; |
| 8 | import { ConfigurationConstant } from '@kit.AbilityKit'; | 8 | import { ConfigurationConstant } from '@kit.AbilityKit'; |
| 9 | import { StartupManager } from '../startupmanager/StartupManager'; | 9 | import { StartupManager } from '../startupmanager/StartupManager'; |
| 10 | 10 | ||
| @@ -14,6 +14,10 @@ const TAG = 'EntryAbility' | @@ -14,6 +14,10 @@ const TAG = 'EntryAbility' | ||
| 14 | export default class EntryAbility extends UIAbility { | 14 | export default class EntryAbility extends UIAbility { |
| 15 | onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { | 15 | onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { |
| 16 | StartupManager.sharedInstance().appOnCreate(want, launchParam, this.context) | 16 | StartupManager.sharedInstance().appOnCreate(want, launchParam, this.context) |
| 17 | + if (SPHelper.default.getSync('isPrivacy', true)) { | ||
| 18 | + // 同意隐私协议,这里直接初始化。TODO 耗时梳理 | ||
| 19 | + StartupManager.sharedInstance().appAgreedProtocol() | ||
| 20 | + } | ||
| 17 | Logger.info(TAG, 'Ability onCreate'); | 21 | Logger.info(TAG, 'Ability onCreate'); |
| 18 | 22 | ||
| 19 | // 还没深色模式需求,暂直接不跟随系统。 | 23 | // 还没深色模式需求,暂直接不跟随系统。 |
| @@ -97,8 +97,8 @@ struct LaunchPage { | @@ -97,8 +97,8 @@ struct LaunchPage { | ||
| 97 | this.dialogController.open(); | 97 | this.dialogController.open(); |
| 98 | // } | 98 | // } |
| 99 | } else { | 99 | } else { |
| 100 | - | ||
| 101 | - StartupManager.sharedInstance().appAgreedProtocol() | 100 | + // 挪到ability里处理了。 |
| 101 | + // StartupManager.sharedInstance().appAgreedProtocol() | ||
| 102 | 102 | ||
| 103 | //需要根据请求数据判断是否需要进入广告页,广告数据为nil则直接跳转到首页 | 103 | //需要根据请求数据判断是否需要进入广告页,广告数据为nil则直接跳转到首页 |
| 104 | //获取本地存储的启动页数据 | 104 | //获取本地存储的启动页数据 |
| @@ -90,13 +90,14 @@ export class StartupManager { | @@ -90,13 +90,14 @@ export class StartupManager { | ||
| 90 | Logger.debug(TAG, "App 已同意隐私等协议,开始必要初始化") | 90 | Logger.debug(TAG, "App 已同意隐私等协议,开始必要初始化") |
| 91 | this.initCheckDeviceId() | 91 | this.initCheckDeviceId() |
| 92 | 92 | ||
| 93 | + this.initNetwork() | ||
| 94 | + | ||
| 93 | this.initMpaas() | 95 | this.initMpaas() |
| 96 | + | ||
| 94 | this.initSensorData() | 97 | this.initSensorData() |
| 95 | 98 | ||
| 96 | this.initTingyun() | 99 | this.initTingyun() |
| 97 | 100 | ||
| 98 | - this.initNetwork() | ||
| 99 | - | ||
| 100 | this.initGeTuiPush() | 101 | this.initGeTuiPush() |
| 101 | 102 | ||
| 102 | this.initUmengStat() | 103 | this.initUmengStat() |
-
Please register or login to post a comment