Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 24f66965 authored by Sid Soundararajan's avatar Sid Soundararajan Committed by android-build-merger
Browse files

Merge "Add a null check for the thumbnail image for transition" into nyc-dev am: 2ff157c0

am: f1aa5bfa

* commit 'f1aa5bfa':
  Add a null check for the thumbnail image for transition

Change-Id: I63ecfd691966a06e15f15e1ec5b5dac24c214cad
parents c6cdcb6f f1aa5bfa
Loading
Loading
Loading
Loading
+15 −8
Original line number Diff line number Diff line
@@ -103,6 +103,16 @@ public class RecentsTvTransitionHelper {
            EventBus.getDefault().send(new LaunchTaskFailedEvent());
        }

        Rect taskRect = taskView.getFocusedThumbnailRect();
        // Check both the rect and the thumbnail for null. The rect can be null if the user
        // decides to disallow animations, so automatic scrolling does not happen properly.

        // The thumbnail can be null if the app was partially launched on TV. In this case
        // we do not override the transition.
        if (taskRect == null || task.thumbnail == null) {
            return;
        }

        IRemoteCallback.Stub callback = null;
        if (animStartedListener != null) {
            callback = new IRemoteCallback.Stub() {
@@ -120,14 +130,11 @@ public class RecentsTvTransitionHelper {
            };
        }
        try {
            Rect taskRect = taskView.getFocusedThumbnailRect();
            if (taskRect != null) {
            Bitmap thumbnail = Bitmap.createScaledBitmap(task.thumbnail, taskRect.width(),
                    taskRect.height(), false);
            WindowManagerGlobal.getWindowManagerService()
                    .overridePendingAppTransitionAspectScaledThumb(thumbnail, taskRect.left,
                            taskRect.top, taskRect.width(), taskRect.height(), callback, true);
            }
        } catch (RemoteException e) {
            Log.w(TAG, "Failed to override transition: " + e);
        }