summaryrefslogtreecommitdiff
path: root/java/com/android/incallui/ThemeColorManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/com/android/incallui/ThemeColorManager.java')
-rw-r--r--java/com/android/incallui/ThemeColorManager.java13
1 files changed, 7 insertions, 6 deletions
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) {