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

Commit cb9f6de3 authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Prevent NPE, add logging for tracking down root issue." into oc-dr1-dev

parents 5110b31d 91c5bb08
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -952,11 +952,11 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
    private GraphicBuffer drawThumbnailTransitionBitmap(Task toTask,
            TaskViewTransform toTransform) {
        SystemServicesProxy ssp = Recents.getSystemServices();
        if (toTransform != null && toTask.key != null) {
            synchronized (mHeaderBarLock) {
                boolean disabledInSafeMode = !toTask.isSystemApp && ssp.isInSafeMode();
        int width = (int) toTransform.rect.width();
        int height = (int) toTransform.rect.height();
        if (toTransform != null && toTask.key != null && width > 0 && height > 0) {
            synchronized (mHeaderBarLock) {
                boolean disabledInSafeMode = !toTask.isSystemApp && ssp.isInSafeMode();
                mHeaderBar.onTaskViewSizeChanged(width, height);
                if (RecentsDebugFlags.Static.EnableTransitionThumbnailDebugMode) {
                    return RecentsTransitionHelper.drawViewIntoGraphicBuffer(width, mTaskBarHeight,
+8 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.content.res.Resources;
import android.graphics.Path;
import android.graphics.Rect;
import android.util.ArraySet;
import android.util.Log;
import android.util.MutableFloat;
import android.util.SparseArray;
import android.util.SparseIntArray;
@@ -481,6 +482,13 @@ public class TaskStackLayoutAlgorithm {
        int height = mStackRect.height() - mInitialTopOffset - mStackBottomOffset;
        mTaskRect.set(mStackRect.left, mStackRect.top, mStackRect.right, mStackRect.top + height);

        if (mTaskRect.width() <= 0 || mTaskRect.height() <= 0) {
            // Logging for b/36654830
            Log.e(TAG, "Invalid task rect: taskRect=" + mTaskRect + " stackRect=" + mStackRect
                    + " displayRect=" + displayRect + " windowRect=" + windowRect
                    + " taskStackBounds=" + taskStackBounds);
        }

        // Short circuit here if the stack rects haven't changed so we don't do all the work below
        if (!lastStackRect.equals(mStackRect)) {
            // Reinitialize the focused and unfocused curves