Loading packages/SystemUI/src/com/android/systemui/ScreenDecorations.java +5 −3 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ import android.widget.FrameLayout; import androidx.annotation.VisibleForTesting; import com.android.app.viewcapture.ViewCaptureAwareWindowManager; import com.android.internal.util.Preconditions; import com.android.settingslib.Utils; import com.android.systemui.biometrics.data.repository.FacePropertyRepository; Loading Loading @@ -168,7 +169,7 @@ public class ScreenDecorations implements ViewGroup mScreenDecorHwcWindow; @VisibleForTesting ScreenDecorHwcLayer mScreenDecorHwcLayer; private WindowManager mWindowManager; private ViewCaptureAwareWindowManager mWindowManager; private int mRotation; private UserSettingObserver mColorInversionSetting; @Nullable Loading Loading @@ -338,7 +339,8 @@ public class ScreenDecorations implements ScreenDecorationsLogger logger, FacePropertyRepository facePropertyRepository, JavaAdapter javaAdapter, CameraProtectionLoader cameraProtectionLoader) { CameraProtectionLoader cameraProtectionLoader, ViewCaptureAwareWindowManager viewCaptureAwareWindowManager) { mContext = context; mSecureSettings = secureSettings; mCommandRegistry = commandRegistry; Loading @@ -353,6 +355,7 @@ public class ScreenDecorations implements mLogger = logger; mFacePropertyRepository = facePropertyRepository; mJavaAdapter = javaAdapter; mWindowManager = viewCaptureAwareWindowManager; } private final ScreenDecorCommand.Callback mScreenDecorCommandCallback = (cmd, pw) -> { Loading Loading @@ -484,7 +487,6 @@ public class ScreenDecorations implements private void startOnScreenDecorationsThread() { Trace.beginSection("ScreenDecorations#startOnScreenDecorationsThread"); mWindowManager = mContext.getSystemService(WindowManager.class); mContext.getDisplay().getDisplayInfo(mDisplayInfo); mRotation = mDisplayInfo.rotation; mDisplaySize.x = mDisplayInfo.getNaturalWidth(); Loading packages/SystemUI/tests/src/com/android/systemui/ScreenDecorationsTest.java +13 −2 Original line number Diff line number Diff line Loading @@ -80,6 +80,8 @@ import androidx.annotation.Nullable; import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.filters.SmallTest; import com.android.app.viewcapture.ViewCapture; import com.android.app.viewcapture.ViewCaptureAwareWindowManager; import com.android.keyguard.KeyguardUpdateMonitor; import com.android.systemui.biometrics.AuthController; import com.android.systemui.biometrics.data.repository.FakeFacePropertyRepository; Loading Loading @@ -109,6 +111,8 @@ import com.android.systemui.util.settings.FakeSettings; import com.android.systemui.util.settings.SecureSettings; import com.android.systemui.util.time.FakeSystemClock; import kotlin.Lazy; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; Loading @@ -127,6 +131,7 @@ public class ScreenDecorationsTest extends SysuiTestCase { private ScreenDecorations mScreenDecorations; private WindowManager mWindowManager; private ViewCaptureAwareWindowManager mViewCaptureAwareWindowManager; private DisplayManager mDisplayManager; private SecureSettings mSecureSettings; private FakeExecutor mExecutor; Loading Loading @@ -173,6 +178,8 @@ public class ScreenDecorationsTest extends SysuiTestCase { private CutoutDecorProviderFactory mCutoutFactory; @Mock private JavaAdapter mJavaAdapter; @Mock private Lazy<ViewCapture> mLazyViewCapture; private FakeFacePropertyRepository mFakeFacePropertyRepository = new FakeFacePropertyRepository(); Loading Loading @@ -245,12 +252,15 @@ public class ScreenDecorationsTest extends SysuiTestCase { new ScreenDecorationsLogger(logcatLogBuffer("TestLogBuffer")), mFakeFacePropertyRepository)); mViewCaptureAwareWindowManager = new ViewCaptureAwareWindowManager(mWindowManager, mLazyViewCapture, false); mScreenDecorations = spy(new ScreenDecorations(mContext, mSecureSettings, mCommandRegistry, mUserTracker, mDisplayTracker, mDotViewController, mThreadFactory, mPrivacyDotDecorProviderFactory, mFaceScanningProviderFactory, new ScreenDecorationsLogger(logcatLogBuffer("TestLogBuffer")), mFakeFacePropertyRepository, mJavaAdapter, mCameraProtectionLoader) { mFakeFacePropertyRepository, mJavaAdapter, mCameraProtectionLoader, mViewCaptureAwareWindowManager) { @Override public void start() { super.start(); Loading Loading @@ -1264,7 +1274,8 @@ public class ScreenDecorationsTest extends SysuiTestCase { mDotViewController, mThreadFactory, mPrivacyDotDecorProviderFactory, mFaceScanningProviderFactory, new ScreenDecorationsLogger(logcatLogBuffer("TestLogBuffer")), mFakeFacePropertyRepository, mJavaAdapter, mCameraProtectionLoader); mFakeFacePropertyRepository, mJavaAdapter, mCameraProtectionLoader, mViewCaptureAwareWindowManager); screenDecorations.start(); when(mContext.getDisplay()).thenReturn(mDisplay); when(mDisplay.getDisplayInfo(any())).thenAnswer(new Answer<Boolean>() { Loading Loading
packages/SystemUI/src/com/android/systemui/ScreenDecorations.java +5 −3 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ import android.widget.FrameLayout; import androidx.annotation.VisibleForTesting; import com.android.app.viewcapture.ViewCaptureAwareWindowManager; import com.android.internal.util.Preconditions; import com.android.settingslib.Utils; import com.android.systemui.biometrics.data.repository.FacePropertyRepository; Loading Loading @@ -168,7 +169,7 @@ public class ScreenDecorations implements ViewGroup mScreenDecorHwcWindow; @VisibleForTesting ScreenDecorHwcLayer mScreenDecorHwcLayer; private WindowManager mWindowManager; private ViewCaptureAwareWindowManager mWindowManager; private int mRotation; private UserSettingObserver mColorInversionSetting; @Nullable Loading Loading @@ -338,7 +339,8 @@ public class ScreenDecorations implements ScreenDecorationsLogger logger, FacePropertyRepository facePropertyRepository, JavaAdapter javaAdapter, CameraProtectionLoader cameraProtectionLoader) { CameraProtectionLoader cameraProtectionLoader, ViewCaptureAwareWindowManager viewCaptureAwareWindowManager) { mContext = context; mSecureSettings = secureSettings; mCommandRegistry = commandRegistry; Loading @@ -353,6 +355,7 @@ public class ScreenDecorations implements mLogger = logger; mFacePropertyRepository = facePropertyRepository; mJavaAdapter = javaAdapter; mWindowManager = viewCaptureAwareWindowManager; } private final ScreenDecorCommand.Callback mScreenDecorCommandCallback = (cmd, pw) -> { Loading Loading @@ -484,7 +487,6 @@ public class ScreenDecorations implements private void startOnScreenDecorationsThread() { Trace.beginSection("ScreenDecorations#startOnScreenDecorationsThread"); mWindowManager = mContext.getSystemService(WindowManager.class); mContext.getDisplay().getDisplayInfo(mDisplayInfo); mRotation = mDisplayInfo.rotation; mDisplaySize.x = mDisplayInfo.getNaturalWidth(); Loading
packages/SystemUI/tests/src/com/android/systemui/ScreenDecorationsTest.java +13 −2 Original line number Diff line number Diff line Loading @@ -80,6 +80,8 @@ import androidx.annotation.Nullable; import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.filters.SmallTest; import com.android.app.viewcapture.ViewCapture; import com.android.app.viewcapture.ViewCaptureAwareWindowManager; import com.android.keyguard.KeyguardUpdateMonitor; import com.android.systemui.biometrics.AuthController; import com.android.systemui.biometrics.data.repository.FakeFacePropertyRepository; Loading Loading @@ -109,6 +111,8 @@ import com.android.systemui.util.settings.FakeSettings; import com.android.systemui.util.settings.SecureSettings; import com.android.systemui.util.time.FakeSystemClock; import kotlin.Lazy; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; Loading @@ -127,6 +131,7 @@ public class ScreenDecorationsTest extends SysuiTestCase { private ScreenDecorations mScreenDecorations; private WindowManager mWindowManager; private ViewCaptureAwareWindowManager mViewCaptureAwareWindowManager; private DisplayManager mDisplayManager; private SecureSettings mSecureSettings; private FakeExecutor mExecutor; Loading Loading @@ -173,6 +178,8 @@ public class ScreenDecorationsTest extends SysuiTestCase { private CutoutDecorProviderFactory mCutoutFactory; @Mock private JavaAdapter mJavaAdapter; @Mock private Lazy<ViewCapture> mLazyViewCapture; private FakeFacePropertyRepository mFakeFacePropertyRepository = new FakeFacePropertyRepository(); Loading Loading @@ -245,12 +252,15 @@ public class ScreenDecorationsTest extends SysuiTestCase { new ScreenDecorationsLogger(logcatLogBuffer("TestLogBuffer")), mFakeFacePropertyRepository)); mViewCaptureAwareWindowManager = new ViewCaptureAwareWindowManager(mWindowManager, mLazyViewCapture, false); mScreenDecorations = spy(new ScreenDecorations(mContext, mSecureSettings, mCommandRegistry, mUserTracker, mDisplayTracker, mDotViewController, mThreadFactory, mPrivacyDotDecorProviderFactory, mFaceScanningProviderFactory, new ScreenDecorationsLogger(logcatLogBuffer("TestLogBuffer")), mFakeFacePropertyRepository, mJavaAdapter, mCameraProtectionLoader) { mFakeFacePropertyRepository, mJavaAdapter, mCameraProtectionLoader, mViewCaptureAwareWindowManager) { @Override public void start() { super.start(); Loading Loading @@ -1264,7 +1274,8 @@ public class ScreenDecorationsTest extends SysuiTestCase { mDotViewController, mThreadFactory, mPrivacyDotDecorProviderFactory, mFaceScanningProviderFactory, new ScreenDecorationsLogger(logcatLogBuffer("TestLogBuffer")), mFakeFacePropertyRepository, mJavaAdapter, mCameraProtectionLoader); mFakeFacePropertyRepository, mJavaAdapter, mCameraProtectionLoader, mViewCaptureAwareWindowManager); screenDecorations.start(); when(mContext.getDisplay()).thenReturn(mDisplay); when(mDisplay.getDisplayInfo(any())).thenAnswer(new Answer<Boolean>() { Loading