summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorTony Huang <tonyychuang@google.com>2022-01-12 01:21:28 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2022-01-12 01:21:28 +0000
commitfcfa227cf7639b1974b4ddbd8c3a626b8a507b20 (patch)
treeb9fd4e2ab98193d501cede7da9299086b4bf1224 /libs
parentdd7601c964a255258ec6eb67106f8aea315ca39f (diff)
parentf0d69e7d472a71b2f17561515af1fa3945feda02 (diff)
Merge "Avoid NPE while drag divider bar" into sc-v2-dev
Diffstat (limited to 'libs')
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitDecorManager.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitDecorManager.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitDecorManager.java
index ad9ebb2ef6ae..36e55bae18c3 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitDecorManager.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitDecorManager.java
@@ -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;
}
}