Merge "Clear touch region on dream overlay container on start." into udc-dev

This commit is contained in:
Bryce Lee
2023-03-30 13:46:57 +00:00
committed by Android (Google) Code Review
2 changed files with 17 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ import static com.android.systemui.dreams.complication.ComplicationLayoutParams.
import android.animation.Animator;
import android.content.res.Resources;
import android.graphics.Region;
import android.os.Handler;
import android.util.MathUtils;
import android.view.View;
@@ -223,6 +224,9 @@ public class DreamOverlayContainerViewController extends
mJitterStartTimeMillis = System.currentTimeMillis();
mHandler.postDelayed(this::updateBurnInOffsets, mBurnInProtectionUpdateInterval);
mPrimaryBouncerCallbackInteractor.addBouncerExpansionCallback(mBouncerExpansionCallback);
final Region emptyRegion = Region.obtain();
mView.getRootSurfaceControl().setTouchableRegion(emptyRegion);
emptyRegion.recycle();
// Start dream entry animations. Skip animations for low light clock.
if (!mStateController.isLowLightActive()) {

View File

@@ -26,8 +26,10 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import android.content.res.Resources;
import android.graphics.Region;
import android.os.Handler;
import android.testing.AndroidTestingRunner;
import android.view.AttachedSurfaceControl;
import android.view.ViewGroup;
import android.view.ViewRootImpl;
import android.view.ViewTreeObserver;
@@ -75,6 +77,9 @@ public class DreamOverlayContainerViewControllerTest extends SysuiTestCase {
@Mock
ComplicationHostViewController mComplicationHostViewController;
@Mock
AttachedSurfaceControl mAttachedSurfaceControl;
@Mock
ViewGroup mDreamOverlayContentView;
@@ -108,6 +113,8 @@ public class DreamOverlayContainerViewControllerTest extends SysuiTestCase {
when(mDreamOverlayContainerView.getResources()).thenReturn(mResources);
when(mDreamOverlayContainerView.getViewTreeObserver()).thenReturn(mViewTreeObserver);
when(mDreamOverlayContainerView.getViewRootImpl()).thenReturn(mViewRoot);
when(mDreamOverlayContainerView.getRootSurfaceControl())
.thenReturn(mAttachedSurfaceControl);
mController = new DreamOverlayContainerViewController(
mDreamOverlayContainerView,
@@ -127,6 +134,12 @@ public class DreamOverlayContainerViewControllerTest extends SysuiTestCase {
mBouncerlessScrimController);
}
@Test
public void testRootSurfaceControlInsetSetOnAttach() {
mController.onViewAttached();
verify(mAttachedSurfaceControl).setTouchableRegion(eq(Region.obtain()));
}
@Test
public void testDreamOverlayStatusBarViewControllerInitialized() {
mController.init();