From 8d662cae2c05b5e256e7bb826abf05fb9ace133d Mon Sep 17 00:00:00 2001 From: wangqi Date: Thu, 26 Oct 2017 11:27:19 -0700 Subject: Set incall button color to match sim color. This change also add a handy adb command script run before UI integration test. Bug: 67429956 Test: IncallActivityTest PiperOrigin-RevId: 173565382 Change-Id: I9b8b957f00a0b7d11dbb7f40e8c9f1dbdb8c3928 --- java/com/android/incallui/ThemeColorManager.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'java/com/android/incallui/ThemeColorManager.java') diff --git a/java/com/android/incallui/ThemeColorManager.java b/java/com/android/incallui/ThemeColorManager.java index a88ae33cd..1d4c287be 100644 --- a/java/com/android/incallui/ThemeColorManager.java +++ b/java/com/android/incallui/ThemeColorManager.java @@ -57,14 +57,16 @@ public class ThemeColorManager { public void onForegroundCallChanged(Context context, @Nullable DialerCall newForegroundCall) { if (newForegroundCall == null) { - updateThemeColors(context, pendingPhoneAccountHandle, false); + updateThemeColors(context, getHighlightColor(context, pendingPhoneAccountHandle), false); } else { - updateThemeColors(context, newForegroundCall.getAccountHandle(), newForegroundCall.isSpam()); + updateThemeColors( + context, + getHighlightColor(context, newForegroundCall.getAccountHandle()), + newForegroundCall.isSpam()); } } - private void updateThemeColors( - Context context, @Nullable PhoneAccountHandle handle, boolean isSpam) { + private void updateThemeColors(Context context, @ColorInt int highlightColor, boolean isSpam) { MaterialPalette palette; if (isSpam) { palette = @@ -74,7 +76,6 @@ public class ThemeColorManager { backgroundColorBottom = context.getColor(R.color.incall_background_gradient_spam_bottom); backgroundColorSolid = context.getColor(R.color.incall_background_multiwindow_spam); } else { - @ColorInt int highlightColor = getHighlightColor(context, handle); palette = colorMap.calculatePrimaryAndSecondaryColor(highlightColor); backgroundColorTop = context.getColor(R.color.incall_background_gradient_top); backgroundColorMiddle = context.getColor(R.color.incall_background_gradient_middle); @@ -95,7 +96,7 @@ public class ThemeColorManager { } @ColorInt - private static int getHighlightColor(Context context, @Nullable PhoneAccountHandle handle) { + private int getHighlightColor(Context context, @Nullable PhoneAccountHandle handle) { if (handle != null) { PhoneAccount account = context.getSystemService(TelecomManager.class).getPhoneAccount(handle); if (account != null) { -- cgit v1.2.3