Merge changes from topic "presubmit-am-14c0d0dd1ab9408c8fbd89013e2295b5" into tm-dev

* changes:
  Fix NPE when PiP actions, but no close action set
  Fix gravity issue when enabling expanded PiP (TV)
  Fix orientation change between PiPs when collapsed
This commit is contained in:
TreeHugger Robot
2022-03-28 11:26:31 +00:00
committed by Android (Google) Code Review
2 changed files with 6 additions and 5 deletions

View File

@@ -95,13 +95,14 @@ public class TvPipBoundsAlgorithm extends PipBoundsAlgorithm {
ProtoLog.d(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE,
"%s: getEntryDestinationBounds()", TAG);
}
if (mTvPipBoundsState.isTvExpandedPipSupported()
updateExpandedPipSize();
final boolean isPipExpanded = mTvPipBoundsState.isTvExpandedPipSupported()
&& mTvPipBoundsState.getDesiredTvExpandedAspectRatio() != 0
&& !mTvPipBoundsState.isTvPipManuallyCollapsed()) {
updateExpandedPipSize();
&& !mTvPipBoundsState.isTvPipManuallyCollapsed();
if (isPipExpanded) {
updateGravityOnExpandToggled(Gravity.NO_GRAVITY, true);
mTvPipBoundsState.setTvPipExpanded(true);
}
mTvPipBoundsState.setTvPipExpanded(isPipExpanded);
return getTvPipBounds().getBounds();
}

View File

@@ -303,7 +303,7 @@ public class TvPipMenuView extends FrameLayout implements View.OnClickListener {
*/
private boolean actionsMatch(RemoteAction action1, RemoteAction action2) {
if (action1 == action2) return true;
if (action1 == null) return false;
if (action1 == null || action2 == null) return false;
return Objects.equals(action1.getTitle(), action2.getTitle())
&& Objects.equals(action1.getContentDescription(), action2.getContentDescription())
&& Objects.equals(action1.getActionIntent(), action2.getActionIntent());