Signed-off-by: 18671941053 <zoujunjie6@huawei.com>
This commit is contained in:
18671941053 2024-08-15 10:52:32 +08:00
parent abb8d474f0
commit c0dd7df0e7
71 changed files with 132 additions and 236 deletions

View File

@ -16,21 +16,22 @@
export {
CheckEmptyUtils,
Constants,
DateTimeCommon,
dateTimeCommon,
Log,
ReadConfigUtil,
createOrGet,
StyleConfiguration,
StyleManager,
styleManager,
SwitchUserManager,
WriteFaultLog,
SysFaultLogger,
FaultID,
Trace,
TimeManager,
sTimeManager,
TimeEventArgs,
TIME_CHANGE_EVENT,
WindowType,
sWindowManager,
ScreenLockStatus,
ReadConfigFile
} from './src/main/ets/default'
@ -49,7 +50,7 @@ export {
export {
EventManager,
sEventManager,
unsubscribe,
obtainLocalEvent,
obtainStartAbility

View File

@ -15,6 +15,14 @@
import { ConvertLunarCalendar } from '../../../../../common/src/main/ets/default/LunarCalendar'
export class DateTimeCommon {
static getInstance(): DateTimeCommon {
if (globalThis.DateTimeCommon == null) {
globalThis.DateTimeCommon = new DateTimeCommon();
}
return globalThis.DateTimeCommon;
}
getSystemTime(isUsing24hFormat: boolean) {
let dateTime = new Date();
let hours = dateTime.getHours();
@ -90,6 +98,4 @@ export class DateTimeCommon {
}
}
let dateTimeCommon = new DateTimeCommon();
export default dateTimeCommon as DateTimeCommon
export let dateTimeCommon = DateTimeCommon.getInstance();

View File

@ -16,7 +16,7 @@
import commonEvent from "@ohos.commonEvent";
import { CommonEventSubscriber } from "commonEvent/commonEventSubscriber";
import {createOrGet} from "./SingleInstanceHelper";
import EventManager from "./event/EventManager";
import {sEventManager} from "./event/EventManager";
import {Log} from "./Log";
import { obtainLocalEvent } from "./event/EventUtil";
import { debounce } from "./Decorators";
@ -54,7 +54,7 @@ class ScreenLockManager {
@debounce(debounceTimeout)
notifyScreenEvent(isScreenOn: boolean) {
EventManager.publish(obtainLocalEvent(SCREEN_CHANGE_EVENT, isScreenOn));
sEventManager.publish(obtainLocalEvent(SCREEN_CHANGE_EVENT, isScreenOn));
Log.showDebug(TAG, `publish ${SCREEN_CHANGE_EVENT} screenState: ${isScreenOn}`);
}
}

View File

@ -13,14 +13,14 @@
* limitations under the License.
*/
import StyleManager from './StyleManager';
import {styleManager} from './StyleManager';
const TAG = 'Common-StyleConfiguration';
export class StyleConfiguration {
static getCommonStyle() {
const key: string = TAG + "-Common";
return StyleManager.getStyle(key, () => {
return styleManager.getStyle(key, () => {
return {
statusBarFontSize: $r("app.float.signal_fontSize"),
statusBarIconWidth: '24vp',

View File

@ -20,6 +20,13 @@ const TAG = 'Common-StyleManager';
export class StyleManager {
mAbilityPageName: string = '';
static getInstance(): StyleManager {
if (globalThis.StyleManager == null) {
globalThis.StyleManager = new StyleManager();
}
return globalThis.StyleManager;
}
setAbilityPageName(name: string): void{
Log.showDebug(TAG, `setAbilityPageName, name: ${name}`);
this.mAbilityPageName = name;
@ -36,6 +43,4 @@ export class StyleManager {
}
}
let styleManager = new StyleManager();
export default styleManager as StyleManager;
export let styleManager = StyleManager.getInstance();

View File

@ -57,6 +57,13 @@ export class TimeManager {
private mSettingsHelper?: DataAbilityHelper;
private mManager?: CommonEventManager;
static getInstance(): TimeManager {
if (globalThis.TimeManager == null) {
globalThis.TimeManager = new TimeManager();
}
return globalThis.TimeManager;
}
public init(context: any) {
this.mManager = getCommonEventManager(
TAG,
@ -118,6 +125,4 @@ export class TimeManager {
}
}
let sTimeManager = createOrGet(TimeManager, TAG);
export default sTimeManager as TimeManager;
export let sTimeManager = sTimeManager.getInstance();

View File

@ -60,6 +60,13 @@ const DEFAULT_WINDOW_INFO: WindowInfo = {
class WindowManager {
mWindowInfos: Map<WindowType, WindowInfo> = new Map();
static getInstance(): WindowManager {
if (globalThis.WindowManager == null) {
globalThis.WindowManager = new WindowManager();
}
return globalThis.WindowManager;
}
async createWindow(context: any, name: WindowType, rect: Rect, loadContent: string): Promise<WindowHandle> {
Log.showInfo(TAG, `createWindow name: ${name}, rect: ${JSON.stringify(rect)}, url: ${loadContent}`);
let winHandle = null;
@ -150,5 +157,5 @@ class WindowManager {
}
}
let sWindowManager = createOrGet(WindowManager, TAG);
export default sWindowManager as WindowManager;
export let sWindowManager = WindowManager.getInstance();

View File

@ -15,7 +15,7 @@
import commonEvent from "@ohos.commonEvent";
import { CommonEventData } from "commonEvent/commonEventData";
import EventManager from "../event/EventManager";
import {sEventManager} from "../event/EventManager";
import {Log} from "../Log";
import { SCREEN_CHANGE_EVENT } from "../ScreenLockManager";
@ -91,7 +91,7 @@ export function getCommonEventManager(
}
function ScreenPolicy(manager: InnerManager): ClearPolicy {
return EventManager.subscribe(SCREEN_CHANGE_EVENT, (isScreenOn: boolean) => {
return sEventManager.subscribe(SCREEN_CHANGE_EVENT, (isScreenOn: boolean) => {
isScreenOn ? manager.subscriberCommonEvent() : manager.unSubscriberCommonEvent();
});
}

View File

@ -15,7 +15,6 @@
import ServiceExtensionContext from "application/ServiceExtensionContext";
import {Log} from "../Log";
import {createOrGet} from "../SingleInstanceHelper";
import { EventParser, START_ABILITY_EVENT, Event, LocalEvent } from "./EventUtil";
import { Callback, createEventBus, EventBus } from "./EventBus";
@ -29,6 +28,13 @@ export class EventManager {
eventParser: EventParser;
mContext: ServiceExtensionContext | undefined;
static getInstance(): EventManager {
if (globalThis.EventManager == null) {
globalThis.EventManager = new EventManager();
}
return globalThis.EventManager;
}
constructor() {
this.mEventBus = createEventBus();
this.eventParser = {
@ -87,6 +93,4 @@ export class EventManager {
}
}
let sEventManager = createOrGet(EventManager, TAG);
export default sEventManager as EventManager;
export let sEventManager = EventManager.getInstance();

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
export { EventManager } from './EventManager'
export { sEventManager } from './EventManager'
export { unsubscribe } from './EventManager'

View File

@ -17,7 +17,7 @@ export { CheckEmptyUtils } from './CheckEmptyUtils'
export { Constants } from './Constants'
export { DateTimeCommon } from './DateTimeCommon'
export { dateTimeCommon } from './DateTimeCommon'
export { Log } from './Log'
@ -27,7 +27,7 @@ export { createOrGet } from './SingleInstanceHelper'
export { StyleConfiguration } from './StyleConfiguration'
export { StyleManager } from './StyleManager'
export { styleManager } from './StyleManager'
export { SwitchUserManager } from './SwitchUserManager'
@ -41,9 +41,9 @@ export { TimeEventArgs } from './TimeManager'
export { TIME_CHANGE_EVENT } from './TimeManager'
export { TimeManager } from './TimeManager'
export { sTimeManager } from './TimeManager'
export { WindowType } from './WindowManager'
export { WindowType, sWindowManager } from './WindowManager'
export { FaultID } from './SysFaultLogger'

View File

@ -16,15 +16,8 @@
import BatteryInfo from "@ohos.batteryInfo";
import commonEvent from "@ohos.commonEvent";
import {createOrGet} from '@ohos/common';
import {Log, createOrGet, CommonEventManager, getCommonEventManager, POLICY} from '@ohos/common';
import Constants from "./common/constants";
import {Log} from '@ohos/common';
import { CommonEventData } from "commonEvent/commonEventData";
import {
CommonEventManager,
getCommonEventManager,
POLICY
} from '@ohos/common';
const TAG = "BatteryComponent-batteryModelSc";
const DEFAULT_PROGRESS = 100;

View File

@ -13,16 +13,14 @@
* limitations under the License.
*/
import StyleManager from '../../../../../../../common/src/main/ets/default/StyleManager';
// import {StyleManager} from '@ohos/common'
import Constants from './constants'
import {styleManager} from '@ohos/common'
const TAG = 'battery-StyleConfiguration';
export default class StyleConfiguration {
static getBatteryComponentStyle() {
const key: string = TAG + "-BatteryComponent";
return StyleManager.getStyle(key, () => {
return styleManager.getStyle(key, () => {
return {
componentGap: $r('app.float.battery_component_gap')
};
@ -31,7 +29,7 @@ export default class StyleConfiguration {
static getBatteryPicStyle() {
const key: string = TAG + "-BatteryPicComponent";
return StyleManager.getStyle(key, () => {
return styleManager.getStyle(key, () => {
return {
picGap: $r('app.float.battery_component_pic_gap'),
picBodyWidth: $r('app.float.battery_component_pic_body_width'),

View File

@ -16,12 +16,8 @@
import mBatteryModel from '../batteryModel';
import BatteryPic from './batteryPic'
import BatterySoc from './batterySoc'
import Constants from '../common/constants'
import {Log} from '@ohos/common'
// import {StyleConfigurationCommon} from '../../../../../../../common/src/main/ets/default/StyleConfiguration'
import StyleConfiguration from '../common/StyleConfiguration'
import {StatusBarGroupComponentData
} from '../../../../../../screenlock/src/main/ets/com/ohos/common/constants'
import {StatusBarGroupComponentData} from '../../../../../../screenlock/src/main/ets/com/ohos/common/constants'
import StatusBarVM from '../../../../../../screenlock/src/main/ets/com/ohos/vm/StatusBarVM'
const TAG = 'BatteryComponent-batteryIcon'

View File

@ -15,7 +15,6 @@
import Constants from '../common/constants'
import {Log} from '@ohos/common'
import StyleConfiguration from '../common/StyleConfiguration'
const TAG = 'BatteryComponent-batteryPic'

View File

@ -14,7 +14,6 @@
*/
import {Log} from '@ohos/common';
// import {StyleConfigurationCommon} from '../../../../../../../common/src/main/ets/default/StyleConfiguration'
const TAG = 'BatteryComponent-batterySoc'

View File

@ -13,14 +13,14 @@
* limitations under the License.
*/
import StyleManager from '../../../../../../../common/src/main/ets/default/StyleManager';
import {styleManager} from '@ohos/common';
const TAG = 'clock-StyleConfiguration';
export default class StyleConfiguration {
static getClockComponentStyle() {
const key: string = TAG + "-ClockComponent";
return StyleManager.getStyle(key, () => {
return styleManager.getStyle(key, () => {
return {
statusBarClockMaxWidth: $r('app.float.status_bar_clock_width')
};

View File

@ -13,18 +13,9 @@
* limitations under the License.
*/
import {Log} from '@ohos/common'
import StyleConfiguration from '../common/StyleConfiguration'
// import {StyleConfigurationCommon} from '../../../../../../../common/src/main/ets/default/StyleConfiguration'
import { StatusBarGroupComponentData } from '../../../../../../screenlock/src/main/ets/com/ohos/common/constants'
import StatusBarVM from '../../../../../../screenlock/src/main/ets/com/ohos/vm/StatusBarVM'
import TimeManager from '../../../../../../../common/src/main/ets/default/TimeManager'
import {
TimeEventArgs,
TIME_CHANGE_EVENT,
} from '@ohos/common'
import EventManager from '../../../../../../../common/src/main/ets/default/event/EventManager'
import {unsubscribe} from '@ohos/common'
import {Log, TimeEventArgs, TIME_CHANGE_EVENT, sEventManager, unsubscribe, sTimeManager} from '@ohos/common'
const TAG = 'ClockComponent-clockIcon';
@ -41,10 +32,10 @@ export default struct ClockIcon {
aboutToAppear() {
Log.showInfo(TAG, 'aboutToAppear');
this.mStatusBarGroupComponentData = StatusBarVM.getStatusBarGroupComponentData(this.mGroupId)
this.unSubscriber = EventManager.subscribe(TIME_CHANGE_EVENT, (args: TimeEventArgs) => {
this.mTime = TimeManager.formatTime(args.date);
this.unSubscriber = sEventManager.subscribe(TIME_CHANGE_EVENT, (args: TimeEventArgs) => {
this.mTime = sTimeManager.formatTime(args.date);
});
this.mTime = TimeManager.formatTime(new Date());
this.mTime = sTimeManager.formatTime(new Date());
}
aboutToDisappear() {

View File

@ -16,7 +16,6 @@
import {Log} from '@ohos/common'
import ViewModel from '../../vm/dateTimeViewModel'
import Constants from '../../common/constants'
// import { ScreenLockStatus } from '../../../../../../../../../common/src/main/ets/default/ScreenLockCommon'
import deviceInfo from '@ohos.deviceInfo';
import i18n from '@ohos.i18n';

View File

@ -13,14 +13,8 @@
* limitations under the License.
*/
import featureAbility from '@ohos.ability.featureAbility'
import commonEvent from '@ohos.commonEvent';
import {Log} from '@ohos/common'
import DateTimeCommon from '../../../../../../../../common/src/main/ets/default/DateTimeCommon'
import sTimeManager from '../../../../../../../../common/src/main/ets/default/TimeManager';
import {TimeEventArgs, TIME_CHANGE_EVENT} from '@ohos/common'
import EventManager from '../../../../../../../../common/src/main/ets/default/event/EventManager'
import {unsubscribe} from '@ohos/common'
import {Log, dateTimeCommon, sTimeManager, TimeEventArgs, TIME_CHANGE_EVENT, sEventManager, unsubscribe} from '@ohos/common'
const TAG = 'ScreenLock-DateTimeViewModel'
@ -49,7 +43,7 @@ export default class DateTimeViewModel {
this.getAndSetDateTime.bind(this)()
commonEvent.createSubscriber(mCommonEventSubscribeInfo, this.createSubscriberCallBack.bind(this));
this.unSubscriber = EventManager.subscribe(TIME_CHANGE_EVENT, (args: TimeEventArgs) => {
this.unSubscriber = sEventManager.subscribe(TIME_CHANGE_EVENT, (args: TimeEventArgs) => {
this.setDateTime(args.date)
});
Log.showDebug(TAG, 'ViewModelInit end');
@ -63,9 +57,9 @@ export default class DateTimeViewModel {
private setDateTime(date: Date) {
Log.showDebug(TAG, `setDateTime`)
this.timeVal = sTimeManager.formatTime(date)
this.dateVal = DateTimeCommon.getSystemDate()
this.weekVal = DateTimeCommon.getSystemWeek()
this.calendarVal = DateTimeCommon.getCalendarDate()
this.dateVal = dateTimeCommon.getSystemDate()
this.weekVal = dateTimeCommon.getSystemWeek()
this.calendarVal = dateTimeCommon.getCalendarDate()
}
private createSubscriberCallBack(err, data) {

View File

@ -13,8 +13,6 @@
* limitations under the License.
*/
import {ReadConfigUtil} from '@ohos/common'
import {Log} from '@ohos/common'
const TAG = 'NotificationConfig'

View File

@ -15,7 +15,6 @@
import {Log} from '@ohos/common'
import DeviceManager from '@ohos.distributedDeviceManager';
import DeviceInfo from '@ohos.deviceInfo';
const TAG = `NotificationDistributionManager`;

View File

@ -13,7 +13,6 @@
* limitations under the License.
*/
//import { NotificationSubscriber } from './notification/notificationSubscriber';
import Notification from '@ohos.notification';
import PluginComponentManager from '@ohos.pluginComponent';
import Systemparameter from '@ohos.systemparameter';

View File

@ -13,12 +13,11 @@
* limitations under the License.
*/
import {Log} from '@ohos/common'
import {Log, createOrGet} from '@ohos/common'
import NotificationManager from './NotificationManager';
import ParseDataUtil from './ParseDataUtil';
import RuleController from './rule/RuleController';
import CommonUtil from '../common/CommonUtil';
import {createOrGet} from '@ohos/common'
import DistributionManager from './NotificationDistributionManager';
const TAG = 'NotificationServiceSc';

View File

@ -13,9 +13,7 @@
* limitations under the License.
*/
import {Log} from '@ohos/common'
import EventManager from "../../../../../../../../../common/src/main/ets/default/event/EventManager";
import {obtainLocalEvent} from '@ohos/common'
import {Log, sEventManager, obtainLocalEvent} from '@ohos/common'
const TAG = `NotificationWindowManager`;
@ -26,7 +24,7 @@ class NotificationWindowManager {
hideNotificationWindow() {
Log.showDebug(TAG, 'hide Notification window');
EventManager.publish(obtainLocalEvent('hideNotificationWindowEvent', ''));
sEventManager.publish(obtainLocalEvent('hideNotificationWindowEvent', ''));
}
}

View File

@ -14,9 +14,7 @@
*/
import AccountManager from '@ohos.account.osAccount';
import {Log} from '@ohos/common'
import {BundleManager} from '@ohos/common'
import {AbilityManager} from '@ohos/common'
import {Log, BundleManager, AbilityManager} from '@ohos/common'
import NotificationManager from './NotificationManager';
import {NotificationItemData} from '../common/constants';
import {NotificationConfig} from './NotificationConfig';

View File

@ -15,11 +15,8 @@
*/
import {NotificationItemData} from '../../common/constants';
import {Log} from '@ohos/common'
import {SlotLevel} from '@ohos.notification';
import Notification from '@ohos.notification';
import {CheckEmptyUtils} from '@ohos/common';
import Bundle from '@ohos.bundle';
import {Log, CheckEmptyUtils} from '@ohos/common'
import Notification, {SlotLevel} from '@ohos.notification';
const TAG = 'NotificationRuleController';

View File

@ -14,10 +14,9 @@
*/
import {Log} from '@ohos/common'
import Constants, {NotificationLayout as Layout} from '../common/constants';
import {NotificationLayout as Layout} from '../common/constants';
import NotificationItem from './item/notificationItem'
import GroupNotificationItem from './item/groupItem'
import ViewModel from '../viewmodel/ViewModel'
const TAG = 'NoticeItem-NotificationListComponent';

View File

@ -13,8 +13,7 @@
* limitations under the License.
*/
import {Log} from '@ohos/common'
import {CheckEmptyUtils} from '@ohos/common'
import {Log, CheckEmptyUtils} from '@ohos/common'
import ViewModel from '../../viewmodel/ViewModel';
import Constants, {InputActionButtonData, NotificationLayout as Layout} from '../../common/constants';

View File

@ -13,10 +13,7 @@
* limitations under the License.
*/
import {Log} from '@ohos/common'
import {AbilityManager} from '@ohos/common'
import WindowManager from '../../../../../../../../../../common/src/main/ets/default/WindowManager'
import { WindowType } from '@ohos/common'
import {Log, AbilityManager, sWindowManager, WindowType} from '@ohos/common'
import Constants, {NotificationLayout as Layout} from '../../common/constants';
import ViewModel from '../../viewmodel/ViewModel';
import CustomItem from './customItem';
@ -32,7 +29,6 @@ import WantAgent from '@ohos.wantAgent';
const TAG = 'NoticeItem-BannerNotificationItem'
const INTERVAL = 5 * 1000
@Component
export default struct BannerNotificationItem {
@State want : any = {};
@ -133,8 +129,8 @@ export default struct BannerNotificationItem {
width: this.mDefaultBannerRect['width'],
height: heightWin
};
WindowManager.resetSizeWindow(WindowType.BANNER_NOTICE, bannerRect);
WindowManager.showWindow(WindowType.BANNER_NOTICE);
sWindowManager.resetSizeWindow(WindowType.BANNER_NOTICE, bannerRect);
sWindowManager.showWindow(WindowType.BANNER_NOTICE);
})
}
} else {

View File

@ -19,8 +19,7 @@ import longItem from './longItem';
import multiItem from './multiItem';
import pictureItem from './pictureItem';
import titleItem from './titleItem';
import {Log} from '@ohos/common'
import {CheckEmptyUtils} from '@ohos/common'
import {Log, CheckEmptyUtils} from '@ohos/common'
import ViewModel from '../../viewmodel/ViewModel';
import ActionComponent from './actionComponent';

View File

@ -14,7 +14,6 @@
*/
import Constants, {NotificationItemData, NotificationLayout as Layout} from '../../common/constants';
import {CheckEmptyUtils} from '@ohos/common'
@Component
export default struct PictureItem {

View File

@ -14,11 +14,7 @@
*/
import Constants,{NotificationItemData} from '../../common/constants';
import {Log} from '@ohos/common'
import {CheckEmptyUtils} from '@ohos/common'
import EventManager from "../../../../../../../../../../common/src/main/ets/default/event/EventManager"
import {obtainStartAbility} from '@ohos/common'
import Notification from '@ohos.notification';
import {Log, CheckEmptyUtils, sEventManager, obtainStartAbility} from '@ohos/common'
const TAG = 'NoticeItem-Setting';
@ -115,7 +111,7 @@ export default struct SettingDialog {
openAbility() {
Log.showDebug(TAG, ` openAbility:showNotificationManagement`)
EventManager.publish(obtainStartAbility('com.ohos.systemui', 'com.ohos.systemui.notificationmanagement.MainAbility',
sEventManager.publish(obtainStartAbility('com.ohos.systemui', 'com.ohos.systemui.notificationmanagement.MainAbility',
{ 'migrateUri': 'pages/setEnable', 'migrateBundle': this.itemData.bundleName }))
this.closeAbility()
}

View File

@ -15,7 +15,6 @@
import Constants, {NotificationLayout as Layout} from '../../common/constants';
import {Log} from '@ohos/common'
import {CheckEmptyUtils} from '@ohos/common'
const TAG = 'NoticeItem-TitleItem';

View File

@ -14,17 +14,12 @@
* limitations under the License.
*/
import {Log} from '@ohos/common'
import {SwitchUserManager} from '@ohos/common'
import {Log, SwitchUserManager, CheckEmptyUtils, AbilityManager, obtainLocalEvent, sEventManager} from '@ohos/common'
import media from '@ohos.multimedia.media';
import SourceType from '@ohos.notification'
import NotificationService from '../model/NotificationService'
import NotificationWindowManager from '../model/NotificationWindowManager';
import NotificationConfig from '../model/NotificationConfig';
import {CheckEmptyUtils} from '@ohos/common'
import {AbilityManager} from '@ohos/common'
import EventManager from "../../../../../../../../../common/src/main/ets/default/event/EventManager"
import {obtainLocalEvent} from '@ohos/common'
import CommonUtil from '../common/CommonUtil';
import Constants from '../common/constants';
@ -346,7 +341,7 @@ export class ViewModel {
if (itemData.ruleData.isAllowBanner) {
Log.showDebug(TAG, `banner start `);
AbilityManager.setAbilityData(AbilityManager.ABILITY_NAME_BANNER_NOTICE, 'itemData', itemData);
EventManager.publish(obtainLocalEvent('onBannerNoticeShow', { 'itemData': itemData }))
sEventManager.publish(obtainLocalEvent('onBannerNoticeShow', { 'itemData': itemData }))
Log.showDebug(TAG, `banner end `);
}
if (itemData.notificationFlags?.soundEnabled != Constants.NOTIFICATION_TYPE_CLOSE) {

View File

@ -18,12 +18,7 @@ import osAccount from '@ohos.account.osAccount'
import commonEvent from '@ohos.commonEvent';
import util from '@ohos.util';
import {Callback} from '@ohos.base';
import {Trace} from '@ohos/common'
import {SysFaultLogger, FaultID} from '@ohos/common'
import {Log} from '@ohos/common'
import { CommonEventManager, getCommonEventManager } from '@ohos/common'
import EventManager from "../../../../../../../../common/src/main/ets/default/event/EventManager";
import {obtainLocalEvent} from '@ohos/common'
import {Log, Trace, sEventManager, CommonEventManager, getCommonEventManager, SysFaultLogger, FaultID, obtainLocalEvent} from '@ohos/common'
import {UserData} from '../data/userData';
const TAG = "ScreenLock-AccountsModel"
@ -169,7 +164,7 @@ export default class AccountsModel {
accountMap.get(user.localId).userIconPath = path;
})
}
EventManager.publish(obtainLocalEvent(ACCOUNTS_REFRESH_EVENT, accountList));
sEventManager.publish(obtainLocalEvent(ACCOUNTS_REFRESH_EVENT, accountList));
})
}

View File

@ -13,9 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {Trace} from '@ohos/common'
import {Log} from '@ohos/common'
import {SysFaultLogger, FaultID} from '@ohos/common'
import {Log, Trace, SysFaultLogger, FaultID} from '@ohos/common'
import ScreenLockMar from '@ohos.screenLock';
import windowManager from '@ohos.window'
import Constants from '../common/constants'

View File

@ -12,13 +12,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {Log} from '@ohos/common'
import {Trace} from '@ohos/common'
import {WriteFaultLog, FaultID} from '@ohos/common'
import {Log, Trace, WriteFaultLog, FaultID, createOrGet, ScreenLockStatus} from '@ohos/common'
import ScreenLockModel from './screenLockModel';
import AccountModel, {AuthType, AuthSubType, AuthTurstLevel} from './accountsModel'
import {ScreenLockStatus} from '../../../../../../../../common/src/main/ets/default/ScreenLockCommon';
import {createOrGet} from '@ohos/common'
import Router from '@system.router';
import commonEvent from '@ohos.commonEvent';
import hiDebug from '@ohos.hidebug';
@ -32,7 +28,6 @@ const URI_DIGITALPASSWORD = 'pages/digitalPassword'
const URI_MIXEDPASSWORD = 'pages/mixedPassword'
const URI_CUSTOMPASSWORD = 'pages/customPassword'
//Event type name
const EVENT_BEGIN_WAKEUP: string = 'beginWakeUp'
const EVENT_END_WAKEUP: string = 'endWakeUp'

View File

@ -12,8 +12,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {Log} from '@ohos/common'
import {ReadConfigFile} from '../../../../../../../../common/src/main/ets/default/ScreenLockCommon'
import {Log, ReadConfigFile} from '@ohos/common'
const SCREENLOCK_MODE_FILE_NAME = "screenlock.json";
const TAG = 'ScreenLock-ScreenlockStyle';

View File

@ -13,13 +13,11 @@
* limitations under the License.
*/
import {Log} from '@ohos/common'
import {Log, sEventManager, unsubscribe} from '@ohos/common'
import ViewModel from '../../vm/accountsViewModel';
import Constants from '../../common/constants';
import {UserData} from '../../data/userData';
import { ACCOUNTS_REFRESH_EVENT } from '../../model/accountsModel'
import EventManager from '../../../../../../../../../common/src/main/ets/default/event/EventManager';
import {unsubscribe} from '@ohos/common'
const TAG = 'ScreenLock-Accounts'
@ -32,7 +30,7 @@ export default struct Accounts {
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear`);
this.unSubscriber = EventManager.subscribe(ACCOUNTS_REFRESH_EVENT, (data) => {
this.unSubscriber = sEventManager.subscribe(ACCOUNTS_REFRESH_EVENT, (data) => {
this.accountList = data;
});
}

View File

@ -14,7 +14,6 @@
*/
import {Log} from '@ohos/common'
import Constants from '../../common/constants'
const TAG = 'ScreenLock-BatterySoc'

View File

@ -13,8 +13,7 @@
* limitations under the License.
*/
import {Log} from '@ohos/common'
import {ScreenLockStatus} from '@ohos/common'
import {Log, ScreenLockStatus} from '@ohos/common'
import ViewModel from '../../vm/lockIconViewModel'
import Constants from '../../common/constants'

View File

@ -14,7 +14,6 @@
*/
import {Log} from '@ohos/common'
import ViewModel from '../../vm/StatusBarVM'
import Constants from '../../common/constants'
import BatteryIcon from '../../../../../../../../../features/batterycomponent/src/main/ets/default/pages/batteryIcon'
import ClockIcon from '../../../../../../../../../features/clockcomponent/src/main/ets/default/pages/clockIcon'

View File

@ -13,10 +13,8 @@
* limitations under the License.
*/
import {Log} from '@ohos/common'
import WindowManager from '../../../../../../../../common/src/main/ets/default/WindowManager';
import { WindowType } from '@ohos/common'
import Constants, {StatusBarGroupComponentData} from '../common/constants';
import {Log, sWindowManager, WindowType} from '@ohos/common'
import {StatusBarGroupComponentData} from '../common/constants';
const TAG = 'StatusBarVM';
@ -41,7 +39,7 @@ export class StatusBarVM {
return;
}
this.mStatusBarEnable = isEnable;
this.mStatusBarEnable ? WindowManager.showWindow(WindowType.STATUS_BAR) : WindowManager.hideWindow(WindowType.STATUS_BAR);
this.mStatusBarEnable ? sWindowManager.showWindow(WindowType.STATUS_BAR) : sWindowManager.hideWindow(WindowType.STATUS_BAR);
}
getStatusBarGroupComponentData(groupId: string): StatusBarGroupComponentData{

View File

@ -13,8 +13,7 @@
* limitations under the License.
*/
import {Trace} from '@ohos/common'
import {Log} from '@ohos/common'
import {Log, Trace} from '@ohos/common'
import Constants from '../common/constants'
import BaseViewModel, {service, AuthType, AuthSubType} from './baseViewModel'
import {Callback} from '@ohos.base';

View File

@ -13,8 +13,7 @@
* limitations under the License.
*/
import {Log} from '@ohos/common'
import {Trace} from '@ohos/common'
import {Log, Trace} from '@ohos/common'
import Constants from '../common/constants'
import BaseViewModel, {service, AuthType, AuthSubType} from './baseViewModel'
import {Callback} from '@ohos.base';

View File

@ -13,8 +13,7 @@
* limitations under the License.
*/
import {Log} from '@ohos/common'
import {ScreenLockStatus} from '@ohos/common'
import {Log, ScreenLockStatus} from '@ohos/common'
import screenLockService from '../model/screenLockService'
const TAG = 'ScreenLock-LockIconViewModel'

View File

@ -13,9 +13,8 @@
* limitations under the License.
*/
import {Trace} from '@ohos/common'
import {Log} from '@ohos/common'
import BaseViewModel, {service, AuthType, AuthSubType} from './baseViewModel'
import {Log, Trace} from '@ohos/common'
import BaseViewModel, {service, AuthSubType} from './baseViewModel'
import {Callback} from '@ohos.base';
const TAG = 'ScreenLock-MixedPSDViewModel'

View File

@ -16,7 +16,6 @@
import {Log} from '@ohos/common'
import Constants from '../../common/constants'
import ViewModel from '../../vm/shortcutViewModel'
import power from '@ohos.power'
const TAG = 'ScreenLock-Shortcut'

View File

@ -13,15 +13,14 @@
* limitations under the License.
*/
import StyleManager from '../../../../../../../common/src/main/ets/default/StyleManager';
import Constants from './constants'
import {styleManager} from '@ohos/common';
const TAG = 'signal-StyleConfiguration';
export default class StyleConfiguration {
static getSignalComponentStyle() {
const key: string = TAG + "-SignalComponent";
return StyleManager.getStyle(key, () => {
return styleManager.getStyle(key, () => {
return {
cellularImageWidth: $r('app.float.signal_component_icon_width'),
cellularImageHeight: $r('app.float.signal_component_icon_height'),

View File

@ -16,10 +16,7 @@
import Constants from '../common/constants';
import mSignalModel from '../signalModel';
import {Log} from '@ohos/common'
// import {StyleConfigurationCommon} from '../../../../../../../common/src/main/ets/default/StyleConfiguration'
import StyleConfiguration from '../common/StyleConfiguration'
import { StatusBarGroupComponentData
} from '../../../../../../screenlock/src/main/ets/com/ohos/common/constants'
import { StatusBarGroupComponentData} from '../../../../../../screenlock/src/main/ets/com/ohos/common/constants'
import StatusBarVM from '../../../../../../screenlock/src/main/ets/com/ohos/vm/StatusBarVM'
const TAG = 'SignalComponent-SignalIcon'

View File

@ -16,7 +16,6 @@
import {Log} from '@ohos/common'
import ViewModel from '../../vm/wallpaperViewModel'
import Constants from '../../common/constants'
import {Trace} from '@ohos/common'
const TAG = 'ScreenLock-Wallpaper'

View File

@ -13,15 +13,14 @@
* limitations under the License.
*/
import StyleManager from '../../../../../../../common/src/main/ets/default/StyleManager'
import Constants from './constants'
import {styleManager} from '@ohos/common'
const TAG = 'wifi-StyleConfiguration';
export default class StyleConfiguration {
static getStartsBarWifiComponentStyle() {
const key: string = TAG + "-startsBarWifi";
return StyleManager.getStyle(key, () => {
return styleManager.getStyle(key, () => {
return {
statusBarWifiWidth: $r('app.float.status_bar_wifi_width'),
statusBarWifiHeight: $r('app.float.status_bar_wifi_height')

View File

@ -16,10 +16,7 @@
import Constants from '../common/constants'
import mWifiModel from '../wifiModel'
import {Log} from '@ohos/common'
// import {StyleConfigurationCommon} from '../../../../../../../common/src/main/ets/default/StyleConfiguration'
import StyleConfiguration from '../common/StyleConfiguration'
import {StatusBarGroupComponentData
} from '../../../../../../screenlock/src/main/ets/com/ohos/common/constants'
import {StatusBarGroupComponentData} from '../../../../../../screenlock/src/main/ets/com/ohos/common/constants'
import StatusBarVM from '../../../../../../screenlock/src/main/ets/com/ohos/vm/StatusBarVM'
const TAG = 'WifiComponent-WifiIcon'

View File

@ -15,12 +15,9 @@
import ServiceExtension from '@ohos.app.ability.ServiceExtensionAbility'
import windowManager from '@ohos.window'
import WindowManagers, { WindowType } from "../../../../../../common/src/main/ets/default/WindowManager";
import display from '@ohos.display'
import {Log} from '../../../../../../common/src/main/ets/default/Log'
import {Log, AbilityManager, sTimeManager} from '@ohos/common'
import Constants from '../../../../../../features/screenlock/src/main/ets/com/ohos/common/constants'
import {AbilityManager} from '../../../../../../common/src/main/ets/default/abilitymanager/abilityManager'
import sTimeManager from '../../../../../../common/src/main/ets/default/TimeManager'
import inputMethod from '@ohos.inputMethod'
const TAG = "ScreenLock-ServiceExtAbility"

View File

@ -13,8 +13,7 @@
* limitations under the License.
*/
import StyleManager from '../../../../../../common/src/main/ets/default/StyleManager';
import {Log} from '../../../../../../common/src/main/ets/default/Log';
import {Log, styleManager} from '@ohos/common';
const TAG = 'Lock_StatusBar-StyleConfiguration';
@ -22,7 +21,7 @@ export default class StyleConfiguration {
static getIndexStyle() {
Log.showInfo(TAG, `setStyle`)
const key: string = TAG + "-Index";
return StyleManager.getStyle(key, () => {
return styleManager.getStyle(key, () => {
return {};
});
}

View File

@ -13,14 +13,11 @@
* limitations under the License.
*/
import {Log} from '../../../../../../common/src/main/ets/default/Log';
import {AbilityManager} from '../../../../../../common/src/main/ets/default/abilitymanager/abilityManager';
import {StyleConfiguration} from '../../../../../../common/src/main/ets/default/StyleConfiguration';
import {Log, AbilityManager, StyleConfiguration} from '@ohos/common'
import BatteryStyleConfiguration from '../../../../../../features/batterycomponent/src/main/ets/default/common/StyleConfiguration'
import WifiStyleConfiguration from '../../../../../../features/wificomponent/src/main/ets/default/common/StyleConfiguration'
import SignalStyleConfiguration from '../../../../../../features/signalcomponent/src/main/ets/default/common/StyleConfiguration'
import ClockStyleConfiguration from '../../../../../../features/clockcomponent/src/main/ets/default/common/StyleConfiguration';
import IndexStyleConfiguration from './StyleConfiguration'
const TAG = 'Lock-StatusBar-StyleManager';

View File

@ -13,10 +13,7 @@
* limitations under the License.
*/
import {Trace} from '../../../../../../common/src/main/ets/default/Trace'
import {Log} from '../../../../../../common/src/main/ets/default/Log'
import CommonStyleManager from '../../../../../../common/src/main/ets/default/StyleManager'
import {AbilityManager} from '../../../../../../common/src/main/ets/default/abilitymanager/abilityManager'
import {Trace, Log, styleManager as CommonStyleManager, AbilityManager} from '@ohos/common'
import StatusBar from '../../../../../../features/screenlock/src/main/ets/com/ohos/view/component/statusBar'
import CustomPSD from '../../../../../../features/screenlock/src/main/ets/com/ohos/view/component/customPSD'
import Constants from '../common/constants'

View File

@ -13,10 +13,7 @@
* limitations under the License.
*/
import {Trace} from '../../../../../../common/src/main/ets/default/Trace'
import {Log} from '../../../../../../common/src/main/ets/default/Log'
import CommonStyleManager from '../../../../../../common/src/main/ets/default/StyleManager'
import {AbilityManager} from '../../../../../../common/src/main/ets/default/abilitymanager/abilityManager'
import {Log, Trace, styleManager as CommonStyleManager, AbilityManager} from '@ohos/common'
import StatusBar from '../../../../../../features/screenlock/src/main/ets/com/ohos/view/component/statusBar'
import DigitalPSD from '../../../../../../features/screenlock/src/main/ets/com/ohos/view/component/digitalPSD'
import Constants from '../common/constants'

View File

@ -13,10 +13,7 @@
* limitations under the License.
*/
import {Log} from '../../../../../../common/src/main/ets/default/Log'
import {Trace} from '../../../../../../common/src/main/ets/default/Trace'
import CommonStyleManager from '../../../../../../common/src/main/ets/default/StyleManager'
import {AbilityManager} from '../../../../../../common/src/main/ets/default/abilitymanager/abilityManager'
import {Log, Trace, styleManager as CommonStyleManager, AbilityManager} from '@ohos/common'
import {LockStyleMode} from '../../../../../../features/screenlock/src/main/ets/com/ohos/model/screenlockStyle'
import ViewModel from '../vm/indexViewModel'
import SlideScreenLock from './slidescreenlock'

View File

@ -13,10 +13,7 @@
* limitations under the License.
*/
import {Trace} from '../../../../../../common/src/main/ets/default/Trace'
import {Log} from '../../../../../../common/src/main/ets/default/Log'
import CommonStyleManager from '../../../../../../common/src/main/ets/default/StyleManager'
import {AbilityManager} from '../../../../../../common/src/main/ets/default/abilitymanager/abilityManager'
import {Log, Trace, styleManager as CommonStyleManager, AbilityManager} from '@ohos/common'
import StatusBar from '../../../../../../features/screenlock/src/main/ets/com/ohos/view/component/statusBar'
import MixedPSD from '../../../../../../features/screenlock/src/main/ets/com/ohos/view/component/mixedPSD'
import Constants from '../common/constants'

View File

@ -13,9 +13,8 @@
* limitations under the License.
*/
import {Log} from '../../../../../../common/src/main/ets/default/Log';
import ScreenlockStyle, {LockStyleMode
} from '../../../../../../features/screenlock/src/main/ets/com/ohos/model/screenlockStyle'
import {Log} from '@ohos/common'
import ScreenlockStyle, {LockStyleMode} from '../../../../../../features/screenlock/src/main/ets/com/ohos/model/screenlockStyle'
import ScreenLockService from '../../../../../../features/screenlock/src/main/ets/com/ohos/model/screenLockService'
const TAG = 'ScreenLock-IndexViewModel'

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import {Log} from '../../../../../../common/src/main/ets/default/Log';
import {Log} from '@ohos/common'
import ScreenLockService from '../../../../../../features/screenlock/src/main/ets/com/ohos/model/screenLockService'
import Constants from '../common/constants'
import {Callback} from '@ohos.base';

View File

@ -16,10 +16,8 @@
import ServiceExtension from '@ohos.app.ability.ServiceExtensionAbility'
import windowManager from '@ohos.window'
import display from '@ohos.display'
import {Log} from '@ohos/common'
import {Log, AbilityManager, sTimeManager} from '@ohos/common'
import Constants from '../../../../../../features/screenlock/src/main/ets/com/ohos/common/constants'
import {AbilityManager} from '@ohos/common'
import sTimeManager from '../../../../../../common/src/main/ets/default/TimeManager'
import { UIContext } from '@ohos.arkui.UIContext'
const TAG = "ScreenLock-ServiceExtAbility"

View File

@ -13,8 +13,7 @@
* limitations under the License.
*/
import StyleManager from '../../../../../../common/src/main/ets/default/StyleManager';
import {Log} from '@ohos/common'
import {Log, styleManager} from '@ohos/common'
const TAG = 'Lock_StatusBar-StyleConfiguration';
@ -22,7 +21,7 @@ export default class StyleConfiguration {
static getIndexStyle() {
Log.showInfo(TAG, `setStyle`)
const key: string = TAG + "-Index";
return StyleManager.getStyle(key, () => {
return styleManager.getStyle(key, () => {
return {};
});
}

View File

@ -13,9 +13,7 @@
* limitations under the License.
*/
import {Log} from '@ohos/common'
import {AbilityManager} from '@ohos/common'
import IndexStyleConfiguration from './StyleConfiguration'
import {Log, AbilityManager} from '@ohos/common'
const TAG = 'StatusBar-StyleManager';

View File

@ -13,10 +13,7 @@
* limitations under the License.
*/
import {Trace} from '@ohos/common'
import {Log} from '@ohos/common'
import CommonStyleManager from '../../../../../../common/src/main/ets/default/StyleManager'
import {AbilityManager} from '@ohos/common'
import {Log, Trace, styleManager as CommonStyleManager, AbilityManager} from '@ohos/common'
import StatusBar from '../../../../../../features/screenlock/src/main/ets/com/ohos/view/component/statusBar'
import CustomPSD from '../../../../../../features/screenlock/src/main/ets/com/ohos/view/component/customPSD'
import Constants from '../common/constants'

View File

@ -13,10 +13,7 @@
* limitations under the License.
*/
import {Trace} from '@ohos/common'
import {Log} from '@ohos/common'
import CommonStyleManager from '../../../../../../common/src/main/ets/default/StyleManager'
import {AbilityManager} from '@ohos/common'
import {Log, Trace, styleManager as CommonStyleManager, AbilityManager} from '@ohos/common'
import StatusBar from '../../../../../../features/screenlock/src/main/ets/com/ohos/view/component/statusBar'
import DigitalPSD from '../../../../../../features/screenlock/src/main/ets/com/ohos/view/component/digitalPSD'
import Constants from '../common/constants'

View File

@ -13,10 +13,7 @@
* limitations under the License.
*/
import {Log} from '@ohos/common'
import {Trace} from '@ohos/common'
import CommonStyleManager from '../../../../../../common/src/main/ets/default/StyleManager'
import {AbilityManager} from '@ohos/common'
import {Log, Trace, styleManager as CommonStyleManager, AbilityManager} from '@ohos/common'
import {LockStyleMode} from '../../../../../../features/screenlock/src/main/ets/com/ohos/model/screenlockStyle'
import ViewModel from '../vm/indexViewModel'
import SlideScreenLock from './slidescreenlock'

View File

@ -13,10 +13,7 @@
* limitations under the License.
*/
import {Trace} from '@ohos/common'
import {Log} from '@ohos/common'
import CommonStyleManager from '../../../../../../common/src/main/ets/default/StyleManager'
import {AbilityManager} from '@ohos/common'
import {Log, Trace, styleManager as CommonStyleManager, AbilityManager} from '@ohos/common'
import StatusBar from '../../../../../../features/screenlock/src/main/ets/com/ohos/view/component/statusBar'
import MixedPSD from '../../../../../../features/screenlock/src/main/ets/com/ohos/view/component/mixedPSD'
import Constants from '../common/constants'

View File

@ -15,7 +15,6 @@
import {Log} from '@ohos/common'
import Accounts from '../../../../../../features/screenlock/src/main/ets/com/ohos/view/component/accounts'
import {UserData} from '../../../../../../features/screenlock/src/main/ets/com/ohos/data/userData'
import DateTime from '../../../../../../features/datetimecomponent/src/main/ets/com/ohos/view/component/dateTime'
import LockIcon from '../../../../../../features/screenlock/src/main/ets/com/ohos/view/component/lockIcon'
import Wallpaper from '../../../../../../features/wallpapercomponent/src/main/ets/com/ohos/view/component/wallpaper'