From 54bdd937e96ef021b3359dfd4130677638f33904 Mon Sep 17 00:00:00 2001 From: henrichg Date: Sat, 20 Jul 2024 17:46:55 +0200 Subject: [PATCH] Fix: Fixed test of preference allowed state for dual sim notification tone profile parameter. (2) --- .../phoneprofilesplus/PreferenceAllowed.java | 35 +++++++++++-------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/phoneProfilesPlus/src/main/java/sk/henrichg/phoneprofilesplus/PreferenceAllowed.java b/phoneProfilesPlus/src/main/java/sk/henrichg/phoneprofilesplus/PreferenceAllowed.java index 7e3a034bd2..fed7a2f17f 100644 --- a/phoneProfilesPlus/src/main/java/sk/henrichg/phoneprofilesplus/PreferenceAllowed.java +++ b/phoneProfilesPlus/src/main/java/sk/henrichg/phoneprofilesplus/PreferenceAllowed.java @@ -2622,23 +2622,30 @@ static void isProfilePreferenceAllowed_PREF_PROFILE_SOUND_NOTIFICATION_CHANGE_SI preferenceAllowed.allowed = PREFERENCE_NOT_ALLOWED; preferenceAllowed.notAllowedReason = PREFERENCE_NOT_ALLOWED_SETTINGS_NOT_FOUND; } - } else - if ((!rootRequired) && ppppsInstalled) { - if (profile != null) { - if ((profile._soundNotificationChangeSIM1 != 0) || - (profile._soundNotificationChangeSIM2 != 0)) - preferenceAllowed.allowed = PREFERENCE_ALLOWED; - } else - preferenceAllowed.allowed = PREFERENCE_ALLOWED; } else { - if (profile != null) { - if ((profile._soundNotificationChangeSIM1 != 0) || - (profile._soundNotificationChangeSIM2 != 0)) { - preferenceAllowed.notAllowedPPPPS = true; + if (rootRequired) { + preferenceAllowed.allowed = PREFERENCE_NOT_ALLOWED; + preferenceAllowed.notAllowedReason = PREFERENCE_NOT_ALLOWED_NOT_ROOTED; + } else { + if (ppppsInstalled) { + if (profile != null) { + if ((profile._soundNotificationChangeSIM1 != 0) || + (profile._soundNotificationChangeSIM2 != 0)) + preferenceAllowed.allowed = PREFERENCE_ALLOWED; + } else + preferenceAllowed.allowed = PREFERENCE_ALLOWED; + } + else { + if (profile != null) { + if ((profile._soundNotificationChangeSIM1 != 0) || + (profile._soundNotificationChangeSIM2 != 0)) { + preferenceAllowed.notAllowedPPPPS = true; + } + } + preferenceAllowed.allowed = PREFERENCE_NOT_ALLOWED; + preferenceAllowed.notAllowedReason = PREFERENCE_NOT_ALLOWED_NOT_INSTALLED_PPPPS; } } - preferenceAllowed.allowed = PREFERENCE_NOT_ALLOWED; - preferenceAllowed.notAllowedReason = PREFERENCE_NOT_ALLOWED_NOT_INSTALLED_PPPPS; } } else { preferenceAllowed.allowed = PREFERENCE_NOT_ALLOWED;