summaryrefslogtreecommitdiff
path: root/core/tests
diff options
context:
space:
mode:
authorJeff DeCew <jeffdq@google.com>2021-09-09 13:38:48 -0400
committerJeff DeCew <jeffdq@google.com>2021-09-09 15:00:00 -0400
commit050a0d0d64a33d16584319929456552ecc151a42 (patch)
tree518fe19b8c620982724e40c86a384a897ea0d3f1 /core/tests
parent5cb7307ebb1f7daff7e0123d853ec52c49553171 (diff)
Reduce the color contrast requirements for the emphasized action button fill color.
This reduces the contrast requirement between the notification background and the button fill from 3:1 to 1.3:1 Fixes: 196393060 Test: manual testing using the go/notify2-apk and the CallStyle color customizer Test: android.app.NotificationTest Change-Id: I0fc3b7ae1ede7afd28974c59fa2a58d7fea2e9de
Diffstat (limited to 'core/tests')
-rw-r--r--core/tests/coretests/src/android/app/NotificationTest.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/tests/coretests/src/android/app/NotificationTest.java b/core/tests/coretests/src/android/app/NotificationTest.java
index 02d8a4b783a5..34c1763b3286 100644
--- a/core/tests/coretests/src/android/app/NotificationTest.java
+++ b/core/tests/coretests/src/android/app/NotificationTest.java
@@ -436,7 +436,7 @@ public class NotificationTest {
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
CharSequence result = ensureColorSpanContrast(text, background);
- // ensure the span has been updated to have > 3:1 contrast ratio with fill color
+ // ensure the span has been updated to have > 1.3:1 contrast ratio with fill color
Object[] spans = ((Spannable) result).getSpans(0, result.length(), Object.class);
assertThat(spans).hasLength(1);
int foregroundColor = ((ForegroundColorSpan) spans[0]).getForegroundColor();
@@ -487,7 +487,7 @@ public class NotificationTest {
int background = Color.LTGRAY;
int foreground = Color.LTGRAY;
int result = Notification.Builder.ensureButtonFillContrast(foreground, background);
- assertContrastIsWithinRange(result, background, 3, 3.2);
+ assertContrastIsWithinRange(result, background, 1.3, 1.5);
assertThat(ContrastColorUtil.calculateLuminance(result))
.isLessThan(ContrastColorUtil.calculateLuminance(background));
}
@@ -497,7 +497,7 @@ public class NotificationTest {
int background = Color.DKGRAY;
int foreground = Color.DKGRAY;
int result = Notification.Builder.ensureButtonFillContrast(foreground, background);
- assertContrastIsWithinRange(result, background, 3, 3.2);
+ assertContrastIsWithinRange(result, background, 1.3, 1.5);
assertThat(ContrastColorUtil.calculateLuminance(result))
.isGreaterThan(ContrastColorUtil.calculateLuminance(background));
}