Default to using SplitSelectSource drawable if TaskView icon drawable is null

* Alternative solution could be to set
onTaskViewVisibilityChanged(true) for the taskView that is about
to be dismissed so it loads it's taskIcon/thumbnail back from the cache
* However, that does still leave us open to race conditions (even though
we can be reasonably confident the icon is probably in the cache)
* Also made other changes to allow already public fields on some classes
to be mockable for unit testing

Fixes: 275267738
Test: Tested with fullscreen task at end of overview,
GroupedTaskView at end of overview,
Initiating split from home,
Initiating split from overview actions,
Initiating split from overview app icon

Change-Id: Ic9059c93c07b90f61c9f418d5d36d6ba201ff96a
This commit is contained in:
Vinit Nayak
2023-03-29 22:03:34 -07:00
parent 90259a6db4
commit ecca8eacbc
4 changed files with 198 additions and 9 deletions

View File

@@ -200,8 +200,8 @@ public final class SplitConfigurationOptions {
/** Keep in sync w/ ActivityTaskManager#INVALID_TASK_ID (unreference-able) */
private static final int INVALID_TASK_ID = -1;
public final View view;
public final Drawable drawable;
private View view;
private Drawable drawable;
public final Intent intent;
public final SplitPositionOption position;
public final ItemInfo itemInfo;
@@ -224,5 +224,13 @@ public final class SplitConfigurationOptions {
this.itemInfo = itemInfo;
this.splitEvent = splitEvent;
}
public Drawable getDrawable() {
return drawable;
}
public View getView() {
return view;
}
}
}