summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Lucas Dupin <dupin@google.com> 2017-07-26 22:00:29 +0000
committer android-build-merger <android-build-merger@google.com> 2017-07-26 22:00:29 +0000
commitf198fa412047b7b2569ed840333a22f73e57f83c (patch)
treed955bc2700bc434a2b421efc37230de4132fc924
parent84a094d89b3ba3024adb1851c196b9b25d0cc899 (diff)
parent679f7e408b4976d53d94df1e5d392045c4efcfac (diff)
Merge "Text color of "shutdown" after removing overlay" into oc-dr1-dev am: c1edefc059
am: 679f7e408b Change-Id: I58d43d04ebc3830a9e270d1bee696d6691cf3a08
-rw-r--r--packages/SystemUI/src/com/android/systemui/colorextraction/SysuiColorExtractor.java5
-rw-r--r--services/core/java/com/android/server/power/ShutdownThread.java25
2 files changed, 21 insertions, 9 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/colorextraction/SysuiColorExtractor.java b/packages/SystemUI/src/com/android/systemui/colorextraction/SysuiColorExtractor.java
index fe8373ffa127..61cbc98c6085 100644
--- a/packages/SystemUI/src/com/android/systemui/colorextraction/SysuiColorExtractor.java
+++ b/packages/SystemUI/src/com/android/systemui/colorextraction/SysuiColorExtractor.java
@@ -134,6 +134,11 @@ public class SysuiColorExtractor extends ColorExtractor {
* @return colors
*/
public GradientColors getColors(int which, int type, boolean ignoreWallpaperVisibility) {
+ // mWallpaperVisible only handles the "system wallpaper" and will be always set to false
+ // if we have different lock and system wallpapers.
+ if (which == WallpaperManager.FLAG_LOCK) {
+ ignoreWallpaperVisibility = true;
+ }
if (mWallpaperVisible || ignoreWallpaperVisibility) {
return super.getColors(which, type);
} else {
diff --git a/services/core/java/com/android/server/power/ShutdownThread.java b/services/core/java/com/android/server/power/ShutdownThread.java
index 56612ad21398..e894275fe2b6 100644
--- a/services/core/java/com/android/server/power/ShutdownThread.java
+++ b/services/core/java/com/android/server/power/ShutdownThread.java
@@ -20,7 +20,10 @@ package com.android.server.power;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.IActivityManager;
+import android.app.KeyguardManager;
import android.app.ProgressDialog;
+import android.app.WallpaperColors;
+import android.app.WallpaperManager;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.IBluetoothManager;
import android.content.BroadcastReceiver;
@@ -28,7 +31,6 @@ import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
-import android.content.om.IOverlayManager;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.media.AudioAttributes;
@@ -53,6 +55,7 @@ import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.ProgressBar;
import android.widget.TextView;
+
import com.android.internal.telephony.ITelephony;
import com.android.server.pm.PackageManagerService;
@@ -300,17 +303,21 @@ public final class ShutdownThread extends Thread {
d.setContentView(com.android.internal.R.layout.shutdown_dialog);
d.setCancelable(false);
- int color = Color.WHITE;
+ int color;
try {
- IOverlayManager service = IOverlayManager.Stub.asInterface(
- ServiceManager.getService(Context.OVERLAY_SERVICE));
- if (service.getOverlayInfo("com.android.systemui.theme.lightwallpaper", 0).isEnabled()) {
- color = Color.BLACK;
- }
+ boolean onKeyguard = context.getSystemService(
+ KeyguardManager.class).isKeyguardLocked();
+ WallpaperColors currentColors = context.getSystemService(WallpaperManager.class)
+ .getWallpaperColors(onKeyguard ?
+ WallpaperManager.FLAG_LOCK : WallpaperManager.FLAG_SYSTEM);
+ color = currentColors != null &&
+ (currentColors.getColorHints() & WallpaperColors.HINT_SUPPORTS_DARK_TEXT)
+ != 0 ?
+ Color.BLACK : Color.WHITE;
} catch (Exception e) {
- // Shutdown UI really shouldn't crash or have strict dependencies on other services.
- Log.w(TAG, "Problem getting overlay state", e);
+ color = Color.WHITE;
}
+
ProgressBar bar = d.findViewById(com.android.internal.R.id.progress);
bar.getIndeterminateDrawable().setTint(color);
((TextView) d.findViewById(com.android.internal.R.id.text1)).setTextColor(color);