diff options
| -rw-r--r-- | core/java/android/app/ActivityView.java | 10 | ||||
| -rw-r--r-- | core/java/android/view/SurfaceView.java | 11 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java | 3 |
3 files changed, 21 insertions, 3 deletions
diff --git a/core/java/android/app/ActivityView.java b/core/java/android/app/ActivityView.java index 635ed138cc65..d650bbcdfa33 100644 --- a/core/java/android/app/ActivityView.java +++ b/core/java/android/app/ActivityView.java @@ -102,6 +102,14 @@ public class ActivityView extends ViewGroup implements android.window.TaskEmbedd public ActivityView( @NonNull Context context, @NonNull AttributeSet attrs, int defStyle, boolean singleTaskInstance, boolean usePublicVirtualDisplay) { + this(context, attrs, defStyle, singleTaskInstance, usePublicVirtualDisplay, false); + } + + /** @hide */ + public ActivityView( + @NonNull Context context, @NonNull AttributeSet attrs, int defStyle, + boolean singleTaskInstance, boolean usePublicVirtualDisplay, + boolean disableSurfaceViewBackgroundLayer) { super(context, attrs, defStyle); if (useTaskOrganizer()) { mTaskEmbedder = new TaskOrganizerTaskEmbedder(context, this); @@ -109,7 +117,7 @@ public class ActivityView extends ViewGroup implements android.window.TaskEmbedd mTaskEmbedder = new VirtualDisplayTaskEmbedder(context, this, singleTaskInstance, usePublicVirtualDisplay); } - mSurfaceView = new SurfaceView(context); + mSurfaceView = new SurfaceView(context, null, 0, 0, disableSurfaceViewBackgroundLayer); // Since ActivityView#getAlpha has been overridden, we should use parent class's alpha // as master to synchronize surface view's alpha value. mSurfaceView.setAlpha(super.getAlpha()); diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java index a954f3631a01..57f91ed3c0ae 100644 --- a/core/java/android/view/SurfaceView.java +++ b/core/java/android/view/SurfaceView.java @@ -134,6 +134,7 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall // we need to preserve the old one until the new one has drawn. SurfaceControl mDeferredDestroySurfaceControl; SurfaceControl mBackgroundControl; + private boolean mDisableBackgroundLayer = false; /** * We use this lock in SOME cases when reading or writing SurfaceControl, @@ -245,10 +246,17 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall } public SurfaceView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { + this(context, attrs, defStyleAttr, defStyleRes, false); + } + + /** @hide */ + public SurfaceView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr, + int defStyleRes, boolean disableBackgroundLayer) { super(context, attrs, defStyleAttr, defStyleRes); mRenderNode.addPositionUpdateListener(mPositionListener); setWillNotDraw(true); + mDisableBackgroundLayer = disableBackgroundLayer; } /** @@ -839,7 +847,8 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall if (mBackgroundControl == null) { return; } - if ((mSubLayer < 0) && ((mSurfaceFlags & SurfaceControl.OPAQUE) != 0)) { + if ((mSubLayer < 0) && ((mSurfaceFlags & SurfaceControl.OPAQUE) != 0) + && !mDisableBackgroundLayer) { t.show(mBackgroundControl); } else { t.hide(mBackgroundControl); diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java index 790d6a2070a2..c3dcc0b3038c 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java +++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java @@ -264,7 +264,8 @@ public class BubbleExpandedView extends LinearLayout { mSettingsIcon = findViewById(R.id.settings_button); mActivityView = new ActivityView(mContext, null /* attrs */, 0 /* defStyle */, - true /* singleTaskInstance */); + true /* singleTaskInstance */, false /* usePublicVirtualDisplay*/, + true /* disableSurfaceViewBackgroundLayer */); // Set ActivityView's alpha value as zero, since there is no view content to be shown. setContentVisibility(false); |