Fix rare edge-cases pip crashes
There are some rare edge-cases in the pip code that seem to be triggered randomly by tests. We had originally thrown exceptions for these; however, as we head for release-ready, we can turn these into just logs instead. Bug: 230321185 Test: various presubmit runs (aggregated over time) Change-Id: Iea47516fb6f6ccd625493d42a3c2b5236468f602
This commit is contained in:
@@ -662,8 +662,8 @@ public class PipTransition extends PipTransitionController {
|
||||
}
|
||||
|
||||
// Please file a bug to handle the unexpected transition type.
|
||||
throw new IllegalStateException("Entering PIP with unexpected transition type="
|
||||
+ transitTypeToString(transitType));
|
||||
android.util.Slog.e(TAG, "Found new PIP in transition with mis-matched type="
|
||||
+ transitTypeToString(transitType), new Throwable());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -333,6 +333,9 @@ public class PhonePipMenuController implements PipMenuController {
|
||||
mTmpDestinationRectF.set(destinationBounds);
|
||||
mMoveTransform.setRectToRect(mTmpSourceRectF, mTmpDestinationRectF, Matrix.ScaleToFit.FILL);
|
||||
final SurfaceControl surfaceControl = getSurfaceControl();
|
||||
if (surfaceControl == null) {
|
||||
return;
|
||||
}
|
||||
final SurfaceControl.Transaction menuTx =
|
||||
mSurfaceControlTransactionFactory.getTransaction();
|
||||
menuTx.setMatrix(surfaceControl, mMoveTransform, mTmpTransform);
|
||||
@@ -359,6 +362,9 @@ public class PhonePipMenuController implements PipMenuController {
|
||||
}
|
||||
|
||||
final SurfaceControl surfaceControl = getSurfaceControl();
|
||||
if (surfaceControl == null) {
|
||||
return;
|
||||
}
|
||||
final SurfaceControl.Transaction menuTx =
|
||||
mSurfaceControlTransactionFactory.getTransaction();
|
||||
menuTx.setCrop(surfaceControl, destinationBounds);
|
||||
|
||||
Reference in New Issue
Block a user