|
@@ -63,6 +63,11 @@ class EmptyRpcParcelable implements rpc.Parcelable {
|
|
|
* - 事件分发
|
|
* - 事件分发
|
|
|
*/
|
|
*/
|
|
|
export default class EntryAbility extends UIAbility {
|
|
export default class EntryAbility extends UIAbility {
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 处理音乐卡片通过 callee/call 方式发来的控制请求。
|
|
|
|
|
+ * 这里会从 RPC 文本中解析动作、来源、卡片实例和拖动进度,
|
|
|
|
|
+ * 记录卡片实例后再把动作转发到统一的播放控制分发入口。
|
|
|
|
|
+ */
|
|
|
private readonly musicCardCallHandler = (data: rpc.MessageSequence): rpc.Parcelable => {
|
|
private readonly musicCardCallHandler = (data: rpc.MessageSequence): rpc.Parcelable => {
|
|
|
try {
|
|
try {
|
|
|
const rawText: string = data.readString() ?? '';
|
|
const rawText: string = data.readString() ?? '';
|
|
@@ -84,6 +89,11 @@ export default class EntryAbility extends UIAbility {
|
|
|
}
|
|
}
|
|
|
return new EmptyRpcParcelable();
|
|
return new EmptyRpcParcelable();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 处理应用内 eventHub 转发过来的音乐卡片控制事件。
|
|
|
|
|
+ * 该入口主要服务于运行时已启动的播放器场景,按动作直接调用播放器控制器。
|
|
|
|
|
+ */
|
|
|
private readonly musicCardActionForwardHandler = (data?: Object): void => {
|
|
private readonly musicCardActionForwardHandler = (data?: Object): void => {
|
|
|
const payloadText: string = data ? JSON.stringify(data) : '';
|
|
const payloadText: string = data ? JSON.stringify(data) : '';
|
|
|
const action = this.resolveMusicCardActionFromText(payloadText);
|
|
const action = this.resolveMusicCardActionFromText(payloadText);
|
|
@@ -122,13 +132,10 @@ export default class EntryAbility extends UIAbility {
|
|
|
// private awareness: smartMobilityCommon.SmartMobilityAwareness = smartMobilityCommon.getSmartMobilityAwareness();
|
|
// private awareness: smartMobilityCommon.SmartMobilityAwareness = smartMobilityCommon.getSmartMobilityAwareness();
|
|
|
// private awareness: smartMobilityCommon.SmartMobilityAwareness|undefined = canIUse("SystemCapability.CarService.DistributedEngine")?smartMobilityCommon.getSmartMobilityAwareness():undefined;
|
|
// private awareness: smartMobilityCommon.SmartMobilityAwareness|undefined = canIUse("SystemCapability.CarService.DistributedEngine")?smartMobilityCommon.getSmartMobilityAwareness():undefined;
|
|
|
private awareness?: smartMobilityCommon.SmartMobilityAwareness;//修复api23 报错问题
|
|
private awareness?: smartMobilityCommon.SmartMobilityAwareness;//修复api23 报错问题
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
- * 窗口尺寸变化回调函数
|
|
|
|
|
- * @param windowSize 新的窗口尺寸对象
|
|
|
|
|
- * 功能:
|
|
|
|
|
- * 1. 获取最新的窗口断点尺寸
|
|
|
|
|
- * 2. 更新AppStorage中的尺寸状态
|
|
|
|
|
- * 3. 记录尺寸变化日志
|
|
|
|
|
|
|
+ * 主窗口尺寸变化时同步更新全局窗口状态。
|
|
|
|
|
+ * 包括宽高断点、实际尺寸以及横竖屏标记,供页面响应式布局读取。
|
|
|
*/
|
|
*/
|
|
|
private onWindowSizeChange: (windowSize: window.Size) => void = async (windowSize: window.Size) => {
|
|
private onWindowSizeChange: (windowSize: window.Size) => void = async (windowSize: window.Size) => {
|
|
|
// 获取宽度断点并更新全局状态
|
|
// 获取宽度断点并更新全局状态
|
|
@@ -154,7 +161,10 @@ export default class EntryAbility extends UIAbility {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 监听系统避让区域变化,并把状态栏/导航条高度写入全局存储。
|
|
|
|
|
+ * 页面可以据此修正顶部和底部安全区域占位。
|
|
|
|
|
+ */
|
|
|
onAvoidAreaChange = (data: window.AvoidAreaOptions) => {
|
|
onAvoidAreaChange = (data: window.AvoidAreaOptions) => {
|
|
|
if (data.type === window.AvoidAreaType.TYPE_SYSTEM) {
|
|
if (data.type === window.AvoidAreaType.TYPE_SYSTEM) {
|
|
|
let topRectHeight = px2vp(data.area.topRect.height);
|
|
let topRectHeight = px2vp(data.area.topRect.height);
|
|
@@ -165,6 +175,11 @@ export default class EntryAbility extends UIAbility {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 监听窗口显示设备变化,识别当前窗口是否切换到 HiCar 等车机场景。
|
|
|
|
|
+ * 结果会同步到 AppStorage,供界面和播放策略判断使用。
|
|
|
|
|
+ */
|
|
|
onDisplayIdChange=(displayId: number)=> {
|
|
onDisplayIdChange=(displayId: number)=> {
|
|
|
let curDisplay = display.getDisplayByIdSync(displayId);
|
|
let curDisplay = display.getDisplayByIdSync(displayId);
|
|
|
console.info('twocold curDisplay 2 = '+curDisplay.name);
|
|
console.info('twocold curDisplay 2 = '+curDisplay.name);
|
|
@@ -174,6 +189,11 @@ export default class EntryAbility extends UIAbility {
|
|
|
this.logHiCar('info', `curDisplayIsHiCar=${isHiCarDisplay}`);
|
|
this.logHiCar('info', `curDisplayIsHiCar=${isHiCarDisplay}`);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Ability 首次创建时执行应用级初始化。
|
|
|
|
|
+ * 这里会建立上下文、初始化偏好与后台播放宿主、注册音乐卡片控制入口,
|
|
|
|
|
+ * 同时处理冷启动 Want、分享拉起、WebDAV 初始化和 HiCar 状态读取。
|
|
|
|
|
+ */
|
|
|
async onCreate(want:Want, launchParam:AbilityConstant.LaunchParam) {
|
|
async onCreate(want:Want, launchParam:AbilityConstant.LaunchParam) {
|
|
|
AppUtil.init(this.context);
|
|
AppUtil.init(this.context);
|
|
|
AppStorage.setOrCreate('context', this.context);
|
|
AppStorage.setOrCreate('context', this.context);
|
|
@@ -208,12 +228,8 @@ export default class EntryAbility extends UIAbility {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 初始化WebDAV管理器
|
|
|
|
|
- * 功能:
|
|
|
|
|
- * 1. 设置Context
|
|
|
|
|
- * 2. 初始化数据库和Preferences
|
|
|
|
|
- * 3. 创建WebDAV数据库表
|
|
|
|
|
- * 4. 加载WebDAV账户信息
|
|
|
|
|
|
|
+ * 初始化 WebDAV 相关基础设施。
|
|
|
|
|
+ * 包括数据库上下文注入、RemoteDriveManager 初始化、建表、账户恢复和历史数据加载。
|
|
|
*/
|
|
*/
|
|
|
private async initWebDAV() {
|
|
private async initWebDAV() {
|
|
|
try {
|
|
try {
|
|
@@ -248,6 +264,10 @@ export default class EntryAbility extends UIAbility {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Ability 已存在时处理新的 Want。
|
|
|
|
|
+ * 该流程会重复必要初始化,并重新分发卡片动作、外部 URI、分享数据等入口事件。
|
|
|
|
|
+ */
|
|
|
async onNewWant(want: Want, launchParam: AbilityConstant.LaunchParam): Promise<void> {
|
|
async onNewWant(want: Want, launchParam: AbilityConstant.LaunchParam): Promise<void> {
|
|
|
hilog.info(0x0000, 'testTag', `onNewWant, want=${JSON.stringify(want)}`);
|
|
hilog.info(0x0000, 'testTag', `onNewWant, want=${JSON.stringify(want)}`);
|
|
|
super.onNewWant(want, launchParam);
|
|
super.onNewWant(want, launchParam);
|
|
@@ -266,6 +286,10 @@ export default class EntryAbility extends UIAbility {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 从 Want 参数中提取音乐卡片动作并进行统一分发。
|
|
|
|
|
+ * 如果该动作会被 call 通道优先处理,则在这里直接忽略,避免重复执行。
|
|
|
|
|
+ */
|
|
|
private handleMusicCardActionFromWant(want: Want): void {
|
|
private handleMusicCardActionFromWant(want: Want): void {
|
|
|
const parameters = want.parameters as Object | undefined;
|
|
const parameters = want.parameters as Object | undefined;
|
|
|
if (parameters === undefined) {
|
|
if (parameters === undefined) {
|
|
@@ -290,6 +314,10 @@ export default class EntryAbility extends UIAbility {
|
|
|
this.dispatchMusicCardAction(action, 'want', seekPositionMs);
|
|
this.dispatchMusicCardAction(action, 'want', seekPositionMs);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 根据动作类型把音乐卡片控制命令路由到前台运行时或后台播放宿主。
|
|
|
|
|
+ * 支持播放/暂停、上一首、下一首、打开播放器以及拖动进度等动作。
|
|
|
|
|
+ */
|
|
|
private dispatchMusicCardAction(action: string, source: string, seekPositionMs: string = ''): void {
|
|
private dispatchMusicCardAction(action: string, source: string, seekPositionMs: string = ''): void {
|
|
|
Logger.info('EntryAbility', `[MusicCast] dispatch action=${action}, source=${source}, seek=${seekPositionMs}`);
|
|
Logger.info('EntryAbility', `[MusicCast] dispatch action=${action}, source=${source}, seek=${seekPositionMs}`);
|
|
|
const playbackController: MusicPlaybackController = MusicPlaybackController.getInstance();
|
|
const playbackController: MusicPlaybackController = MusicPlaybackController.getInstance();
|
|
@@ -347,6 +375,9 @@ export default class EntryAbility extends UIAbility {
|
|
|
Logger.warn('EntryAbility', `[MusicCast] action ignored unsupported action=${action}, source=${source}`);
|
|
Logger.warn('EntryAbility', `[MusicCast] action ignored unsupported action=${action}, source=${source}`);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 注册音乐卡片 call 通道处理器,使卡片能够通过 callee 接口直接控制播放。
|
|
|
|
|
+ */
|
|
|
private registerMusicCardCallHandler(): void {
|
|
private registerMusicCardCallHandler(): void {
|
|
|
try {
|
|
try {
|
|
|
this.callee.on(MusicCardActionConstants.CALL_METHOD_HANDLE_ACTION, this.musicCardCallHandler);
|
|
this.callee.on(MusicCardActionConstants.CALL_METHOD_HANDLE_ACTION, this.musicCardCallHandler);
|
|
@@ -356,6 +387,9 @@ export default class EntryAbility extends UIAbility {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 注销音乐卡片 call 通道处理器,避免 Ability 销毁后仍残留调用入口。
|
|
|
|
|
+ */
|
|
|
private unregisterMusicCardCallHandler(): void {
|
|
private unregisterMusicCardCallHandler(): void {
|
|
|
try {
|
|
try {
|
|
|
this.callee.off(MusicCardActionConstants.CALL_METHOD_HANDLE_ACTION);
|
|
this.callee.off(MusicCardActionConstants.CALL_METHOD_HANDLE_ACTION);
|
|
@@ -365,6 +399,10 @@ export default class EntryAbility extends UIAbility {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 当动作来源确认为桌面卡片时,登记对应的卡片实例 ID。
|
|
|
|
|
+ * 这样后续播放器状态变更时可以正确回推到对应卡片。
|
|
|
|
|
+ */
|
|
|
private registerMusicCardFormIdIfNeeded(formId: string, source: string): void {
|
|
private registerMusicCardFormIdIfNeeded(formId: string, source: string): void {
|
|
|
if (source !== MusicCardActionConstants.ACTION_SOURCE_WIDGET) {
|
|
if (source !== MusicCardActionConstants.ACTION_SOURCE_WIDGET) {
|
|
|
return;
|
|
return;
|
|
@@ -375,6 +413,10 @@ export default class EntryAbility extends UIAbility {
|
|
|
MusicCardFormStore.addFormId(this.context, formId);
|
|
MusicCardFormStore.addFormId(this.context, formId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 从文本化参数中解析音乐卡片动作字段。
|
|
|
|
|
+ * 解析失败或字段缺失时返回空字符串。
|
|
|
|
|
+ */
|
|
|
private resolveMusicCardActionFromText(payloadText: string): string {
|
|
private resolveMusicCardActionFromText(payloadText: string): string {
|
|
|
if (StrUtil.isEmpty(payloadText)) {
|
|
if (StrUtil.isEmpty(payloadText)) {
|
|
|
return '';
|
|
return '';
|
|
@@ -386,6 +428,9 @@ export default class EntryAbility extends UIAbility {
|
|
|
return match[1];
|
|
return match[1];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 从文本化参数中解析动作来源字段,用于区分 widget、call 等入口。
|
|
|
|
|
+ */
|
|
|
private resolveMusicCardSourceFromText(payloadText: string): string {
|
|
private resolveMusicCardSourceFromText(payloadText: string): string {
|
|
|
if (StrUtil.isEmpty(payloadText)) {
|
|
if (StrUtil.isEmpty(payloadText)) {
|
|
|
return '';
|
|
return '';
|
|
@@ -397,6 +442,9 @@ export default class EntryAbility extends UIAbility {
|
|
|
return match[1];
|
|
return match[1];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 从文本化参数中解析卡片 formId,兼容字符串和数字两种序列化形式。
|
|
|
|
|
+ */
|
|
|
private resolveMusicCardFormIdFromText(payloadText: string): string {
|
|
private resolveMusicCardFormIdFromText(payloadText: string): string {
|
|
|
if (StrUtil.isEmpty(payloadText)) {
|
|
if (StrUtil.isEmpty(payloadText)) {
|
|
|
return '';
|
|
return '';
|
|
@@ -412,6 +460,9 @@ export default class EntryAbility extends UIAbility {
|
|
|
return '';
|
|
return '';
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 从文本化参数中解析 seek 目标位置,兼容字符串和数字两种格式。
|
|
|
|
|
+ */
|
|
|
private resolveMusicCardSeekPositionFromText(payloadText: string): string {
|
|
private resolveMusicCardSeekPositionFromText(payloadText: string): string {
|
|
|
if (StrUtil.isEmpty(payloadText)) {
|
|
if (StrUtil.isEmpty(payloadText)) {
|
|
|
return '';
|
|
return '';
|
|
@@ -427,6 +478,10 @@ export default class EntryAbility extends UIAbility {
|
|
|
return '';
|
|
return '';
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 按当前播放器运行状态决定打开方式。
|
|
|
|
|
+ * 如果前台播放器已可直接展示,则唤起播放器页,否则请求后台恢复后打开。
|
|
|
|
|
+ */
|
|
|
private routeToMusicPlayerPage(): void {
|
|
private routeToMusicPlayerPage(): void {
|
|
|
const openRoute = PlaybackRestoreCoordinator.resolveMusicCardOpenRoute(
|
|
const openRoute = PlaybackRestoreCoordinator.resolveMusicCardOpenRoute(
|
|
|
PlaybackCoordinator.getInstance().hasRuntime()
|
|
PlaybackCoordinator.getInstance().hasRuntime()
|
|
@@ -438,11 +493,17 @@ export default class EntryAbility extends UIAbility {
|
|
|
requestPlaybackPlayerOpen();
|
|
requestPlaybackPlayerOpen();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 处理微信等第三方通过 Want 拉起应用时的回调数据。
|
|
|
|
|
+ */
|
|
|
private handleWeChatCallIfNeed(want: Want) {
|
|
private handleWeChatCallIfNeed(want: Want) {
|
|
|
WXApi.handleWant(want, WXEventHandler)
|
|
WXApi.handleWant(want, WXEventHandler)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //处理其他app点击其他应用打开播放器播放视频或者音频
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 处理其他应用通过 URI 拉起本应用的场景。
|
|
|
|
|
+ * 当 Want 中带有可播放媒体地址时,继续向应用内广播打开事件。
|
|
|
|
|
+ */
|
|
|
loadDoWant(want: Want){
|
|
loadDoWant(want: Want){
|
|
|
// console.info('onecold KnockController 碰一碰 want ='+JSON.stringify(want));
|
|
// console.info('onecold KnockController 碰一碰 want ='+JSON.stringify(want));
|
|
|
let uri = want.uri;
|
|
let uri = want.uri;
|
|
@@ -454,7 +515,11 @@ export default class EntryAbility extends UIAbility {
|
|
|
|
|
|
|
|
this.doSendEmit(uri)
|
|
this.doSendEmit(uri)
|
|
|
}
|
|
}
|
|
|
- //广播通知打开播放器播放视频或者音频
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 根据 URI 媒体类型发送应用内广播,通知播放器打开音频或视频资源。
|
|
|
|
|
+ * 这里使用短延时,给前台页面和订阅方留出初始化时间。
|
|
|
|
|
+ */
|
|
|
doSendEmit(uri:string){
|
|
doSendEmit(uri:string){
|
|
|
setTimeout(async ()=>{
|
|
setTimeout(async ()=>{
|
|
|
let eventData: emitter.EventData = {
|
|
let eventData: emitter.EventData = {
|
|
@@ -471,8 +536,10 @@ export default class EntryAbility extends UIAbility {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 华为分享拉起接收 处理分享数据
|
|
|
|
|
- // 1. 改造 handleParam 为异步函数,让其返回 Promise
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 处理华为系统分享拉起的数据。
|
|
|
|
|
+ * 从分享记录中提取 URI 后转发给统一的媒体打开广播入口。
|
|
|
|
|
+ */
|
|
|
async handleParam(want: Want) {
|
|
async handleParam(want: Want) {
|
|
|
try {
|
|
try {
|
|
|
// 通过 await 等待异步操作完成
|
|
// 通过 await 等待异步操作完成
|
|
@@ -492,6 +559,9 @@ export default class EntryAbility extends UIAbility {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Ability 销毁时清理注册的事件、卡片 call 处理器以及智慧出行状态监听。
|
|
|
|
|
+ */
|
|
|
onDestroy() {
|
|
onDestroy() {
|
|
|
try {
|
|
try {
|
|
|
this.context.eventHub?.off('musicCardActionForward', this.musicCardActionForwardHandler);
|
|
this.context.eventHub?.off('musicCardActionForward', this.musicCardActionForwardHandler);
|
|
@@ -513,6 +583,10 @@ export default class EntryAbility extends UIAbility {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 主窗口创建完成后初始化窗口级状态。
|
|
|
|
|
+ * 包括全屏布局、避让区域监听、显示设备识别、断点尺寸同步以及首页内容加载。
|
|
|
|
|
+ */
|
|
|
onWindowStageCreate(windowStage: window.WindowStage) {
|
|
onWindowStageCreate(windowStage: window.WindowStage) {
|
|
|
// Main window is created, set main page for this ability
|
|
// Main window is created, set main page for this ability
|
|
|
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate');
|
|
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate');
|
|
@@ -597,22 +671,35 @@ export default class EntryAbility extends UIAbility {
|
|
|
DemoConstants.windowStage = windowStage
|
|
DemoConstants.windowStage = windowStage
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 主窗口销毁时触发,用于记录窗口生命周期结束。
|
|
|
|
|
+ */
|
|
|
onWindowStageDestroy() {
|
|
onWindowStageDestroy() {
|
|
|
// Main window is destroyed, release UI related resources
|
|
// Main window is destroyed, release UI related resources
|
|
|
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy');
|
|
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Ability 回到前台时触发。
|
|
|
|
|
+ */
|
|
|
onForeground() {
|
|
onForeground() {
|
|
|
// Ability has brought to foreground
|
|
// Ability has brought to foreground
|
|
|
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground');
|
|
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Ability 进入后台时触发。
|
|
|
|
|
+ */
|
|
|
onBackground() {
|
|
onBackground() {
|
|
|
// Ability has back to background
|
|
// Ability has back to background
|
|
|
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground');
|
|
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 查询并监听 HiCar 连接状态。
|
|
|
|
|
+ * 初始化时会读取当前状态并注册监听;当车机断开时会同步更新全局状态并触发播放相关广播。
|
|
|
|
|
+ */
|
|
|
getHiCarStatus(){
|
|
getHiCarStatus(){
|
|
|
try {
|
|
try {
|
|
|
if (!this.awareness){
|
|
if (!this.awareness){
|
|
@@ -671,12 +758,17 @@ export default class EntryAbility extends UIAbility {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //发送广播通知更新UI
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 发送设置变更广播,通知相关页面刷新 UI 状态。
|
|
|
|
|
+ */
|
|
|
sendChangeEvent() {
|
|
sendChangeEvent() {
|
|
|
const eventData: emitter.EventData = {};
|
|
const eventData: emitter.EventData = {};
|
|
|
emitter.emit({ eventId: EventConstants.EVENT_SETTING_UPDATE }, eventData); // 发送广播通知更新doSwipBack
|
|
emitter.emit({ eventId: EventConstants.EVENT_SETTING_UPDATE }, eventData); // 发送广播通知更新doSwipBack
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 统一输出 HiCar 状态相关服务端日志。
|
|
|
|
|
+ */
|
|
|
private logHiCar(level: 'info' | 'warn' | 'error' | 'debug', message: string) {
|
|
private logHiCar(level: 'info' | 'warn' | 'error' | 'debug', message: string) {
|
|
|
const tag = 'HiCarStatus';
|
|
const tag = 'HiCarStatus';
|
|
|
switch (level) {
|
|
switch (level) {
|
|
@@ -697,6 +789,9 @@ export default class EntryAbility extends UIAbility {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 统一输出网盘/WebDAV 初始化相关服务端日志。
|
|
|
|
|
+ */
|
|
|
private logNetDisk(level: 'info' | 'warn' | 'error', message: string) {
|
|
private logNetDisk(level: 'info' | 'warn' | 'error', message: string) {
|
|
|
const tag = 'NetDiskInit';
|
|
const tag = 'NetDiskInit';
|
|
|
switch (level) {
|
|
switch (level) {
|