crash修改

Signed-off-by: zhengyongjie <15531316327@163.com>
This commit is contained in:
zhengyongjie 2024-09-07 16:01:09 +08:00
parent e5e00fd2a1
commit 2d6a543cbf
3 changed files with 37 additions and 27 deletions

View File

@ -138,9 +138,11 @@ class LayoutConfigManager {
private getTargetTypeConfigs(configType: number) { private getTargetTypeConfigs(configType: number) {
let configArr = new Array<ILayoutConfig>(); let configArr = new Array<ILayoutConfig>();
configArr = configArr.concat(this.mProductConfig[configType]); if (this.mProductConfig[configType] && this.mFeatureConfig[configType] && this.mCommonConfig[configType]) {
configArr = configArr.concat(this.mFeatureConfig[configType]); configArr = configArr.concat(this.mProductConfig[configType]);
configArr = configArr.concat(this.mCommonConfig[configType]); configArr = configArr.concat(this.mFeatureConfig[configType]);
configArr = configArr.concat(this.mCommonConfig[configType]);
}
return configArr; return configArr;
} }
} }

View File

@ -87,13 +87,14 @@ export default class MainAbility extends ServiceExtension {
} }
private registerInputConsumer(): void { private registerInputConsumer(): void {
// register/unregister HOME inputConsumer let onKeyCodeHome = {
inputConsumer.on('key', {
preKeys: [], preKeys: [],
finalKey: KeyCode.KEYCODE_HOME, finalKey: KeyCode.KEYCODE_HOME,
finalKeyDownDuration: 0, finalKeyDownDuration: 0,
isFinalKeyDown: true isFinalKeyDown: true
}, () => { }
// register/unregister HOME inputConsumer
inputConsumer.on('key', onKeyCodeHome, () => {
Log.showInfo(TAG, 'HOME inputConsumer homeEvent start'); Log.showInfo(TAG, 'HOME inputConsumer homeEvent start');
globalThis.desktopContext.startAbility({ globalThis.desktopContext.startAbility({
bundleName: CommonConstants.LAUNCHER_BUNDLE, bundleName: CommonConstants.LAUNCHER_BUNDLE,
@ -106,33 +107,36 @@ export default class MainAbility extends ServiceExtension {
Log.showDebug(TAG, 'HOME inputConsumer startAbility Promise in service failed.'); Log.showDebug(TAG, 'HOME inputConsumer startAbility Promise in service failed.');
}); });
}); });
// register/unregister RECENT inputConsumer let onKeyCodeFunction = {
inputConsumer.on('key', {
preKeys: [], preKeys: [],
finalKey: KeyCode.KEYCODE_FUNCTION, finalKey: KeyCode.KEYCODE_FUNCTION,
finalKeyDownDuration: 0, finalKeyDownDuration: 0,
isFinalKeyDown: true isFinalKeyDown: true
}, () => { }
// register/unregister RECENT inputConsumer
inputConsumer.on('key', onKeyCodeFunction, () => {
Log.showInfo(TAG, 'RECENT inputConsumer recentEvent start'); Log.showInfo(TAG, 'RECENT inputConsumer recentEvent start');
windowManager.createWindowWithName(windowManager.RECENT_WINDOW_NAME, windowManager.RECENT_RANK); windowManager.createWindowWithName(windowManager.RECENT_WINDOW_NAME, windowManager.RECENT_RANK);
}); });
} }
private unregisterInputConsumer(): void { private unregisterInputConsumer(): void {
// unregister HOME inputConsumer let offKeyCodeHome = {
inputConsumer.off('key', {
preKeys: [], preKeys: [],
finalKey: KeyCode.KEYCODE_HOME, finalKey: KeyCode.KEYCODE_HOME,
finalKeyDownDuration: 0, finalKeyDownDuration: 0,
isFinalKeyDown: true isFinalKeyDown: true
}); }
// unregister RECENT inputConsumer // unregister HOME inputConsumer
inputConsumer.off('key', { inputConsumer.off('key', offKeyCodeHome);
let offKeyCodeFunction = {
preKeys: [], preKeys: [],
finalKey: KeyCode.KEYCODE_FUNCTION, finalKey: KeyCode.KEYCODE_FUNCTION,
finalKeyDownDuration: 0, finalKeyDownDuration: 0,
isFinalKeyDown: true isFinalKeyDown: true
}); }
// unregister RECENT inputConsumer
inputConsumer.off('key', offKeyCodeFunction);
} }
private initGlobalConst(): void { private initGlobalConst(): void {

View File

@ -89,13 +89,14 @@ export default class MainAbility extends ServiceExtension {
} }
private registerInputConsumer(): void { private registerInputConsumer(): void {
// register/unregister HOME inputConsumer let onKeyCodeHome = {
inputConsumer.on('key', {
preKeys: [], preKeys: [],
finalKey: KeyCode.KEYCODE_HOME, finalKey: KeyCode.KEYCODE_HOME,
finalKeyDownDuration: 0, finalKeyDownDuration: 0,
isFinalKeyDown: true isFinalKeyDown: true
}, () => { }
// register/unregister HOME inputConsumer
inputConsumer.on('key', onKeyCodeHome, () => {
Log.showInfo(TAG, 'HOME inputConsumer homeEvent start'); Log.showInfo(TAG, 'HOME inputConsumer homeEvent start');
globalThis.desktopContext.startAbility({ globalThis.desktopContext.startAbility({
bundleName: CommonConstants.LAUNCHER_BUNDLE, bundleName: CommonConstants.LAUNCHER_BUNDLE,
@ -108,33 +109,36 @@ export default class MainAbility extends ServiceExtension {
Log.showDebug(TAG, 'HOME inputConsumer startAbility Promise in service failed.'); Log.showDebug(TAG, 'HOME inputConsumer startAbility Promise in service failed.');
}); });
}); });
// register/unregister RECENT inputConsumer let onKeyCodeFunction = {
inputConsumer.on('key', {
preKeys: [], preKeys: [],
finalKey: KeyCode.KEYCODE_FUNCTION, finalKey: KeyCode.KEYCODE_FUNCTION,
finalKeyDownDuration: 0, finalKeyDownDuration: 0,
isFinalKeyDown: true isFinalKeyDown: true
}, () => { }
// register/unregister RECENT inputConsumer
inputConsumer.on('key', onKeyCodeFunction, () => {
Log.showInfo(TAG, 'RECENT inputConsumer recentEvent start'); Log.showInfo(TAG, 'RECENT inputConsumer recentEvent start');
windowManager.createWindowWithName(windowManager.RECENT_WINDOW_NAME, windowManager.RECENT_RANK); windowManager.createWindowWithName(windowManager.RECENT_WINDOW_NAME, windowManager.RECENT_RANK);
}); });
} }
private unregisterInputConsumer(): void { private unregisterInputConsumer(): void {
// unregister HOME inputConsumer let offKeyCodeHome = {
inputConsumer.off('key', {
preKeys: [], preKeys: [],
finalKey: KeyCode.KEYCODE_HOME, finalKey: KeyCode.KEYCODE_HOME,
finalKeyDownDuration: 0, finalKeyDownDuration: 0,
isFinalKeyDown: true isFinalKeyDown: true
}); }
// unregister RECENT inputConsumer // unregister HOME inputConsumer
inputConsumer.off('key', { inputConsumer.off('key', offKeyCodeHome);
let offKeyCodeFunction = {
preKeys: [], preKeys: [],
finalKey: KeyCode.KEYCODE_FUNCTION, finalKey: KeyCode.KEYCODE_FUNCTION,
finalKeyDownDuration: 0, finalKeyDownDuration: 0,
isFinalKeyDown: true isFinalKeyDown: true
}); }
// unregister RECENT inputConsumer
inputConsumer.off('key', offKeyCodeFunction);
} }
private initGlobalConst(): void { private initGlobalConst(): void {