xugenyuan

ref |> 启动性能优化2

1、调整个推、启动取匿名手机号登逻辑

2、调整部分log

Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
... ... @@ -18,7 +18,6 @@ export class AppUtils {
AppUtils.buildBuildModeName = BuildProfile.BUILD_MODE_NAME;
Logger.isDebug = !AppUtils.isProductRELEASE()
// Logger.isDebug = false
}
public static isProductRELEASE() {
... ...
... ... @@ -20,7 +20,7 @@ export class KVStoreHelper {
}
static init(context: Context) {
Logger.error(TAG, 'init')
Logger.debug(TAG, 'init')
KVStoreHelper._context = context;
KVStoreHelper.default.createKVManager()
KVStoreHelper.default.createKVStore()
... ...
... ... @@ -28,7 +28,7 @@ export class Logger {
*/
private static CHUNK_SIZE: number = 3500;
static isDebug: boolean = true;
static isCloseOptimzied: boolean = true;
static isCloseOptimzied: boolean = false; // 正常用false,打开是为了暴露性能问题
/**
* constructor.
... ...
... ... @@ -53,7 +53,9 @@ export class PlayViewModel {
return
}
Logger.info(TAG, JSON.stringify(data))
Logger.infoOptimize(TAG, () => {
return JSON.stringify(data)
})
this.newsTitle = data.newsTitle
this.editorName = data.editorName
this.newsSummary = data.newsSummary
... ... @@ -87,7 +89,9 @@ export class PlayViewModel {
}
let contentDetailDTO: ContentDetailDTO = resDTO.data[0]
Logger.info(TAG, JSON.stringify(contentDetailDTO))
Logger.infoOptimize(TAG, () => {
return JSON.stringify(contentDetailDTO)
})
this.newsTitle = contentDetailDTO.newsTitle
this.editorName = contentDetailDTO.editorName
this.newsSummary = contentDetailDTO.newsSummary
... ...
... ... @@ -146,7 +146,9 @@ export class GetuiPush {
},
//命令相应回复
onReceiveCommandResult: (result: GTCmdMessage) => {
Logger.debug(TAG, "推送 Cmd Message = " + JSON.stringify(result))
Logger.debugOptimize(TAG, () => {
return "推送 Cmd Message = " + JSON.stringify(result)
})
this.dealWithCmdMessage(result)
},
//sdk 收到透传消息
... ...
... ... @@ -256,7 +256,9 @@ export class VoiceRecoginizer {
}
async AsrInit(path:string, filePath:string): Promise<number> {
//console.log("AsrInit this is " + JSON.stringify(this))
Logger.debugOptimize(TAG, () => {
return "AsrInit this is " + JSON.stringify(this)
})
// console.info("AsrInit path: " + path);
//获取工作路径, 这里获得当前nuisdk.aar中assets路径
... ...
... ... @@ -41,11 +41,12 @@ export class LoginModule {
HuaweiAuth.sharedInstance().registerEvents()
AccountManagerUtils.isLogin().then((login) => {
if (!login) {
HuaweiAuth.sharedInstance().rePrefetchAnonymousPhone()
}
})
// 这里启动不在预先取匿名手机号
// AccountManagerUtils.isLogin().then((login) => {
// if (!login) {
// HuaweiAuth.sharedInstance().rePrefetchAnonymousPhone()
// }
// })
RouterJumpInterceptor.register(WDRouterPage.loginPage, new LoginJumpHandler())
}
... ...
... ... @@ -126,9 +126,11 @@ export class StartupManager {
this.initSensorData()
setTimeout(() => {
this.initTingyun()
this.initGeTuiPush()
}, 1000)
this.initUmengStat()
... ...