From f19145e4c73bd415f5e8f7452b0fe69fdbe4efdb Mon Sep 17 00:00:00 2001 From: Narinder Rana Date: Tue, 9 Mar 2021 13:04:32 +0530 Subject: [PATCH 01/17] add SwitchPreference Setting >> app and Notification > notification --- res/values/strings.xml | 2 + res/xml/configure_notification_settings.xml | 5 ++ ...NotificationIconsPreferenceController.java | 57 +++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 src/com/android/settings/notification/HideNotificationIconsPreferenceController.java diff --git a/res/values/strings.xml b/res/values/strings.xml index feb3ec4477b..1a48f722645 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -7985,6 +7985,8 @@ Allow notification snoozing + Hide notification icons + Hide icons from gentle notifications diff --git a/res/xml/configure_notification_settings.xml b/res/xml/configure_notification_settings.xml index 067df25366d..f300c6eacf6 100644 --- a/res/xml/configure_notification_settings.xml +++ b/res/xml/configure_notification_settings.xml @@ -92,6 +92,11 @@ android:title="@string/snooze_options_title" settings:controller="com.android.settings.notification.SnoozeNotificationPreferenceController" /> + + Date: Wed, 10 Mar 2021 08:40:37 +0530 Subject: [PATCH 02/17] add SwitchPreference Setting : Test --- ...ideNotificationIconsPreferenceController.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/com/android/settings/notification/HideNotificationIconsPreferenceController.java b/src/com/android/settings/notification/HideNotificationIconsPreferenceController.java index 58dc75ccce3..f2e6a4c08dc 100644 --- a/src/com/android/settings/notification/HideNotificationIconsPreferenceController.java +++ b/src/com/android/settings/notification/HideNotificationIconsPreferenceController.java @@ -33,6 +33,13 @@ public class HideNotificationIconsPreferenceController extends TogglePreferenceC @VisibleForTesting static final int OFF = 0; + /* + mContext.getResources() + .getBoolean(com.android.internal.R.bool.config_hide_notificationIcons) + ? AVAILABLE : UNSUPPORTED_ON_DEVICE; + + * */ + public HideNotificationIconsPreferenceController(Context context, String preferenceKey) { super(context, preferenceKey); } @@ -44,14 +51,13 @@ public class HideNotificationIconsPreferenceController extends TogglePreferenceC @Override public boolean isChecked() { - - return Settings.Secure.getInt(mContext.getContentResolver(), - SHOW_NOTIFICATION_SNOOZE, OFF) == ON; + return mContext.getResources() + .getBoolean(com.android.internal.R.bool.config_hide_notificationIcons); } @Override public boolean setChecked(boolean isChecked) { - return Settings.Secure.putInt(mContext.getContentResolver(), - SHOW_NOTIFICATION_SNOOZE, isChecked ? ON : OFF); + + return isChecked;//Settings.Secure.putInt(mContext.getContentResolver(),SHOW_NOTIFICATION_SNOOZE, isChecked ? ON : OFF); } } -- GitLab From 666a2a7dd2c795561b19bbe0595104b1b52baa9d Mon Sep 17 00:00:00 2001 From: Narinder Rana Date: Wed, 10 Mar 2021 10:28:21 +0530 Subject: [PATCH 03/17] add SwitchPreference Setting : Test --- .../HideNotificationIconsPreferenceController.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/com/android/settings/notification/HideNotificationIconsPreferenceController.java b/src/com/android/settings/notification/HideNotificationIconsPreferenceController.java index f2e6a4c08dc..d15e21245af 100644 --- a/src/com/android/settings/notification/HideNotificationIconsPreferenceController.java +++ b/src/com/android/settings/notification/HideNotificationIconsPreferenceController.java @@ -51,8 +51,9 @@ public class HideNotificationIconsPreferenceController extends TogglePreferenceC @Override public boolean isChecked() { - return mContext.getResources() - .getBoolean(com.android.internal.R.bool.config_hide_notificationIcons); + return true; +// return mContext.getResources() +// .getBoolean(com.android.internal.R.bool.config_hide_notificationIcons); } @Override -- GitLab From 0884b07293da79d775a705962818c0ea9925941b Mon Sep 17 00:00:00 2001 From: Narinder Rana Date: Wed, 10 Mar 2021 21:03:59 +0530 Subject: [PATCH 04/17] add SwitchPreference Setting : remove controller --- res/xml/configure_notification_settings.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/res/xml/configure_notification_settings.xml b/res/xml/configure_notification_settings.xml index f300c6eacf6..d420967c641 100644 --- a/res/xml/configure_notification_settings.xml +++ b/res/xml/configure_notification_settings.xml @@ -94,9 +94,10 @@ - + /> + Date: Wed, 10 Mar 2021 21:05:24 +0530 Subject: [PATCH 05/17] add SwitchPreference Setting : add request config --- res/xml/configure_notification_settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/xml/configure_notification_settings.xml b/res/xml/configure_notification_settings.xml index d420967c641..5015bd7368e 100644 --- a/res/xml/configure_notification_settings.xml +++ b/res/xml/configure_notification_settings.xml @@ -94,7 +94,7 @@ -- GitLab From 08e496eb73ab5bc0d6aa2b7cb8da0b59ac2db9c4 Mon Sep 17 00:00:00 2001 From: Narinder Rana Date: Mon, 12 Apr 2021 20:16:22 +0530 Subject: [PATCH 06/17] add Hide Notification Preference Controller to LineageSettings.System variable --- ...NotificationIconsPreferenceController.java | 60 ++++++++++--------- 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/src/com/android/settings/notification/HideNotificationIconsPreferenceController.java b/src/com/android/settings/notification/HideNotificationIconsPreferenceController.java index d15e21245af..077ce99cc81 100644 --- a/src/com/android/settings/notification/HideNotificationIconsPreferenceController.java +++ b/src/com/android/settings/notification/HideNotificationIconsPreferenceController.java @@ -16,49 +16,55 @@ package com.android.settings.notification; +import android.app.admin.DevicePolicyManager; import android.content.Context; -import android.provider.Settings; +import androidx.preference.Preference; +import androidx.preference.TwoStatePreference; -import androidx.annotation.VisibleForTesting; +import com.android.internal.widget.LockPatternUtils; +import com.android.settings.core.PreferenceControllerMixin; +import com.android.settingslib.core.AbstractPreferenceController; +//PinScramblePreferenceController -import com.android.settings.core.TogglePreferenceController; +public class HideNotificationIconsPreferenceController extends AbstractPreferenceController + implements PreferenceControllerMixin, Preference.OnPreferenceChangeListener { -import static android.provider.Settings.Secure.SHOW_NOTIFICATION_SNOOZE; + static final String HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON = "hide_notificationIcon_left_system_icon"; -public class HideNotificationIconsPreferenceController extends TogglePreferenceController { - - private static final String TAG = "HideNotificationIconsPreferenceController"; - @VisibleForTesting - static final int ON = 1; - @VisibleForTesting - static final int OFF = 0; + public HideNotificationIconsPreferenceController(Context context) { + super(context); + } - /* - mContext.getResources() - .getBoolean(com.android.internal.R.bool.config_hide_notificationIcons) - ? AVAILABLE : UNSUPPORTED_ON_DEVICE; - * */ + @Override + public boolean isAvailable() { + return true; + } - public HideNotificationIconsPreferenceController(Context context, String preferenceKey) { - super(context, preferenceKey); + @Override + public String getPreferenceKey() { + return HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON; } @Override - public int getAvailabilityStatus() { - return AVAILABLE; + public void updateState(Preference preference) { + ((TwoStatePreference) preference).setChecked(LineageSettings.System.getInt( + mContext.getContentResolver(), + LineageSettings.System.HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON, + 0) == 1); } + + @Override - public boolean isChecked() { + public boolean onPreferenceChange(Preference preference, Object newValue) { + LineageSettings.System.putInt( + mContext.getContentResolver(), + LineageSettings.System.HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON, + (Boolean) newValue ? 1 : 0); return true; -// return mContext.getResources() -// .getBoolean(com.android.internal.R.bool.config_hide_notificationIcons); } - @Override - public boolean setChecked(boolean isChecked) { - return isChecked;//Settings.Secure.putInt(mContext.getContentResolver(),SHOW_NOTIFICATION_SNOOZE, isChecked ? ON : OFF); - } + } -- GitLab From 8e7e57f35deb40ae010967b8e2cb9b0d3b5510b6 Mon Sep 17 00:00:00 2001 From: Narinder Rana Date: Mon, 12 Apr 2021 21:11:34 +0530 Subject: [PATCH 07/17] add Hide Notification Preference Controller to LineageSettings.System variable : bug fix --- .../notification/HideNotificationIconsPreferenceController.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/com/android/settings/notification/HideNotificationIconsPreferenceController.java b/src/com/android/settings/notification/HideNotificationIconsPreferenceController.java index 077ce99cc81..299dcf2a619 100644 --- a/src/com/android/settings/notification/HideNotificationIconsPreferenceController.java +++ b/src/com/android/settings/notification/HideNotificationIconsPreferenceController.java @@ -24,6 +24,7 @@ import androidx.preference.TwoStatePreference; import com.android.internal.widget.LockPatternUtils; import com.android.settings.core.PreferenceControllerMixin; import com.android.settingslib.core.AbstractPreferenceController; +import lineageos.providers.LineageSettings; //PinScramblePreferenceController public class HideNotificationIconsPreferenceController extends AbstractPreferenceController -- GitLab From d59ab489de289a4d369e54606ef63ed9b5752f16 Mon Sep 17 00:00:00 2001 From: Narinder Rana Date: Mon, 12 Apr 2021 21:32:16 +0530 Subject: [PATCH 08/17] add Hide Notification Preference Controller to LineageSettings.System variable : bug fix --- res/xml/configure_notification_settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/xml/configure_notification_settings.xml b/res/xml/configure_notification_settings.xml index 5015bd7368e..2f65b95d0d8 100644 --- a/res/xml/configure_notification_settings.xml +++ b/res/xml/configure_notification_settings.xml @@ -94,8 +94,8 @@ Date: Tue, 13 Apr 2021 19:22:20 +0530 Subject: [PATCH 09/17] Log for testing and tracking --- .../HideNotificationIconsPreferenceController.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/com/android/settings/notification/HideNotificationIconsPreferenceController.java b/src/com/android/settings/notification/HideNotificationIconsPreferenceController.java index 299dcf2a619..3fbec0d9dd7 100644 --- a/src/com/android/settings/notification/HideNotificationIconsPreferenceController.java +++ b/src/com/android/settings/notification/HideNotificationIconsPreferenceController.java @@ -25,6 +25,7 @@ import com.android.internal.widget.LockPatternUtils; import com.android.settings.core.PreferenceControllerMixin; import com.android.settingslib.core.AbstractPreferenceController; import lineageos.providers.LineageSettings; +import android.util.Log; //PinScramblePreferenceController public class HideNotificationIconsPreferenceController extends AbstractPreferenceController @@ -39,26 +40,34 @@ public class HideNotificationIconsPreferenceController extends AbstractPreferenc @Override public boolean isAvailable() { + Log.e("Setting....", "Setting ...isAvailable "); + // LineageSettings.System.HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON; return true; } @Override public String getPreferenceKey() { + Log.e("Setting....", "Setting ...getPreferenceKey "); return HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON; } @Override public void updateState(Preference preference) { + Log.e("Setting....", "Setting ...updateState "); ((TwoStatePreference) preference).setChecked(LineageSettings.System.getInt( mContext.getContentResolver(), LineageSettings.System.HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON, 0) == 1); + + } @Override public boolean onPreferenceChange(Preference preference, Object newValue) { + + Log.e("Setting....", "Setting ...onPreferenceChange "); LineageSettings.System.putInt( mContext.getContentResolver(), LineageSettings.System.HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON, -- GitLab From b5e7efdb2f654f8905c376550c80c419f718f986 Mon Sep 17 00:00:00 2001 From: Narinder Rana Date: Tue, 13 Apr 2021 21:16:41 +0530 Subject: [PATCH 10/17] update to TogglePreferenceController --- ...NotificationIconsPreferenceController.java | 107 ++++++++++++------ 1 file changed, 74 insertions(+), 33 deletions(-) diff --git a/src/com/android/settings/notification/HideNotificationIconsPreferenceController.java b/src/com/android/settings/notification/HideNotificationIconsPreferenceController.java index 3fbec0d9dd7..7affaba371e 100644 --- a/src/com/android/settings/notification/HideNotificationIconsPreferenceController.java +++ b/src/com/android/settings/notification/HideNotificationIconsPreferenceController.java @@ -26,55 +26,96 @@ import com.android.settings.core.PreferenceControllerMixin; import com.android.settingslib.core.AbstractPreferenceController; import lineageos.providers.LineageSettings; import android.util.Log; -//PinScramblePreferenceController -public class HideNotificationIconsPreferenceController extends AbstractPreferenceController - implements PreferenceControllerMixin, Preference.OnPreferenceChangeListener { - static final String HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON = "hide_notificationIcon_left_system_icon"; +import android.content.Context; +import android.provider.Settings; - public HideNotificationIconsPreferenceController(Context context) { - super(context); - } +import com.android.settings.core.TogglePreferenceController; +import androidx.annotation.VisibleForTesting; - @Override - public boolean isAvailable() { - Log.e("Setting....", "Setting ...isAvailable "); - // LineageSettings.System.HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON; - return true; +//PinScramblePreferenceController + +public class HideNotificationIconsPreferenceController extends TogglePreferenceController { + + private static final String TAG = "HideNotificationIconsPreferenceController"; + @VisibleForTesting + static final int ON = 1; + @VisibleForTesting + static final int OFF = 0; + + public HideNotificationIconsPreferenceController(Context context, String preferenceKey) { + super(context, preferenceKey); } @Override - public String getPreferenceKey() { - Log.e("Setting....", "Setting ...getPreferenceKey "); - return HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON; + public int getAvailabilityStatus() { + return AVAILABLE; } @Override - public void updateState(Preference preference) { - Log.e("Setting....", "Setting ...updateState "); - ((TwoStatePreference) preference).setChecked(LineageSettings.System.getInt( - mContext.getContentResolver(), - LineageSettings.System.HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON, - 0) == 1); - - + public boolean isChecked() { + return Settings.Secure.getInt(mContext.getContentResolver(), + LineageSettings.System.HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON, OFF) == ON; } - - @Override - public boolean onPreferenceChange(Preference preference, Object newValue) { - - Log.e("Setting....", "Setting ...onPreferenceChange "); - LineageSettings.System.putInt( - mContext.getContentResolver(), - LineageSettings.System.HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON, - (Boolean) newValue ? 1 : 0); - return true; + public boolean setChecked(boolean isChecked) { + return Settings.Secure.putInt(mContext.getContentResolver(), + LineageSettings.System.HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON, isChecked ? ON : OFF); } +// +// +// +// AbstractPreferenceController +// implements PreferenceControllerMixin, Preference.OnPreferenceChangeListener { +// +// static final String HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON = "hide_notificationIcon_left_system_icon"; +// +// public HideNotificationIconsPreferenceController(Context context) { +// super(context); +// } +// +// +// @Override +// public boolean isAvailable() { +// Log.e("Setting....", "Setting ...isAvailable "); +// // LineageSettings.System.HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON; +// return true; +// } +// +// @Override +// public String getPreferenceKey() { +// Log.e("Setting....", "Setting ...getPreferenceKey "); +// return HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON; +// } +// +// @Override +// public void updateState(Preference preference) { +// Log.e("Setting....", "Setting ...updateState "); +// ((TwoStatePreference) preference).setChecked(LineageSettings.System.getInt( +// mContext.getContentResolver(), +// LineageSettings.System.HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON, +// 0) == 1); +// +// +// } +// +// +// +// @Override +// public boolean onPreferenceChange(Preference preference, Object newValue) { +// +// Log.e("Setting....", "Setting ...onPreferenceChange "); +// LineageSettings.System.putInt( +// mContext.getContentResolver(), +// LineageSettings.System.HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON, +// (Boolean) newValue ? 1 : 0); +// return true; +// } + } -- GitLab From f64e6f2f6ca0e74628cd480949f96883cd9bfb30 Mon Sep 17 00:00:00 2001 From: Narinder Rana Date: Tue, 13 Apr 2021 22:18:19 +0530 Subject: [PATCH 11/17] update to TogglePreferenceController : log's --- .../HideNotificationIconsPreferenceController.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/com/android/settings/notification/HideNotificationIconsPreferenceController.java b/src/com/android/settings/notification/HideNotificationIconsPreferenceController.java index 7affaba371e..24576f0f08e 100644 --- a/src/com/android/settings/notification/HideNotificationIconsPreferenceController.java +++ b/src/com/android/settings/notification/HideNotificationIconsPreferenceController.java @@ -46,22 +46,29 @@ public class HideNotificationIconsPreferenceController extends TogglePreferenceC static final int OFF = 0; public HideNotificationIconsPreferenceController(Context context, String preferenceKey) { + super(context, preferenceKey); + + Log.e("Setting....", "Setting ...HideNotificationIconsPreferenceController.................. "); } @Override public int getAvailabilityStatus() { + Log.e("Setting....", "Setting ...getAvailabilityStatus.................. "); + return AVAILABLE; } @Override public boolean isChecked() { + Log.e("Setting....", "Setting ...isChecked.................. "); return Settings.Secure.getInt(mContext.getContentResolver(), LineageSettings.System.HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON, OFF) == ON; } @Override public boolean setChecked(boolean isChecked) { + Log.e("Setting....", "Setting ...setChecked.................. "+isChecked); return Settings.Secure.putInt(mContext.getContentResolver(), LineageSettings.System.HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON, isChecked ? ON : OFF); } -- GitLab From f23af7ec906a1c720d9fb0ad3b7eb19909b841ad Mon Sep 17 00:00:00 2001 From: Narinder Rana Date: Wed, 14 Apr 2021 10:43:50 +0530 Subject: [PATCH 12/17] update to TogglePreferenceController : log's --- .../HideNotificationIconsPreferenceController.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/notification/HideNotificationIconsPreferenceController.java b/src/com/android/settings/notification/HideNotificationIconsPreferenceController.java index 24576f0f08e..3d4f856dae5 100644 --- a/src/com/android/settings/notification/HideNotificationIconsPreferenceController.java +++ b/src/com/android/settings/notification/HideNotificationIconsPreferenceController.java @@ -61,7 +61,10 @@ public class HideNotificationIconsPreferenceController extends TogglePreferenceC @Override public boolean isChecked() { + + Log.e("Setting....", "Setting ...isChecked.................. "); + return Settings.Secure.getInt(mContext.getContentResolver(), LineageSettings.System.HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON, OFF) == ON; } @@ -69,8 +72,14 @@ public class HideNotificationIconsPreferenceController extends TogglePreferenceC @Override public boolean setChecked(boolean isChecked) { Log.e("Setting....", "Setting ...setChecked.................. "+isChecked); - return Settings.Secure.putInt(mContext.getContentResolver(), + Log.e("Setting....", "Setting ...value .................. "+LineageSettings.System.HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON); + boolean out=Settings.Secure.putInt(mContext.getContentResolver(), LineageSettings.System.HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON, isChecked ? ON : OFF); + + Log.e("Setting....", "Setting ...setChecked.........out......... "+out); + + Log.e("Setting....", "Setting ...setChecked.........HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON......... "+LineageSettings.System.HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON); + return out; } // -- GitLab From be061f8e142ff941c57465e4610172c4e288e57d Mon Sep 17 00:00:00 2001 From: Narinder Rana Date: Wed, 14 Apr 2021 12:09:56 +0530 Subject: [PATCH 13/17] add lineageos.preference.HideNotificationSwitchPreference --- res/xml/configure_notification_settings.xml | 17 ++++-- ...NotificationIconsPreferenceController.java | 59 ------------------- 2 files changed, 13 insertions(+), 63 deletions(-) diff --git a/res/xml/configure_notification_settings.xml b/res/xml/configure_notification_settings.xml index 2f65b95d0d8..c3473c4a37d 100644 --- a/res/xml/configure_notification_settings.xml +++ b/res/xml/configure_notification_settings.xml @@ -92,11 +92,18 @@ android:title="@string/snooze_options_title" settings:controller="com.android.settings.notification.SnoozeNotificationPreferenceController" /> - + + + + + + + /> + + + + Date: Wed, 14 Apr 2021 14:14:38 +0530 Subject: [PATCH 14/17] update key --- res/xml/configure_notification_settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/xml/configure_notification_settings.xml b/res/xml/configure_notification_settings.xml index c3473c4a37d..2b3c3cc1824 100644 --- a/res/xml/configure_notification_settings.xml +++ b/res/xml/configure_notification_settings.xml @@ -99,7 +99,7 @@ -- GitLab From fe3669faa5c5a675061a2202ac0b1da76511a3d3 Mon Sep 17 00:00:00 2001 From: Narinder Rana Date: Wed, 14 Apr 2021 16:42:02 +0530 Subject: [PATCH 15/17] update key hide_notificationIcon_left_system_icon as in lineageOS Sdk --- res/xml/configure_notification_settings.xml | 2 +- ...NotificationIconsPreferenceController.java | 59 +++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) diff --git a/res/xml/configure_notification_settings.xml b/res/xml/configure_notification_settings.xml index 2b3c3cc1824..00d024bbcfe 100644 --- a/res/xml/configure_notification_settings.xml +++ b/res/xml/configure_notification_settings.xml @@ -99,7 +99,7 @@ diff --git a/src/com/android/settings/notification/HideNotificationIconsPreferenceController.java b/src/com/android/settings/notification/HideNotificationIconsPreferenceController.java index 69eb5bab7cf..3d4f856dae5 100644 --- a/src/com/android/settings/notification/HideNotificationIconsPreferenceController.java +++ b/src/com/android/settings/notification/HideNotificationIconsPreferenceController.java @@ -49,15 +49,22 @@ public class HideNotificationIconsPreferenceController extends TogglePreferenceC super(context, preferenceKey); + Log.e("Setting....", "Setting ...HideNotificationIconsPreferenceController.................. "); } @Override public int getAvailabilityStatus() { + Log.e("Setting....", "Setting ...getAvailabilityStatus.................. "); + return AVAILABLE; } @Override public boolean isChecked() { + + + Log.e("Setting....", "Setting ...isChecked.................. "); + return Settings.Secure.getInt(mContext.getContentResolver(), LineageSettings.System.HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON, OFF) == ON; } @@ -75,4 +82,56 @@ public class HideNotificationIconsPreferenceController extends TogglePreferenceC return out; } +// +// +// +// AbstractPreferenceController +// implements PreferenceControllerMixin, Preference.OnPreferenceChangeListener { +// +// static final String HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON = "hide_notificationIcon_left_system_icon"; +// +// public HideNotificationIconsPreferenceController(Context context) { +// super(context); +// } +// +// +// @Override +// public boolean isAvailable() { +// Log.e("Setting....", "Setting ...isAvailable "); +// // LineageSettings.System.HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON; +// return true; +// } +// +// @Override +// public String getPreferenceKey() { +// Log.e("Setting....", "Setting ...getPreferenceKey "); +// return HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON; +// } +// +// @Override +// public void updateState(Preference preference) { +// Log.e("Setting....", "Setting ...updateState "); +// ((TwoStatePreference) preference).setChecked(LineageSettings.System.getInt( +// mContext.getContentResolver(), +// LineageSettings.System.HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON, +// 0) == 1); +// +// +// } +// +// +// +// @Override +// public boolean onPreferenceChange(Preference preference, Object newValue) { +// +// Log.e("Setting....", "Setting ...onPreferenceChange "); +// LineageSettings.System.putInt( +// mContext.getContentResolver(), +// LineageSettings.System.HIDE_NOTIFICATIONICON_LEFT_SYSTEM_ICON, +// (Boolean) newValue ? 1 : 0); +// return true; +// } + + + } -- GitLab From 94ab5b4332db72a0723c70c8dfff9aab8e44c7a8 Mon Sep 17 00:00:00 2001 From: Narinder Rana Date: Thu, 15 Apr 2021 12:55:30 +0530 Subject: [PATCH 16/17] app:defaultValue="true" --- res/xml/configure_notification_settings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/res/xml/configure_notification_settings.xml b/res/xml/configure_notification_settings.xml index 00d024bbcfe..10d86bcbc03 100644 --- a/res/xml/configure_notification_settings.xml +++ b/res/xml/configure_notification_settings.xml @@ -99,6 +99,7 @@ -- GitLab From 27ae801346fc010152b8307a9a4b922c2fe47511 Mon Sep 17 00:00:00 2001 From: Narinder Rana Date: Thu, 15 Apr 2021 12:57:12 +0530 Subject: [PATCH 17/17] defaultValue="true" --- res/xml/configure_notification_settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/xml/configure_notification_settings.xml b/res/xml/configure_notification_settings.xml index 10d86bcbc03..96c52e8507b 100644 --- a/res/xml/configure_notification_settings.xml +++ b/res/xml/configure_notification_settings.xml @@ -99,7 +99,7 @@ -- GitLab