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

Commit 04bed117 authored by Bryce Lee's avatar Bryce Lee
Browse files

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
parent 1a99bc68
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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);
    }
+2 −0
Original line number Diff line number Diff line
@@ -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 =