summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Tetiana Meronyk <tetianameronyk@google.com> 2023-09-12 15:00:20 +0000
committer Tetiana Meronyk <tetianameronyk@google.com> 2023-09-12 15:10:14 +0000
commit0c49c51dd7bd040b00d3b6dfb486984d56e477cb (patch)
tree9a82999ff098285a82d679c3524672135d42f12f
parent7db0d77d4c4ae5fd38e6d1820f152d95244221ac (diff)
Fix text color in multiuser menu when option is disabled
In the current version, the color is hardcoded and is not dark theme aware. Therefore when the menu option is disabled and the dark mode is enabled, the text is not visible. The change in this CL retrieves text color from the context's theme. Bug: 299692354 Test: manual, opened the menu in both dark and light theme with "Disallow remove user" restriction, ensured text is readable Change-Id: I087b06526af03bd147db5b40c2f6a82d90742898
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/RestrictedLockUtilsInternal.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/RestrictedLockUtilsInternal.java b/packages/SettingsLib/src/com/android/settingslib/RestrictedLockUtilsInternal.java
index ff960f3184db..cfa571152b31 100644
--- a/packages/SettingsLib/src/com/android/settingslib/RestrictedLockUtilsInternal.java
+++ b/packages/SettingsLib/src/com/android/settingslib/RestrictedLockUtilsInternal.java
@@ -20,6 +20,8 @@ import static android.app.admin.DevicePolicyManager.KEYGUARD_DISABLE_FEATURES_NO
import static android.app.admin.DevicePolicyManager.MTE_NOT_CONTROLLED_BY_POLICY;
import static android.app.admin.DevicePolicyManager.PROFILE_KEYGUARD_FEATURES_AFFECT_OWNER;
+import static com.android.settingslib.Utils.getColorAttrDefaultColor;
+
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.UserIdInt;
@@ -638,7 +640,8 @@ public class RestrictedLockUtilsInternal extends RestrictedLockUtils {
removeExistingRestrictedSpans(sb);
if (admin != null) {
- final int disabledColor = context.getColor(R.color.disabled_text_color);
+ final int disabledColor = getColorAttrDefaultColor(context,
+ android.R.attr.textColorHint);
sb.setSpan(new ForegroundColorSpan(disabledColor), 0, sb.length(),
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
ImageSpan image = new RestrictedLockImageSpan(context);