Allow for transparent communal views.

This changelist modifies the pixel format of the communal
SurfaceView to allow for transparent pixels.

Bug: 197322620
Test: atest CommunalSurfaceViewControllerTest
Change-Id: I4f237307dcc6457053ef9ca08d28a122de3ab9da
This commit is contained in:
Bryce Lee
2021-08-20 08:28:37 -07:00
parent 1a99bc6818
commit 04bed11734
2 changed files with 4 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ package com.android.systemui.communal.service;
import android.annotation.IntDef;
import android.content.res.Resources;
import android.graphics.PixelFormat;
import android.graphics.Region;
import android.util.Log;
import android.view.IWindow;
@@ -125,6 +126,7 @@ public class CommunalSurfaceViewController extends ViewController<SurfaceView> {
@Override
protected void onInit() {
mView.getHolder().setFormat(PixelFormat.TRANSPARENT);
mView.getHolder().addCallback(mSurfaceHolderCallback);
mView.addOnLayoutChangeListener(mOnLayoutChangeListener);
}

View File

@@ -26,6 +26,7 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import android.content.res.Resources;
import android.graphics.PixelFormat;
import android.graphics.Region;
import android.os.IBinder;
import android.view.Display;
@@ -125,6 +126,7 @@ public class CommunalSurfaceViewControllerTest extends SysuiTestCase {
final ArgumentCaptor<SurfaceHolder.Callback> callbackCapture =
ArgumentCaptor.forClass(SurfaceHolder.Callback.class);
verify(mSurfaceHolder).addCallback(callbackCapture.capture());
verify(mSurfaceHolder).setFormat(PixelFormat.TRANSPARENT);
mCallback = callbackCapture.getValue();
final ArgumentCaptor<View.OnLayoutChangeListener> listenerCapture =