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

Commit 1eddb0cb authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Handling cases with a null bitmap." into oc-dev

parents a2f747c5 f229ae55
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -932,7 +932,7 @@ public class ActivityOptions {
     * @hide
     */
    public GraphicBuffer getThumbnail() {
        return mThumbnail.createGraphicBufferHandle();
        return mThumbnail != null ? mThumbnail.createGraphicBufferHandle() : null;
    }

    /** @hide */
@@ -1243,11 +1243,13 @@ public class ActivityOptions {
            case ANIM_THUMBNAIL_ASPECT_SCALE_DOWN:
                // Once we parcel the thumbnail for transfering over to the system, create a copy of
                // the bitmap to a hardware bitmap and pass through the GraphicBuffer
                if (mThumbnail == null) {
                    b.putParcelable(KEY_ANIM_THUMBNAIL, null);
                } else {
                if (mThumbnail != null) {
                    final Bitmap hwBitmap = mThumbnail.copy(Config.HARDWARE, true /* immutable */);
                    if (hwBitmap != null) {
                        b.putParcelable(KEY_ANIM_THUMBNAIL, hwBitmap.createGraphicBufferHandle());
                    } else {
                        Slog.w(TAG, "Failed to copy thumbnail");
                    }
                }
                b.putInt(KEY_ANIM_START_X, mStartX);
                b.putInt(KEY_ANIM_START_Y, mStartY);
+1 −1
Original line number Diff line number Diff line
@@ -1426,7 +1426,7 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo
                            pendingOptions.getStartX(), pendingOptions.getStartY(),
                            pendingOptions.getOnAnimationStartListener(),
                            scaleUp);
                    if (intent.getSourceBounds() == null) {
                    if (intent.getSourceBounds() == null && buffer != null) {
                        intent.setSourceBounds(new Rect(pendingOptions.getStartX(),
                                pendingOptions.getStartY(),
                                pendingOptions.getStartX() + buffer.getWidth(),