Cherish: applock: early return in setChecked if backing field has the same value
Signed-off-by: jhonboy121 <alfredmathew05@gmail.com> Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
This commit is contained in:
@@ -63,6 +63,7 @@ class AppLockBiometricPreferenceController(
|
||||
override fun isChecked() = isBiometricsAllowed
|
||||
|
||||
override fun setChecked(checked: Boolean): Boolean {
|
||||
if (isBiometricsAllowed == checked) return false
|
||||
isBiometricsAllowed = checked
|
||||
coroutineScope.launch(Dispatchers.Default) {
|
||||
appLockManager.setBiometricsAllowed(isBiometricsAllowed)
|
||||
|
||||
@@ -59,6 +59,7 @@ class AppLockNotificationRedactionPC(
|
||||
override fun isChecked() = shouldRedactNotification
|
||||
|
||||
override fun setChecked(checked: Boolean): Boolean {
|
||||
if (shouldRedactNotification == checked) return false
|
||||
shouldRedactNotification = checked
|
||||
coroutineScope.launch(Dispatchers.Default) {
|
||||
appLockManager.setShouldRedactNotification(packageName, checked)
|
||||
|
||||
@@ -60,6 +60,7 @@ class AppLockPackageProtectionPC(
|
||||
override fun isChecked() = isProtected
|
||||
|
||||
override fun setChecked(checked: Boolean): Boolean {
|
||||
if (isProtected == checked) return false
|
||||
isProtected = checked
|
||||
coroutineScope.launch(Dispatchers.Default) {
|
||||
if (isProtected) {
|
||||
|
||||
Reference in New Issue
Block a user