From 1c4eb9dc759097ce61c8c323eb5cefdde39a220a Mon Sep 17 00:00:00 2001 From: Shawn Lin Date: Thu, 15 Jun 2023 08:48:47 +0000 Subject: [PATCH] Set the light status bar flag if not in dark mode To make the status bar content clearly visible we should set the light status bar flag if the device is not in dark mode. Bug: 241274551 Test: 1. Add an account and setup fingerprint unlock 2. Go to "Settings>Passwords & accounts>add account" to add another account 3. Wait for BiometricPrompt to pop up and check the status bar. Change-Id: I7208b9c18c3734d150dfaaef6724948bd197066a --- .../password/ConfirmDeviceCredentialActivity.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/com/android/settings/password/ConfirmDeviceCredentialActivity.java b/src/com/android/settings/password/ConfirmDeviceCredentialActivity.java index 314ce053127..f2f6520c361 100644 --- a/src/com/android/settings/password/ConfirmDeviceCredentialActivity.java +++ b/src/com/android/settings/password/ConfirmDeviceCredentialActivity.java @@ -23,6 +23,7 @@ import static android.app.admin.DevicePolicyResources.Strings.Settings.CONFIRM_W import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_CONFIRM_PASSWORD; import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_CONFIRM_PATTERN; import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_CONFIRM_PIN; +import static android.view.WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS; import android.app.Activity; import android.app.KeyguardManager; @@ -32,6 +33,7 @@ import android.app.trust.TrustManager; import android.content.ComponentName; import android.content.Context; import android.content.Intent; +import android.content.res.Configuration; import android.graphics.Color; import android.hardware.biometrics.BiometricConstants; import android.hardware.biometrics.BiometricPrompt; @@ -379,6 +381,12 @@ public class ConfirmDeviceCredentialActivity extends FragmentActivity { // Translucent activity that is "visible", so it doesn't complain about finish() // not being called before onResume(). setVisible(true); + + if ((getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) + != Configuration.UI_MODE_NIGHT_YES) { + getWindow().getInsetsController().setSystemBarsAppearance( + APPEARANCE_LIGHT_STATUS_BARS, APPEARANCE_LIGHT_STATUS_BARS); + } } @Override