Loading packages/SystemUI/src/com/android/systemui/DisplayCutoutBaseView.kt +1 −1 Original line number Diff line number Diff line Loading @@ -169,7 +169,7 @@ open class DisplayCutoutBaseView : View, RegionInterceptableView { return } cutoutPath.reset() display.getDisplayInfo(displayInfo) context.display?.getDisplayInfo(displayInfo) displayInfo.displayCutout?.cutoutPath?.let { path -> cutoutPath.set(path) } invalidate() } Loading packages/SystemUI/src/com/android/systemui/ScreenDecorations.java +8 −2 Original line number Diff line number Diff line Loading @@ -170,6 +170,7 @@ public class ScreenDecorations implements CoreStartable, Tunable , Dumpable { private Display.Mode mDisplayMode; @VisibleForTesting protected DisplayInfo mDisplayInfo = new DisplayInfo(); private DisplayCutout mDisplayCutout; @VisibleForTesting protected void showCameraProtection(@NonNull Path protectionPath, @NonNull Rect bounds) { Loading Loading @@ -384,6 +385,7 @@ public class ScreenDecorations implements CoreStartable, Tunable , Dumpable { mRotation = mDisplayInfo.rotation; mDisplayMode = mDisplayInfo.getMode(); mDisplayUniqueId = mDisplayInfo.uniqueId; mDisplayCutout = mDisplayInfo.displayCutout; mRoundedCornerResDelegate = new RoundedCornerResDelegate(mContext.getResources(), mDisplayUniqueId); mRoundedCornerResDelegate.setPhysicalPixelDisplaySizeRatio( Loading Loading @@ -1022,7 +1024,8 @@ public class ScreenDecorations implements CoreStartable, Tunable , Dumpable { mRoundedCornerResDelegate.dump(pw, args); } private void updateConfiguration() { @VisibleForTesting void updateConfiguration() { Preconditions.checkState(mHandler.getLooper().getThread() == Thread.currentThread(), "must call on " + mHandler.getLooper().getThread() + ", but was " + Thread.currentThread()); Loading @@ -1033,11 +1036,14 @@ public class ScreenDecorations implements CoreStartable, Tunable , Dumpable { mDotViewController.setNewRotation(newRotation); } final Display.Mode newMod = mDisplayInfo.getMode(); final DisplayCutout newCutout = mDisplayInfo.displayCutout; if (!mPendingConfigChange && (newRotation != mRotation || displayModeChanged(mDisplayMode, newMod))) { && (newRotation != mRotation || displayModeChanged(mDisplayMode, newMod) || !Objects.equals(newCutout, mDisplayCutout))) { mRotation = newRotation; mDisplayMode = newMod; mDisplayCutout = newCutout; mRoundedCornerResDelegate.setPhysicalPixelDisplaySizeRatio( getPhysicalPixelDisplaySizeRatio()); if (mScreenDecorHwcLayer != null) { Loading packages/SystemUI/tests/src/com/android/systemui/DisplayCutoutBaseViewTest.kt +5 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui import android.content.Context import android.graphics.Canvas import android.graphics.Insets import android.graphics.Path Loading Loading @@ -48,6 +49,7 @@ class DisplayCutoutBaseViewTest : SysuiTestCase() { @Mock private lateinit var mockCanvas: Canvas @Mock private lateinit var mockRootView: View @Mock private lateinit var mockDisplay: Display @Mock private lateinit var mockContext: Context private lateinit var cutoutBaseView: DisplayCutoutBaseView private val cutout: DisplayCutout = DisplayCutout.Builder() Loading Loading @@ -168,7 +170,9 @@ class DisplayCutoutBaseViewTest : SysuiTestCase() { R.bool.config_fillMainBuiltInDisplayCutout, fillCutout) cutoutBaseView = spy(DisplayCutoutBaseView(mContext)) whenever(cutoutBaseView.display).thenReturn(mockDisplay) whenever(cutoutBaseView.context).thenReturn(mockContext) whenever(mockContext.display).thenReturn(mockDisplay) whenever(mockDisplay.uniqueId).thenReturn("mockDisplayUniqueId") whenever(cutoutBaseView.rootView).thenReturn(mockRootView) whenever(cutoutBaseView.getPhysicalPixelDisplaySizeRatio()).thenReturn(1f) Loading packages/SystemUI/tests/src/com/android/systemui/ScreenDecorHwcLayerTest.kt +4 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui import android.content.Context import android.graphics.Insets import android.graphics.PixelFormat import android.graphics.Rect Loading Loading @@ -44,6 +45,7 @@ class ScreenDecorHwcLayerTest : SysuiTestCase() { @Mock private lateinit var mockDisplay: Display @Mock private lateinit var mockRootView: View @Mock private lateinit var mockContext: Context private val displayWidth = 100 private val displayHeight = 200 Loading Loading @@ -75,7 +77,8 @@ class ScreenDecorHwcLayerTest : SysuiTestCase() { decorHwcLayer = Mockito.spy(ScreenDecorHwcLayer(mContext, decorationSupport)) whenever(decorHwcLayer.width).thenReturn(displayWidth) whenever(decorHwcLayer.height).thenReturn(displayHeight) whenever(decorHwcLayer.display).thenReturn(mockDisplay) whenever(decorHwcLayer.context).thenReturn(mockContext) whenever(mockContext.display).thenReturn(mockDisplay) whenever(decorHwcLayer.rootView).thenReturn(mockRootView) whenever(mockRootView.left).thenReturn(0) whenever(mockRootView.top).thenReturn(0) Loading Loading
packages/SystemUI/src/com/android/systemui/DisplayCutoutBaseView.kt +1 −1 Original line number Diff line number Diff line Loading @@ -169,7 +169,7 @@ open class DisplayCutoutBaseView : View, RegionInterceptableView { return } cutoutPath.reset() display.getDisplayInfo(displayInfo) context.display?.getDisplayInfo(displayInfo) displayInfo.displayCutout?.cutoutPath?.let { path -> cutoutPath.set(path) } invalidate() } Loading
packages/SystemUI/src/com/android/systemui/ScreenDecorations.java +8 −2 Original line number Diff line number Diff line Loading @@ -170,6 +170,7 @@ public class ScreenDecorations implements CoreStartable, Tunable , Dumpable { private Display.Mode mDisplayMode; @VisibleForTesting protected DisplayInfo mDisplayInfo = new DisplayInfo(); private DisplayCutout mDisplayCutout; @VisibleForTesting protected void showCameraProtection(@NonNull Path protectionPath, @NonNull Rect bounds) { Loading Loading @@ -384,6 +385,7 @@ public class ScreenDecorations implements CoreStartable, Tunable , Dumpable { mRotation = mDisplayInfo.rotation; mDisplayMode = mDisplayInfo.getMode(); mDisplayUniqueId = mDisplayInfo.uniqueId; mDisplayCutout = mDisplayInfo.displayCutout; mRoundedCornerResDelegate = new RoundedCornerResDelegate(mContext.getResources(), mDisplayUniqueId); mRoundedCornerResDelegate.setPhysicalPixelDisplaySizeRatio( Loading Loading @@ -1022,7 +1024,8 @@ public class ScreenDecorations implements CoreStartable, Tunable , Dumpable { mRoundedCornerResDelegate.dump(pw, args); } private void updateConfiguration() { @VisibleForTesting void updateConfiguration() { Preconditions.checkState(mHandler.getLooper().getThread() == Thread.currentThread(), "must call on " + mHandler.getLooper().getThread() + ", but was " + Thread.currentThread()); Loading @@ -1033,11 +1036,14 @@ public class ScreenDecorations implements CoreStartable, Tunable , Dumpable { mDotViewController.setNewRotation(newRotation); } final Display.Mode newMod = mDisplayInfo.getMode(); final DisplayCutout newCutout = mDisplayInfo.displayCutout; if (!mPendingConfigChange && (newRotation != mRotation || displayModeChanged(mDisplayMode, newMod))) { && (newRotation != mRotation || displayModeChanged(mDisplayMode, newMod) || !Objects.equals(newCutout, mDisplayCutout))) { mRotation = newRotation; mDisplayMode = newMod; mDisplayCutout = newCutout; mRoundedCornerResDelegate.setPhysicalPixelDisplaySizeRatio( getPhysicalPixelDisplaySizeRatio()); if (mScreenDecorHwcLayer != null) { Loading
packages/SystemUI/tests/src/com/android/systemui/DisplayCutoutBaseViewTest.kt +5 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui import android.content.Context import android.graphics.Canvas import android.graphics.Insets import android.graphics.Path Loading Loading @@ -48,6 +49,7 @@ class DisplayCutoutBaseViewTest : SysuiTestCase() { @Mock private lateinit var mockCanvas: Canvas @Mock private lateinit var mockRootView: View @Mock private lateinit var mockDisplay: Display @Mock private lateinit var mockContext: Context private lateinit var cutoutBaseView: DisplayCutoutBaseView private val cutout: DisplayCutout = DisplayCutout.Builder() Loading Loading @@ -168,7 +170,9 @@ class DisplayCutoutBaseViewTest : SysuiTestCase() { R.bool.config_fillMainBuiltInDisplayCutout, fillCutout) cutoutBaseView = spy(DisplayCutoutBaseView(mContext)) whenever(cutoutBaseView.display).thenReturn(mockDisplay) whenever(cutoutBaseView.context).thenReturn(mockContext) whenever(mockContext.display).thenReturn(mockDisplay) whenever(mockDisplay.uniqueId).thenReturn("mockDisplayUniqueId") whenever(cutoutBaseView.rootView).thenReturn(mockRootView) whenever(cutoutBaseView.getPhysicalPixelDisplaySizeRatio()).thenReturn(1f) Loading
packages/SystemUI/tests/src/com/android/systemui/ScreenDecorHwcLayerTest.kt +4 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui import android.content.Context import android.graphics.Insets import android.graphics.PixelFormat import android.graphics.Rect Loading Loading @@ -44,6 +45,7 @@ class ScreenDecorHwcLayerTest : SysuiTestCase() { @Mock private lateinit var mockDisplay: Display @Mock private lateinit var mockRootView: View @Mock private lateinit var mockContext: Context private val displayWidth = 100 private val displayHeight = 200 Loading Loading @@ -75,7 +77,8 @@ class ScreenDecorHwcLayerTest : SysuiTestCase() { decorHwcLayer = Mockito.spy(ScreenDecorHwcLayer(mContext, decorationSupport)) whenever(decorHwcLayer.width).thenReturn(displayWidth) whenever(decorHwcLayer.height).thenReturn(displayHeight) whenever(decorHwcLayer.display).thenReturn(mockDisplay) whenever(decorHwcLayer.context).thenReturn(mockContext) whenever(mockContext.display).thenReturn(mockDisplay) whenever(decorHwcLayer.rootView).thenReturn(mockRootView) whenever(mockRootView.left).thenReturn(0) whenever(mockRootView.top).thenReturn(0) Loading