Fix NPE when setting icon overlay in PipTaskOrganizer
Similarly to check in PipTransition, we need to add similar condition in PipTaskOrganizer which is used when shell transitions are disabled. If the top activity info is missing, we fallback to color overlay. Bug: 277637354 Bug: 272819817 Test: n/a, this is addressing a bug in field, the investigation why this happens will be continued in 272819817, and it simply copies the same condition that was used in PipTransition (as the two codepaths are similar in that sense) in http://ag/21965862 Change-Id: Iab20d3b53026757d1bf3f8714aa750b8cd8c2c40
This commit is contained in:
@@ -1678,8 +1678,17 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
|
||||
// Similar to auto-enter-pip transition, we use content overlay when there is no
|
||||
// source rect hint to enter PiP use bounds animation.
|
||||
if (sourceHintRect == null) {
|
||||
// We use content overlay when there is no source rect hint to enter PiP use bounds
|
||||
// animation.
|
||||
// TODO(b/272819817): cleanup the null-check and extra logging.
|
||||
final boolean hasTopActivityInfo = mTaskInfo.topActivityInfo != null;
|
||||
if (!hasTopActivityInfo) {
|
||||
ProtoLog.w(ShellProtoLogGroup.WM_SHELL_TRANSITIONS,
|
||||
"%s: TaskInfo.topActivityInfo is null", TAG);
|
||||
}
|
||||
if (SystemProperties.getBoolean(
|
||||
"persist.wm.debug.enable_pip_app_icon_overlay", true)) {
|
||||
"persist.wm.debug.enable_pip_app_icon_overlay", true)
|
||||
&& hasTopActivityInfo) {
|
||||
animator.setAppIconContentOverlay(
|
||||
mContext, currentBounds, mTaskInfo.topActivityInfo,
|
||||
mPipBoundsState.getLauncherState().getAppIconSizePx());
|
||||
|
||||
Reference in New Issue
Block a user