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(<empty rect>) 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
This commit is contained in:
Winson Chung
2022-02-14 18:16:26 +00:00
parent 59cb98e5eb
commit a2078ca3d0

View File

@@ -91,6 +91,9 @@ public interface DarkIconDispatcher {
* areas, false otherwise
*/
static boolean isInAreas(ArrayList<Rect> areas, View view) {
if (areas.isEmpty()) {
return true;
}
for (Rect area : areas) {
if (isInArea(area, view)) {
return true;