summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Matthew Ng <ngmatthew@google.com> 2018-05-31 13:30:27 -0700
committer Matthew Ng <ngmatthew@google.com> 2018-06-01 11:11:14 -0700
commitdd3964986a238109fdf7464fd12cc8ea173566a2 (patch)
treeaae68d9593fb6c878355c39e1ab3188ef628d8b7
parent23ea118788477967db60a0f6940d77ee263a0519 (diff)
Avoids systemui color tint flicker because no system ui flags set
Systemui nav buttons set the insensity from launcher and -1 window but fallback home does not. This causes services to pass the wrong flags to system ui to apply the incorrect tint that would later be fixed by launcher and sometimes lead to color flicker. Fixes: 79776583 Test: use bright color wallpaper (nav dark icons) and reboot phone, unlock with pin/pass/finger and view nav buttons Change-Id: I86906cd1b5af5d078499a1392c260aa186b2eee8
-rw-r--r--src/com/android/settings/FallbackHome.java22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/com/android/settings/FallbackHome.java b/src/com/android/settings/FallbackHome.java
index 5f7b6392369..84a3283b738 100644
--- a/src/com/android/settings/FallbackHome.java
+++ b/src/com/android/settings/FallbackHome.java
@@ -18,6 +18,8 @@ package com.android.settings;
import android.app.Activity;
import android.app.ProgressDialog;
+import android.app.WallpaperColors;
+import android.app.WallpaperManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -68,15 +70,27 @@ public class FallbackHome extends Activity {
// we don't flash the wallpaper before SUW
mProvisioned = Settings.Global.getInt(getContentResolver(),
Settings.Global.DEVICE_PROVISIONED, 0) != 0;
+ int flags;
if (!mProvisioned) {
setTheme(R.style.FallbackHome_SetupWizard);
- getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN
- | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
+ flags = View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
+ | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
} else {
- getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
- | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
+ flags = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+ | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
}
+ // Set the system ui flags to light status bar if the wallpaper supports dark text to match
+ // current system ui color tints.
+ final WallpaperColors colors = getSystemService(WallpaperManager.class)
+ .getWallpaperColors(WallpaperManager.FLAG_SYSTEM);
+ if (colors != null
+ && (colors.getColorHints() & WallpaperColors.HINT_SUPPORTS_DARK_TEXT) != 0) {
+ flags |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
+ | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR;
+ }
+ getWindow().getDecorView().setSystemUiVisibility(flags);
+
registerReceiver(mReceiver, new IntentFilter(Intent.ACTION_USER_UNLOCKED));
maybeFinish();
}