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
This commit is contained in:
Shawn Lin
2023-06-15 08:48:47 +00:00
parent 7aaceaa782
commit 1c4eb9dc75

View File

@@ -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