From a2078ca3d095525e1b776b79a6daf527fcbb14b4 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Mon, 14 Feb 2022 18:16:26 +0000 Subject: [PATCH] Fix regression in handling of empty dark regions - Previously LightBarController calls setIconsDarkArea(null) to indicate to DarkIconDispatcherImpl to set mTintArea to null and dispatch accordingly, but DarkIconDispatcher.isInArea() would return true, while the updated call to send an empty list would try to iterate the list and check isInArea() for each rect and return false otherwise. To mirror the old behavior, also return true by default if there is an empty list. Bug: 219387839 Bug: 208717544 Test: Open an app with light bars and verify colors change Test: atest SystemUITests Change-Id: I265dddafb3ee7200837f8e013f92682344c080ef --- .../src/com/android/systemui/plugins/DarkIconDispatcher.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/SystemUI/plugin/src/com/android/systemui/plugins/DarkIconDispatcher.java b/packages/SystemUI/plugin/src/com/android/systemui/plugins/DarkIconDispatcher.java index 757ed76eff369..b33c5449c1eb6 100644 --- a/packages/SystemUI/plugin/src/com/android/systemui/plugins/DarkIconDispatcher.java +++ b/packages/SystemUI/plugin/src/com/android/systemui/plugins/DarkIconDispatcher.java @@ -91,6 +91,9 @@ public interface DarkIconDispatcher { * areas, false otherwise */ static boolean isInAreas(ArrayList areas, View view) { + if (areas.isEmpty()) { + return true; + } for (Rect area : areas) { if (isInArea(area, view)) { return true;