!533 字串整改

Merge pull request !533 from zhengyongjie/master
This commit is contained in:
openharmony_ci 2024-06-24 06:44:30 +00:00 committed by Gitee
commit ef0749afb6
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
18 changed files with 108 additions and 110 deletions

View File

@ -12,7 +12,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import Prompt from '@ohos.promptAction';
import windowAnimationManager from '@ohos.animation.windowAnimationManager';
import { CheckEmptyUtils } from '../../utils/CheckEmptyUtils';
import { Log } from '../../utils/Log';
@ -24,7 +23,7 @@ class WindowAnimationControllerImpl implements windowAnimationManager.WindowAnim
onStartAppFromLauncher(startingWindowTarget: windowAnimationManager.WindowAnimationTarget,
finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void
{
Log.showInfo(TAG, `remote window animaion onStartAppFromLauncher`);
Log.showInfo(TAG, 'remote window animaion onStartAppFromLauncher');
this.setRemoteAnimation(startingWindowTarget, null, finishCallback, RemoteConstants.TYPE_START_APP_FROM_LAUNCHER);
this.printfTarget(startingWindowTarget);
finishCallback.onAnimationFinish();
@ -32,7 +31,7 @@ class WindowAnimationControllerImpl implements windowAnimationManager.WindowAnim
onStartAppFromRecent(startingWindowTarget: windowAnimationManager.WindowAnimationTarget,
finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void {
Log.showInfo(TAG, `remote window animaion onStartAppFromRecent`);
Log.showInfo(TAG, 'remote window animaion onStartAppFromRecent');
this.setRemoteAnimation(startingWindowTarget, null, finishCallback, RemoteConstants.TYPE_START_APP_FROM_RECENT);
this.printfTarget(startingWindowTarget);
finishCallback.onAnimationFinish();
@ -40,7 +39,7 @@ class WindowAnimationControllerImpl implements windowAnimationManager.WindowAnim
onStartAppFromOther(startingWindowTarget: windowAnimationManager.WindowAnimationTarget,
finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void {
Log.showInfo(TAG, `remote window animaion onStartAppFromOther`);
Log.showInfo(TAG, 'remote window animaion onStartAppFromOther');
this.setRemoteAnimation(startingWindowTarget, null, finishCallback, RemoteConstants.TYPE_START_APP_FROM_OTHER);
this.printfTarget(startingWindowTarget);
finishCallback.onAnimationFinish();
@ -49,7 +48,7 @@ class WindowAnimationControllerImpl implements windowAnimationManager.WindowAnim
onAppTransition(fromWindowTarget: windowAnimationManager.WindowAnimationTarget,
toWindowTarget: windowAnimationManager.WindowAnimationTarget,
finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void{
Log.showInfo(TAG, `remote window animaion onAppTransition`);
Log.showInfo(TAG, 'remote window animaion onAppTransition');
this.setRemoteAnimation(toWindowTarget, fromWindowTarget, finishCallback, RemoteConstants.TYPE_APP_TRANSITION);
this.printfTarget(fromWindowTarget);
this.printfTarget(toWindowTarget);
@ -58,7 +57,7 @@ class WindowAnimationControllerImpl implements windowAnimationManager.WindowAnim
onMinimizeWindow(minimizingWindowTarget: windowAnimationManager.WindowAnimationTarget,
finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void {
Log.showInfo(TAG, `remote window animaion onMinimizeWindow`);
Log.showInfo(TAG, 'remote window animaion onMinimizeWindow');
this.setRemoteAnimation(null, minimizingWindowTarget, finishCallback, RemoteConstants.TYPE_MINIMIZE_WINDOW);
this.printfTarget(minimizingWindowTarget);
finishCallback.onAnimationFinish();
@ -66,14 +65,14 @@ class WindowAnimationControllerImpl implements windowAnimationManager.WindowAnim
onCloseWindow(closingWindowTarget: windowAnimationManager.WindowAnimationTarget,
finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void {
Log.showInfo(TAG, `remote window animaion onCloseWindow`);
Log.showInfo(TAG, 'remote window animaion onCloseWindow');
this.setRemoteAnimation(null, closingWindowTarget, finishCallback, RemoteConstants.TYPE_CLOSE_WINDOW);
this.printfTarget(closingWindowTarget);
finishCallback.onAnimationFinish();
}
onScreenUnlock(finishCallback: windowAnimationManager.WindowAnimationFinishedCallback): void {
Log.showInfo(TAG, `remote window animaion onScreenUnlock`);
Log.showInfo(TAG, 'remote window animaion onScreenUnlock');
this.setRemoteAnimation(null, null, finishCallback, RemoteConstants.TYPE_SCREEN_UNLOCK);
finishCallback.onAnimationFinish();
}
@ -82,7 +81,7 @@ class WindowAnimationControllerImpl implements windowAnimationManager.WindowAnim
printfTarget(target: windowAnimationManager.WindowAnimationTarget): void {
if (CheckEmptyUtils.isEmpty(target) || CheckEmptyUtils.isEmpty(target.windowBounds)) {
Log.showInfo(TAG, `remote window animaion with invalid target`);
Log.showInfo(TAG, 'remote window animaion with invalid target');
return;
}
Log.showInfo(TAG, `remote window animaion bundleName: ${target.bundleName} abilityName: ${target.abilityName}`);
@ -110,4 +109,4 @@ class WindowAnimationControllerImpl implements windowAnimationManager.WindowAnim
}
}
export default WindowAnimationControllerImpl
export default WindowAnimationControllerImpl;

View File

@ -19,7 +19,6 @@ import { AppModel } from '../model/AppModel';
import { ResourceManager } from '../manager/ResourceManager';
import { CommonConstants } from '../constants/CommonConstants';
import { launcherAbilityManager } from '../manager/LauncherAbilityManager';
import { AsyncCallback } from '@ohos.base';
const TAG = 'BaseViewModel';

View File

@ -19,18 +19,18 @@ import BaseColumns from './BaseColumns';
* GridLayoutInfo Columns
*/
export default class DesktopApplicationColumns extends BaseColumns {
static readonly APP_NAME: string = "app_name";
static readonly IS_SYSTEM_APP: string = "is_system_app";
static readonly IS_UNINSTALLABLE: string = "is_uninstallAble";
static readonly BADGE_NUMBER: string = "badge_number";
static readonly APPICON_ID: string = "appIcon_id";
static readonly APPLABEL_ID: string = "appLabel_id";
static readonly BUNDLE_NAME: string = "bundle_name";
static readonly MODULE_NAME: string = "module_name";
static readonly ABILITY_NAME: string = "ability_name";
static readonly KEY_NAME: string = "key_name";
static readonly INSTALL_TIME: string = "install_time";
static readonly EXTEND1: string = "extend1";
static readonly EXTEND2: string = "extend2";
static readonly EXTEND3: string = "extend3";
static readonly APP_NAME: string = 'app_name';
static readonly IS_SYSTEM_APP: string = 'is_system_app';
static readonly IS_UNINSTALLABLE: string = 'is_uninstallAble';
static readonly BADGE_NUMBER: string = 'badge_number';
static readonly APPICON_ID: string = 'appIcon_id';
static readonly APPLABEL_ID: string = 'appLabel_id';
static readonly BUNDLE_NAME: string = 'bundle_name';
static readonly MODULE_NAME: string = 'module_name';
static readonly ABILITY_NAME: string = 'ability_name';
static readonly KEY_NAME: string = 'key_name';
static readonly INSTALL_TIME: string = 'install_time';
static readonly EXTEND1: string = 'extend1';
static readonly EXTEND2: string = 'extend2';
static readonly EXTEND3: string = 'extend3';
}

View File

@ -19,13 +19,13 @@ import DesktopApplicationColumns from './DesktopApplicationColumns';
* GridLayoutInfo Columns
*/
export default class GridLayoutInfoColumns extends DesktopApplicationColumns {
static readonly CARD_ID: string = "card_id";
static readonly FOLDER_ID: string = "folder_id";
static readonly CONTAINER: string = "container";
static readonly FOLDER_NAME: string = "folder_name";
static readonly TYPE_ID: string = "type_id";
static readonly AREA: string = "area";
static readonly PAGE: string = "page";
static readonly COLUMN: string = "column";
static readonly ROW: string = "row";
static readonly CARD_ID: string = 'card_id';
static readonly FOLDER_ID: string = 'folder_id';
static readonly CONTAINER: string = 'container';
static readonly FOLDER_NAME: string = 'folder_name';
static readonly TYPE_ID: string = 'type_id';
static readonly AREA: string = 'area';
static readonly PAGE: string = 'page';
static readonly COLUMN: string = 'column';
static readonly ROW: string = 'row';
}

View File

@ -18,14 +18,14 @@
*/
export const FormConstants = {
// publish form action
ACTION_PUBLISH_FORM: "action.form.publish",
ACTION_PUBLISH_FORM: 'action.form.publish',
// publish card parameters
ID_PARAM: "ohos.extra.param.key.form_identity",
NAME_PARAM: "ohos.extra.param.key.form_name",
BUNDLE_PARAM: "ohos.extra.param.key.bundle_name",
ABILITY_PARAM: "ohos.extra.param.key.ability_name",
MODULE_PARAM: "ohos.extra.param.key.module_name",
DIMENSION_PARAM: "ohos.extra.param.key.form_dimension",
TEMPORARY_PARAM:"ohos.extra.param.key.form_temporary"
ID_PARAM: 'ohos.extra.param.key.form_identity',
NAME_PARAM: 'ohos.extra.param.key.form_name',
BUNDLE_PARAM: 'ohos.extra.param.key.bundle_name',
ABILITY_PARAM: 'ohos.extra.param.key.ability_name',
MODULE_PARAM: 'ohos.extra.param.key.module_name',
DIMENSION_PARAM: 'ohos.extra.param.key.form_dimension',
TEMPORARY_PARAM:'ohos.extra.param.key.form_temporary'
};

View File

@ -93,7 +93,7 @@ export class PageDesktopLayoutConfig extends ILayoutConfig {
const temp = gridLayoutInfo;
FileUtils.writeStringToFile(JSON.stringify(temp), this.getConfigFileAbsPath());
this.mGridLayoutInfo = gridLayoutInfo;
Log.showInfo(TAG, " srj updateGridLayoutInfo...");
Log.showInfo(TAG, 'srj updateGridLayoutInfo...');
const UPDATE_RDB_GRID_LAYOUT_INFO_INTERVAL = 30;
const timer = setInterval(() => {
@ -125,7 +125,7 @@ export class PageDesktopLayoutConfig extends ILayoutConfig {
* load configuration
*/
async loadPersistConfig(): Promise<void> {
Log.showDebug(TAG, `loadPersistConfig start`);
Log.showDebug(TAG, 'loadPersistConfig start');
let defaultConfig = super.loadPersistConfig();
const configFromFile = FileUtils.readStringFromFile(this.getConfigFileAbsPath());
if (configFromFile) {

View File

@ -199,7 +199,7 @@ class AmsMissionManager {
}
private async lockCallback(): Promise<void> {
Log.showDebug(TAG, `lockCallback start`);
Log.showDebug(TAG, 'lockCallback start');
// update mission recent card
let mRecentMissionsList = await amsMissionManager.getRecentMissionsList();
mRecentMissionsList.find(item => {

View File

@ -62,7 +62,7 @@ export class CloseAppManager {
*/
public registerCloseAppHandler(baseCloseAppHandler: BaseCloseAppHandler): void {
if (CheckEmptyUtils.isEmpty(baseCloseAppHandler)) {
Log.showError(TAG, `registerCloseAppHandler with invalid baseCloseAppHandler`)
Log.showError(TAG, 'registerCloseAppHandler with invalid baseCloseAppHandler')
return;
}
@ -77,7 +77,7 @@ export class CloseAppManager {
*/
public unregisterCloseAppHandler(baseCloseAppHandler: BaseCloseAppHandler): void {
if (CheckEmptyUtils.isEmpty(baseCloseAppHandler)) {
Log.showError(TAG, `unregisterCloseAppHandler with invalid baseCloseAppHandler`)
Log.showError(TAG, 'unregisterCloseAppHandler with invalid baseCloseAppHandler')
return;
}
@ -100,7 +100,7 @@ export class CloseAppManager {
*/
public getAppIconInfo(windowTarget): void {
if (CheckEmptyUtils.isEmptyArr(this.mBaseCloseAppHandlerList)) {
Log.showError(TAG, `getAppIconInfo with invalid mBaseCloseAppHandlerList`);
Log.showError(TAG, 'getAppIconInfo with invalid mBaseCloseAppHandlerList');
return;
}
@ -116,7 +116,7 @@ export class CloseAppManager {
*/
public getAppInfo(windowTarget): any {
if (CheckEmptyUtils.isEmptyArr(this.mBaseCloseAppHandlerList)) {
Log.showError(TAG, `getAppIconInfo with invalid mBaseCloseAppHandlerList`);
Log.showError(TAG, 'getAppIconInfo with invalid mBaseCloseAppHandlerList');
return {};
}
@ -139,7 +139,7 @@ export class CloseAppManager {
this.mSmartdockCloseItemInfo = smartdockCloseItemInfo;
}
public getAppCloseIconInfo(): any{
public getAppCloseIconInfo(): any {
if (CheckEmptyUtils.isEmpty(this.mPagedesktopClosePosition)) {
Log.showDebug(TAG, `getAppCloseIconInfo return mSmartdockClosePosition is ${JSON.stringify(this.mSmartdockClosePosition)}`)
return this.mSmartdockClosePosition;
@ -149,7 +149,7 @@ export class CloseAppManager {
}
}
public getAppCloseItemInfo(): any{
public getAppCloseItemInfo(): any {
if (CheckEmptyUtils.isEmpty(this.mPagedesktopClosePosition)) {
Log.showDebug(TAG, `getAppCloseIconInfo return mSmartdockClosePosition is ${JSON.stringify(this.mSmartdockClosePosition)}`)
return this.mSmartdockCloseItemInfo;

View File

@ -20,30 +20,30 @@ import { Log } from '../utils/Log';
const TAG = 'DisplayManager: ';
export class DisplayManager {
private readonly MAIN_WINDOW_PREFIX = 'customMainWindow_'
private readonly DEFAULT_MAIN_WINDOW_PAGE = 'pages/SubDisplayWallpaperPage'
private readonly MAIN_WINDOW_PREFIX = 'customMainWindow_';
private readonly DEFAULT_MAIN_WINDOW_PAGE = 'pages/SubDisplayWallpaperPage';
public defaultDisplay: display.Display = undefined
private displayDevices: Array<display.Display> = []
public defaultDisplay: display.Display = undefined;
private displayDevices: Array<display.Display> = [];
private constructor() {
Log.showInfo(TAG, 'constructor called.')
this.loadDefaultDisplay()
this.loadAllDisplays()
Log.showInfo(TAG, 'constructor called.');
this.loadDefaultDisplay();
this.loadAllDisplays();
this.initDisplayChangeListener()
this.initDisplayChangeListener();
}
public static getInstance(): DisplayManager {
return globalThis.DisplayManager ??= new DisplayManager()
return globalThis.DisplayManager ??= new DisplayManager();
}
private loadDefaultDisplay() {
try {
this.defaultDisplay = display.getDefaultDisplaySync()
Log.showInfo(TAG, 'loadDefaultDisplay. defaultDisplay id: ' + this.defaultDisplay?.id)
this.defaultDisplay = display.getDefaultDisplaySync();
Log.showInfo(TAG, 'loadDefaultDisplay. defaultDisplay id: ' + this.defaultDisplay?.id);
} catch (err) {
Log.showError(TAG, 'loadDefaultDisplay occur error. errInfo: ' + JSON.stringify(err))
Log.showError(TAG, 'loadDefaultDisplay occur error. errInfo: ' + JSON.stringify(err));
}
}
@ -51,25 +51,25 @@ export class DisplayManager {
let displays: Array<display.Display> = await display.getAllDisplays()
for (let display of displays) {
if (this.displayDevices.findIndex(item => item.id === display.id) < 0) {
Log.showInfo(TAG, 'new display added. detail: ' + JSON.stringify(display))
this.displayDevices.push(display)
this.createMainWindow(display)
Log.showInfo(TAG, 'new display added. detail: ' + JSON.stringify(display));
this.displayDevices.push(display);
this.createMainWindow(display);
}
}
}
private initDisplayChangeListener() {
display.on('add', displayId => {
Log.showInfo(TAG, 'add new display. id: ' + JSON.stringify(displayId))
this.loadAllDisplays()
Log.showInfo(TAG, 'add new display. id: ' + JSON.stringify(displayId));
this.loadAllDisplays();
})
display.on('remove', displayId => {
Log.showInfo(TAG, 'remove display. id: ' + JSON.stringify(displayId))
let delIndex: number = this.displayDevices.findIndex(item => item.id === displayId)
Log.showInfo(TAG, 'remove display. id: ' + JSON.stringify(displayId));
let delIndex: number = this.displayDevices.findIndex(item => item.id === displayId);
if (delIndex > 0) {
this.destroyMainWindow(displayId)
this.displayDevices.splice(delIndex, 1)
this.destroyMainWindow(displayId);
this.displayDevices.splice(delIndex, 1);
}
})
}
@ -81,7 +81,7 @@ export class DisplayManager {
private createMainWindow(display: display.Display) {
if (display.id === this.defaultDisplay?.id) {
//主屏不需要创建主窗口
return
return;
}
window.createWindow({
ctx: globalThis.desktopContext,
@ -89,45 +89,45 @@ export class DisplayManager {
windowType: window.WindowType.TYPE_DESKTOP,
displayId: display.id
}).then((resultWindow: window.Window) => {
resultWindow.resize(display.width, display.height)
resultWindow.setWindowMode(window.WindowMode.FULLSCREEN)
resultWindow.setUIContent(this.DEFAULT_MAIN_WINDOW_PAGE)
Log.showInfo(TAG, `create main window ${display.id} success.`)
resultWindow.resize(display.width, display.height);
resultWindow.setWindowMode(window.WindowMode.FULLSCREEN);
resultWindow.setUIContent(this.DEFAULT_MAIN_WINDOW_PAGE);
Log.showInfo(TAG, `create main window ${display.id} success.`);
resultWindow.showWithAnimation()
resultWindow.showWithAnimation();
}).catch(err => {
Log.showError(TAG, 'create main window failed. reason: ' + JSON.stringify(err))
Log.showError(TAG, 'create main window failed. reason: ' + JSON.stringify(err));
})
}
private findWindow(displayId: number): window.Window {
let resultWindow = undefined
let resultWindow = undefined;
try {
resultWindow = window.findWindow(this.MAIN_WINDOW_PREFIX + displayId)
resultWindow = window.findWindow(this.MAIN_WINDOW_PREFIX + displayId);
} catch (err) {
Log.showError(TAG, 'findWindow occur err. errInfo: ' + JSON.stringify(err))
Log.showError(TAG, 'findWindow occur err. errInfo: ' + JSON.stringify(err));
}
return resultWindow
return resultWindow;
}
private destroyMainWindow(displayId: number) {
if (displayId === this.defaultDisplay?.id) {
return
return;
}
let resultWindow = this.findWindow(displayId)
let resultWindow = this.findWindow(displayId);
if (resultWindow?.isWindowShowing()) {
resultWindow.hideWithAnimation()
resultWindow.hideWithAnimation();
}
resultWindow?.destroyWindow()
Log.showInfo(TAG, `destroy main window ${displayId} success.`)
resultWindow?.destroyWindow();
Log.showInfo(TAG, `destroy main window ${displayId} success.`);
}
public destroySubDisplayWindow() {
for (let display of this.displayDevices) {
this.destroyMainWindow(display.id)
this.destroyMainWindow(display.id);
}
display.off('add')
display.off('remove')
display.off('add');
display.off('remove');
}
}

View File

@ -331,7 +331,7 @@ class LauncherAbilityManager {
moduleName: paramModuleName
}).then(() => {
Log.showDebug(TAG, 'startApplication promise success');
performanceMonitor.end("LAUNCHER_APP_LAUNCH_FROM_ICON");
performanceMonitor.end('LAUNCHER_APP_LAUNCH_FROM_ICON');
Log.showDebug(TAG, 'performanceMonitor end');
}, (err) => {
Log.showError(TAG, `startApplication promise error: ${JSON.stringify(err)}`);
@ -356,7 +356,7 @@ class LauncherAbilityManager {
}
});
Log.showDebug(TAG, 'performanceMonitor begin');
performanceMonitor.begin("LAUNCHER_APP_LAUNCH_FROM_ICON", performanceMonitor.ActionType.LAST_UP,
performanceMonitor.begin('LAUNCHER_APP_LAUNCH_FROM_ICON', performanceMonitor.ActionType.LAST_UP,
paramBundleName);
}

View File

@ -53,7 +53,7 @@ class NavigationBarCommonEventManager {
};
commonEventMgr.createSubscriber(subscribeInfo).then(
(commonEventSubscriber: commonEventMgr.CommonEventSubscriber) => {
Log.showDebug(TAG, "init SPLIT_SCREEN subscriber success");
Log.showDebug(TAG, 'init SPLIT_SCREEN subscriber success');
NavigationBarCommonEventManager.subscriber = commonEventSubscriber;
}, (err) => {
Log.showError(TAG, `Failed to createSubscriber ${err}`);

View File

@ -34,7 +34,7 @@ export class PreferencesHelper {
async initPreference(context: Context): Promise<void> {
if (this.preference) {
Log.showInfo(TAG, `preference is inited`);
Log.showInfo(TAG, 'preference is inited');
return;
}
try {

View File

@ -341,7 +341,7 @@ export class RdbStoreManager {
// update settings by key and value
let sql = `UPDATE ${RdbStoreConfig.Settings.TABLE_NAME} SET ${key} = '${value}' WHERE id = 1`;
await this.mRdbStore.executeSql(sql);
Log.showDebug(TAG, `updateSettings update successful.`);
Log.showDebug(TAG, 'updateSettings update successful.');
}
} catch (e) {
Log.showError(TAG, 'updateSettings error:' + JSON.stringify(e));
@ -690,7 +690,7 @@ export class RdbStoreManager {
const resultList: AppItemInfo[] = [];
try {
let layoutPredicates = new relationalStore.RdbPredicates(RdbStoreConfig.GridLayoutInfo.TABLE_NAME);
layoutPredicates.equalTo("container", container);
layoutPredicates.equalTo('container', container);
let columns = [GridLayoutInfoColumns.APP_NAME,
GridLayoutInfoColumns.IS_SYSTEM_APP,
GridLayoutInfoColumns.IS_UNINSTALLABLE,

View File

@ -75,7 +75,7 @@ class SettingsDataManager {
* Update settingData by settingDataKey.
*/
setValue(helper: dataShare.DataShareHelper | null, settingDataKey: string, value: string): void {
Log.showInfo(TAG, "setValue:" + value)
Log.showInfo(TAG, 'setValue:' + value)
if (typeof globalThis.desktopContext === 'undefined') {
settings.setValueSync(globalThis.settingsContext as Context, settingDataKey, value);
} else {
@ -95,7 +95,7 @@ class SettingsDataManager {
} else {
value = settings.getValueSync(globalThis.desktopContext as Context, settingDataKey, defaultValue);
}
Log.showInfo(TAG, "getValue:" + value);
Log.showInfo(TAG, 'getValue:' + value);
return value;
}

View File

@ -160,7 +160,7 @@ class WindowManager {
private setWindowSystemBar(windowName: string, names: Array<'status'|'navigation'>) {
this.findWindow(windowName, win => {
win.setWindowSystemBarEnable(names).then(() => {
Log.showInfo(TAG, `set statusBar success`);
Log.showInfo(TAG, 'set statusBar success');
}).catch(err => {
Log.showInfo(TAG, `set statusBar failed, Cause: ${JSON.stringify(err)}`);
})
@ -357,7 +357,7 @@ class WindowManager {
events: [commonEventManager.RECENT_FULL_SCREEN, commonEventManager.RECENT_SPLIT_SCREEN]
};
commonEventMgr.createSubscriber(subscribeInfo).then((commonEventSubscriber: commonEventMgr.CommonEventSubscriber) => {
Log.showDebug(TAG, "init SPLIT_SCREEN subscriber success");
Log.showDebug(TAG, 'init SPLIT_SCREEN subscriber success');
WindowManager.subscriber = commonEventSubscriber;
}, (err) => {
Log.showError(TAG, `Failed to createSubscriber ${err}`)

View File

@ -26,7 +26,6 @@ import { GridLayoutInfo } from '../interface';
const TAG = 'FormModel';
const KEY_FORM_LIST = 'formListInfo';
/**
* form model.
@ -38,6 +37,7 @@ export class FormModel {
private readonly mAppItemFormInfoMap = new Map<string, CardItemInfo[]>();
private readonly mPageDesktopModel: PageDesktopModel;
private readonly mAtomicServiceAppItemFormInfoMap = new Map<string, CardItemInfo[]>();
private readonly KEY_FORM_LIST: string = 'formListInfo';
private constructor() {
this.mRdbStoreManager = RdbStoreManager.getInstance();
@ -209,7 +209,7 @@ export class FormModel {
deleteFormByBundleName(bundleName: string): void {
const settingsModel = SettingsModel.getInstance();
this.mRdbStoreManager.deleteFormInfoByBundle(bundleName);
const formInfoList: any = this.mFormListInfoCacheManager.getCache(KEY_FORM_LIST);
const formInfoList: any = this.mFormListInfoCacheManager.getCache(this.KEY_FORM_LIST);
if (formInfoList === CommonConstants.INVALID_VALUE) {
return;
}
@ -239,9 +239,9 @@ export class FormModel {
}
}
if (tempFormInfoList.length === 0) {
this.mFormListInfoCacheManager.setCache(KEY_FORM_LIST, null);
this.mFormListInfoCacheManager.setCache(this.KEY_FORM_LIST, null);
} else {
this.mFormListInfoCacheManager.setCache(KEY_FORM_LIST, tempFormInfoList);
this.mFormListInfoCacheManager.setCache(this.KEY_FORM_LIST, tempFormInfoList);
}
this.updateBlankPage(pageItemMap, layoutInfo);
@ -275,7 +275,7 @@ export class FormModel {
this.mPageDesktopModel.setPageIndex(curPageIndex - 1);
}
}
const formInfoList: any = this.mFormListInfoCacheManager.getCache(KEY_FORM_LIST);
const formInfoList: any = this.mFormListInfoCacheManager.getCache(this.KEY_FORM_LIST);
if (formInfoList === CommonConstants.INVALID_VALUE) {
return;
}
@ -286,9 +286,9 @@ export class FormModel {
}
}
if (formInfoList.length === 0) {
this.mFormListInfoCacheManager.setCache(KEY_FORM_LIST, null);
this.mFormListInfoCacheManager.setCache(this.KEY_FORM_LIST, null);
} else {
this.mFormListInfoCacheManager.setCache(KEY_FORM_LIST, formInfoList);
this.mFormListInfoCacheManager.setCache(this.KEY_FORM_LIST, formInfoList);
}
}

View File

@ -118,7 +118,7 @@ export class PageDesktopModel {
* @param {boolean} isAddByDragging
*/
setAddByDragging(isAddByDragging: boolean): void {
this.isAddByDraggingFlag = isAddByDragging
this.isAddByDraggingFlag = isAddByDragging;
}
updateAppItemLayoutInfo(info, item): void {

View File

@ -86,7 +86,7 @@ export default class MainAbility extends ServiceExtension {
// load recent
windowManager.createRecentWindow();
this.registerInputConsumer();
this.displayManager = DisplayManager.getInstance()
this.displayManager = DisplayManager.getInstance();
}
private registerInputConsumer(): void {