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
diff --git a/src/com/android/settings/password/ConfirmDeviceCredentialActivity.java b/src/com/android/settings/password/ConfirmDeviceCredentialActivity.java
index 314ce05..f2f6520 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.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.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 @@
// 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