mirror of
https://gitee.com/openharmony/applications_systemui
synced 2025-01-19 22:53:07 +00:00
commit
5eafbb0dec
common/src/main/ets/default
features/airplanecomponent/src/main/ets/default/viewmodel
@ -79,13 +79,13 @@ class TimeManager {
|
||||
private async initTimeFormat(context: any): Promise<void> {
|
||||
Log.showDebug(TAG, "initTimeFormat");
|
||||
if (context == undefined || context == null) {
|
||||
log.showInfo(TAG, `initTimeFormat: ${context}`);
|
||||
Log.showInfo(TAG, `initTimeFormat: ${context}`);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
settings.getValueSync(context, TIME_FORMAT_KEY, "24");
|
||||
} catch (err) {
|
||||
log.showError(TAG, `initTimeFormat: ${context},${JSON.stringify(err)}`)
|
||||
Log.showError(TAG, `initTimeFormat: ${context},${JSON.stringify(err)}`)
|
||||
}
|
||||
this.mSettingsHelper = await dataShare.createDataShareHelper(context, Constants.getUriSync(Constants.KEY_TIME_FORMAT));
|
||||
|
||||
@ -95,7 +95,7 @@ class TimeManager {
|
||||
return;
|
||||
}
|
||||
if (context == undefined || context == null) {
|
||||
log.showInfo(TAG, `handleTimeFormatChange: ${context}`);
|
||||
Log.showInfo(TAG, `handleTimeFormatChange: ${context}`);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
@ -103,7 +103,7 @@ class TimeManager {
|
||||
Log.showDebug(TAG, `timeFormat change: ${timeString}`);
|
||||
this.mUse24hFormat = timeString == "24";
|
||||
} catch (err) {
|
||||
log.showError(TAG, `handleTimeFormatChange: ${context},${JSON.stringify(err)}`)
|
||||
Log.showError(TAG, `handleTimeFormatChange: ${context},${JSON.stringify(err)}`)
|
||||
}
|
||||
this.notifyTimeChange();
|
||||
};
|
||||
|
@ -39,14 +39,14 @@ class AirplaneVM implements AirplaneServiceListener {
|
||||
constructor() {
|
||||
this.context = AbilityManager.getContext(AbilityManager.getContextName(AbilityManager.ABILITY_NAME_CONTROL_PANEL));
|
||||
if (this.context == undefined || this.context == null) {
|
||||
log.showInfo(TAG, `constructor: ${context}`);
|
||||
Log.showInfo(TAG, `constructor: ${context}`);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.mAirplaneStatus =
|
||||
settings.getValueSync(this.context, Constants.KEY_AIRPLANE_MODE_STATUS, AIRPLANE_MODE_STATUS.OFF) === AIRPLANE_MODE_STATUS.ON
|
||||
} catch (err) {
|
||||
log.showError(TAG, `AirplaneVM: ${context}, ${JSON.stringify(err)}`);
|
||||
Log.showError(TAG, `AirplaneVM: ${context}, ${JSON.stringify(err)}`);
|
||||
}
|
||||
AppStorage.SetOrCreate('Airplane_Status', this.mAirplaneStatus);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user