From f70d5369e161062959b776a393c019b5493d5e72 Mon Sep 17 00:00:00 2001 From: liminjie10 Date: Wed, 4 Jan 2023 16:13:58 +0800 Subject: [PATCH] =?UTF-8?q?=E8=93=9D=E5=8C=BAmaster:=E5=88=B7=E6=9C=BA?= =?UTF-8?q?=E6=88=96=E6=81=A2=E5=A4=8D=E5=87=BA=E5=8E=82=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E8=87=AA=E5=8A=A8=E4=BA=AE=E5=BA=A6=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=BC=80=E5=90=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liminjie10 --- entry/src/main/ets/Utils/SettingsDBHelper.ets | 5 +++++ entry/src/main/ets/Utils/SettingsDataConfig.ets | 4 +++- entry/src/main/resources/rawfile/default_settings.json | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/entry/src/main/ets/Utils/SettingsDBHelper.ets b/entry/src/main/ets/Utils/SettingsDBHelper.ets index 61f67e7..9c20ac4 100644 --- a/entry/src/main/ets/Utils/SettingsDBHelper.ets +++ b/entry/src/main/ets/Utils/SettingsDBHelper.ets @@ -41,6 +41,8 @@ const DefalutKVGlobal = { "settings.audio.media.default": "5", "settings.audio.voicecall.default": "5", "settings.display.navigationbar_status.default": "1", + "cellular_data_enable.default": "1", + "settings.display.auto_screen_brightness.default": "1" }; const TIME_FORMAT = { @@ -163,6 +165,9 @@ class SettingsDBHelper { await this.loadSettings(this.rdbStore_, SettingsKey.CELLULAR_DATA_ENABLE, defaultKV[DefaultKey.CELLULAR_DATA_ENABLE_DEFAULT]); + await this.loadSettings(this.rdbStore_, + SettingsKey.SETTINGS_DISPLAY_AUTO_SCREEN_BRIGHTNESS, defaultKV[DefaultKey.SETTINGS_DISPLAY_AUTO_SCREEN_BRIGHTNESS_DEFAULT]); + Log.I("loadDefaultSettings end"); return; } diff --git a/entry/src/main/ets/Utils/SettingsDataConfig.ets b/entry/src/main/ets/Utils/SettingsDataConfig.ets index b658497..aa56b46 100644 --- a/entry/src/main/ets/Utils/SettingsDataConfig.ets +++ b/entry/src/main/ets/Utils/SettingsDataConfig.ets @@ -23,6 +23,7 @@ enum DefaultKey { SETTINGS_GENERAL_DEVICE_NAME_DEFAULT = "settings.general.device_name.default", SETTINGS_DISPALY_NAVBAR_STATUS_DEFAULT = "settings.display.navigationbar_status.default", CELLULAR_DATA_ENABLE_DEFAULT = "cellular_data_enable.default", + SETTINGS_DISPLAY_AUTO_SCREEN_BRIGHTNESS_DEFAULT = "settings.display.auto_screen_brightness.default" }; enum SettingsKey { @@ -33,7 +34,8 @@ enum SettingsKey { SETTINGS_AUDIO_VOICE_CALL = "settings.audio.voicecall", SETTINGS_GENERAL_DEVICE_NAME = "settings.general.device_name", SETTINGS_DISPALY_NAVBAR_STATUS = "settings.display.navigationbar_status", - CELLULAR_DATA_ENABLE = "cellular_data_enable" + CELLULAR_DATA_ENABLE = "cellular_data_enable", + SETTINGS_DISPLAY_AUTO_SCREEN_BRIGHTNESS = "settings.display.auto_screen_brightness" }; const SettingsDataConfig = { diff --git a/entry/src/main/resources/rawfile/default_settings.json b/entry/src/main/resources/rawfile/default_settings.json index b081ec4..b25bc20 100644 --- a/entry/src/main/resources/rawfile/default_settings.json +++ b/entry/src/main/resources/rawfile/default_settings.json @@ -27,6 +27,10 @@ { "name": "cellular_data_enable.default", "value": "1" + }, + { + "name": "settings.display.auto_screen_brightness.default", + "value": "1" } ] } \ No newline at end of file