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

Commit 4d8ce499 authored by Tony Huang's avatar Tony Huang Committed by Automerger Merge Worker
Browse files

Merge "Avoid NPE while drag divider bar" into sc-v2-dev am: fcfa227c am: 13439315

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16602936

Change-Id: I4345e35c7a7b2b8a56cff04e9c7dc337d55beb00
parents 314e8001 13439315
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -137,14 +137,16 @@ public class SplitDecorManager extends WindowlessWindowManager {
            return;
        }

        if (mIcon == null) {
            // TODO: add fade-in animation.
        if (mBackgroundLeash == null) {
            mBackgroundLeash = SurfaceUtils.makeColorLayer(mHostLeash,
                    RESIZING_BACKGROUND_SURFACE_NAME, mSurfaceSession);
            t.setColor(mBackgroundLeash, getResizingBackgroundColor(resizingTask))
                    .setLayer(mBackgroundLeash, SPLIT_DIVIDER_LAYER - 1)
                    .show(mBackgroundLeash);
        }

        if (mIcon == null && resizingTask.topActivityInfo != null) {
            // TODO: add fade-in animation.
            mIcon = mIconProvider.getIcon(resizingTask.topActivityInfo);
            mResizingIconView.setImageDrawable(mIcon);
            mResizingIconView.setVisibility(View.VISIBLE);
@@ -168,12 +170,16 @@ public class SplitDecorManager extends WindowlessWindowManager {
            return;
        }

        if (mBackgroundLeash != null) {
            t.remove(mBackgroundLeash);
            mBackgroundLeash = null;
        }

        if (mIcon != null) {
            mResizingIconView.setVisibility(View.GONE);
            mResizingIconView.setImageDrawable(null);
            t.remove(mBackgroundLeash).hide(mIconLeash);
            t.hide(mIconLeash);
            mIcon = null;
            mBackgroundLeash = null;
        }
    }