From 79d2a2f4bcf45af8557a3146505b4c3f1d2532ac Mon Sep 17 00:00:00 2001 From: Narinder Rana Date: Mon, 12 Apr 2021 20:17:31 +0530 Subject: [PATCH 1/5] add new variable HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON and Validator --- .../lineageos/providers/LineageSettings.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sdk/src/java/lineageos/providers/LineageSettings.java b/sdk/src/java/lineageos/providers/LineageSettings.java index 359eddb5..be47e7f4 100644 --- a/sdk/src/java/lineageos/providers/LineageSettings.java +++ b/sdk/src/java/lineageos/providers/LineageSettings.java @@ -1698,10 +1698,24 @@ public final class LineageSettings { public static final String LOCKSCREEN_PIN_SCRAMBLE_LAYOUT = "lockscreen_scramble_pin_layout"; + /** @hide */ public static final Validator LOCKSCREEN_PIN_SCRAMBLE_LAYOUT_VALIDATOR = sBooleanValidator; + + /** + * hide notificationIcon area & move Right to left System iocn area + * 0 = 0ff, 1 = on + */ + public static final String HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON = + "hide_notificationIcon_left_system_icon"; + + /** @hide */ + public static final Validator HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON_VALIDATOR = + sBooleanValidator; + + /** * Whether keyguard will rotate to landscape mode * 0 = false, 1 = true @@ -2178,6 +2192,7 @@ public final class LineageSettings { LineageSettings.System.T9_SEARCH_INPUT_LOCALE, LineageSettings.System.BLUETOOTH_ACCEPT_ALL_FILES, LineageSettings.System.LOCKSCREEN_PIN_SCRAMBLE_LAYOUT, + LineageSettings.System.HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON, LineageSettings.System.SHOW_ALARM_ICON, LineageSettings.System.STATUS_BAR_IME_SWITCHER, LineageSettings.System.QS_SHOW_BRIGHTNESS_SLIDER, @@ -2213,6 +2228,7 @@ public final class LineageSettings { LineageSettings.System.HEADSET_CONNECT_PLAYER, LineageSettings.System.ZEN_ALLOW_LIGHTS, LineageSettings.System.TOUCHSCREEN_GESTURE_HAPTIC_FEEDBACK, + }; /** @@ -2324,6 +2340,8 @@ public final class LineageSettings { VALIDATORS.put(BLUETOOTH_ACCEPT_ALL_FILES, BLUETOOTH_ACCEPT_ALL_FILES_VALIDATOR); VALIDATORS.put(LOCKSCREEN_PIN_SCRAMBLE_LAYOUT, LOCKSCREEN_PIN_SCRAMBLE_LAYOUT_VALIDATOR); + VALIDATORS.put(HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON, + HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON_VALIDATOR); VALIDATORS.put(LOCKSCREEN_ROTATION, LOCKSCREEN_ROTATION_VALIDATOR); VALIDATORS.put(SHOW_ALARM_ICON, SHOW_ALARM_ICON_VALIDATOR); VALIDATORS.put(STATUS_BAR_IME_SWITCHER, STATUS_BAR_IME_SWITCHER_VALIDATOR); -- GitLab From 0c3f3f62b719cf1784a322600f2bd64a7a39d197 Mon Sep 17 00:00:00 2001 From: Narinder Rana Date: Wed, 14 Apr 2021 12:09:18 +0530 Subject: [PATCH 2/5] add new Switch preference --- .../HideNotificationSwitchPreference.java | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 sdk/src/java/lineageos/preference/HideNotificationSwitchPreference.java diff --git a/sdk/src/java/lineageos/preference/HideNotificationSwitchPreference.java b/sdk/src/java/lineageos/preference/HideNotificationSwitchPreference.java new file mode 100644 index 00000000..91da737b --- /dev/null +++ b/sdk/src/java/lineageos/preference/HideNotificationSwitchPreference.java @@ -0,0 +1,62 @@ +/** + * Copyright (C) 2014-2016 The CyanogenMod Project + * Copyright (C) 2018 The LineageOS Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package lineageos.preference; + +import android.content.Context; +import android.provider.Settings; +import android.util.AttributeSet; +import android.util.Log; + + +public class HideNotificationSwitchPreference extends SelfRemovingSwitchPreference { + + public HideNotificationSwitchPreference(Context context, AttributeSet attrs, int defStyle) { + super(context, attrs, defStyle); + Log.e("Lineage SDK....", "HideNotificationSwitchPreference ..................... 1"); + } + + public HideNotificationSwitchPreference(Context context, AttributeSet attrs) { + super(context, attrs); + Log.e("Lineage SDK....", "HideNotificationSwitchPreference ..................... 2"); + } + + public HideNotificationSwitchPreference(Context context) { + + super(context, null); + Log.e("Lineage SDK....", "HideNotificationSwitchPreference ..................... 3"); + } + + @Override + protected boolean isPersisted() { + Log.e("Lineage SDK....", "HideNotificationSwitchPreference ..................... 4"); + return Settings.Global.getString(getContext().getContentResolver(), getKey()) != null; + } + + @Override + protected void putBoolean(String key, boolean value) { + Log.e("Lineage SDK....", "HideNotificationSwitchPreference ..................... 5 key...."+key+"......value....."+value); + Settings.Global.putInt(getContext().getContentResolver(), key, value ? 1 : 0); + } + + @Override + protected boolean getBoolean(String key, boolean defaultValue) { + Log.e("Lineage SDK....", "HideNotificationSwitchPreference ..................... 6 key...."+key+"......value....."+defaultValue); + return Settings.Global.getInt(getContext().getContentResolver(), + key, defaultValue ? 1 : 0) != 0; + } +} -- GitLab From fae6512fe06adb93a8e37c56be970af8277b9e8c Mon Sep 17 00:00:00 2001 From: Narinder Rana Date: Wed, 14 Apr 2021 16:48:42 +0530 Subject: [PATCH 3/5] update link Setting.Gloable to LineageSettings.System --- .../preference/HideNotificationSwitchPreference.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/src/java/lineageos/preference/HideNotificationSwitchPreference.java b/sdk/src/java/lineageos/preference/HideNotificationSwitchPreference.java index 91da737b..908979ad 100644 --- a/sdk/src/java/lineageos/preference/HideNotificationSwitchPreference.java +++ b/sdk/src/java/lineageos/preference/HideNotificationSwitchPreference.java @@ -44,19 +44,19 @@ public class HideNotificationSwitchPreference extends SelfRemovingSwitchPreferen @Override protected boolean isPersisted() { Log.e("Lineage SDK....", "HideNotificationSwitchPreference ..................... 4"); - return Settings.Global.getString(getContext().getContentResolver(), getKey()) != null; + return LineageSettings.System.getString(getContext().getContentResolver(), getKey()) != null; } @Override protected void putBoolean(String key, boolean value) { Log.e("Lineage SDK....", "HideNotificationSwitchPreference ..................... 5 key...."+key+"......value....."+value); - Settings.Global.putInt(getContext().getContentResolver(), key, value ? 1 : 0); + LineageSettings.System.putInt(getContext().getContentResolver(), key, value ? 1 : 0); } @Override protected boolean getBoolean(String key, boolean defaultValue) { Log.e("Lineage SDK....", "HideNotificationSwitchPreference ..................... 6 key...."+key+"......value....."+defaultValue); - return Settings.Global.getInt(getContext().getContentResolver(), + return LineageSettings.System.getInt(getContext().getContentResolver(), key, defaultValue ? 1 : 0) != 0; } } -- GitLab From 9684ab4c02a71a4bcd7f88c8c0bd047b9f711b12 Mon Sep 17 00:00:00 2001 From: Narinder Rana Date: Wed, 14 Apr 2021 17:14:15 +0530 Subject: [PATCH 4/5] update link Setting.Gloable to LineageSettings.System : bug fixed --- .../lineageos/preference/HideNotificationSwitchPreference.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/src/java/lineageos/preference/HideNotificationSwitchPreference.java b/sdk/src/java/lineageos/preference/HideNotificationSwitchPreference.java index 908979ad..25f6ac85 100644 --- a/sdk/src/java/lineageos/preference/HideNotificationSwitchPreference.java +++ b/sdk/src/java/lineageos/preference/HideNotificationSwitchPreference.java @@ -21,7 +21,7 @@ import android.content.Context; import android.provider.Settings; import android.util.AttributeSet; import android.util.Log; - +import lineageos.providers.LineageSettings; public class HideNotificationSwitchPreference extends SelfRemovingSwitchPreference { -- GitLab From 95d390760cf6a78bf632aae0a3169330dd61f904 Mon Sep 17 00:00:00 2001 From: Narinder Rana Date: Wed, 14 Apr 2021 21:17:43 +0530 Subject: [PATCH 5/5] update link Setting.Gloable to LineageSettings.System : bug fixed --- .../lineageos/preference/HideNotificationSwitchPreference.java | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/src/java/lineageos/preference/HideNotificationSwitchPreference.java b/sdk/src/java/lineageos/preference/HideNotificationSwitchPreference.java index 25f6ac85..4dc480af 100644 --- a/sdk/src/java/lineageos/preference/HideNotificationSwitchPreference.java +++ b/sdk/src/java/lineageos/preference/HideNotificationSwitchPreference.java @@ -22,6 +22,7 @@ import android.provider.Settings; import android.util.AttributeSet; import android.util.Log; import lineageos.providers.LineageSettings; +import lineageos.providers.LineageSettings.System; public class HideNotificationSwitchPreference extends SelfRemovingSwitchPreference { -- GitLab