Loading packages/SystemUI/src/com/android/systemui/DisplayCutoutBaseView.kt +19 −11 Original line number Diff line number Diff line Loading @@ -86,30 +86,38 @@ open class DisplayCutoutBaseView : View, RegionInterceptableView { onUpdate() } fun onDisplayChanged(newDisplayUniqueId: String?) { fun updateConfiguration(newDisplayUniqueId: String?) { val info = DisplayInfo() context.display?.getDisplayInfo(info) val oldMode: Display.Mode? = displayMode val display: Display? = context.display displayMode = display?.mode displayMode = info.mode if (displayUniqueId != display?.uniqueId) { displayUniqueId = display?.uniqueId shouldDrawCutout = DisplayCutout.getFillBuiltInDisplayCutout( context.resources, displayUniqueId ) } updateDisplayUniqueId(info.uniqueId) // Skip if display mode or cutout hasn't changed. if (!displayModeChanged(oldMode, displayMode) && display?.cutout == displayInfo.displayCutout) { displayInfo.displayCutout == info.displayCutout && displayRotation == info.rotation) { return } if (newDisplayUniqueId == display?.uniqueId) { if (newDisplayUniqueId == info.uniqueId) { displayRotation = info.rotation updateCutout() updateProtectionBoundingPath() onUpdate() } } open fun updateDisplayUniqueId(newDisplayUniqueId: String?) { if (displayUniqueId != newDisplayUniqueId) { displayUniqueId = newDisplayUniqueId shouldDrawCutout = DisplayCutout.getFillBuiltInDisplayCutout( context.resources, displayUniqueId ) invalidate() } } open fun updateRotation(rotation: Int) { displayRotation = rotation updateCutout() Loading packages/SystemUI/src/com/android/systemui/ScreenDecorations.java +5 −34 Original line number Diff line number Diff line Loading @@ -456,7 +456,6 @@ public class ScreenDecorations implements CoreStartable, Tunable , Dumpable { } } boolean needToUpdateProviderViews = false; final String newUniqueId = mDisplayInfo.uniqueId; if (!Objects.equals(newUniqueId, mDisplayUniqueId)) { mDisplayUniqueId = newUniqueId; Loading @@ -474,37 +473,6 @@ public class ScreenDecorations implements CoreStartable, Tunable , Dumpable { setupDecorations(); return; } if (mScreenDecorHwcLayer != null) { updateHwLayerRoundedCornerDrawable(); updateHwLayerRoundedCornerExistAndSize(); } needToUpdateProviderViews = true; } final float newRatio = getPhysicalPixelDisplaySizeRatio(); if (mRoundedCornerResDelegate.getPhysicalPixelDisplaySizeRatio() != newRatio) { mRoundedCornerResDelegate.setPhysicalPixelDisplaySizeRatio(newRatio); if (mScreenDecorHwcLayer != null) { updateHwLayerRoundedCornerExistAndSize(); } needToUpdateProviderViews = true; } if (needToUpdateProviderViews) { updateOverlayProviderViews(null); } else { updateOverlayProviderViews(new Integer[] { mFaceScanningViewId, R.id.display_cutout, R.id.display_cutout_left, R.id.display_cutout_right, R.id.display_cutout_bottom, }); } if (mScreenDecorHwcLayer != null) { mScreenDecorHwcLayer.onDisplayChanged(newUniqueId); } } }; Loading Loading @@ -1070,9 +1038,11 @@ public class ScreenDecorations implements CoreStartable, Tunable , Dumpable { && (newRotation != mRotation || displayModeChanged(mDisplayMode, newMod))) { mRotation = newRotation; mDisplayMode = newMod; mRoundedCornerResDelegate.setPhysicalPixelDisplaySizeRatio( getPhysicalPixelDisplaySizeRatio()); if (mScreenDecorHwcLayer != null) { mScreenDecorHwcLayer.pendingConfigChange = false; mScreenDecorHwcLayer.updateRotation(mRotation); mScreenDecorHwcLayer.updateConfiguration(mDisplayUniqueId); updateHwLayerRoundedCornerExistAndSize(); updateHwLayerRoundedCornerDrawable(); } Loading Loading @@ -1111,7 +1081,8 @@ public class ScreenDecorations implements CoreStartable, Tunable , Dumpable { context.getResources(), context.getDisplay().getUniqueId()); } private void updateOverlayProviderViews(@Nullable Integer[] filterIds) { @VisibleForTesting void updateOverlayProviderViews(@Nullable Integer[] filterIds) { if (mOverlays == null) { return; } Loading packages/SystemUI/src/com/android/systemui/decor/CutoutDecorProviderImpl.kt +1 −1 Original line number Diff line number Diff line Loading @@ -59,7 +59,7 @@ class CutoutDecorProviderImpl( (view as? DisplayCutoutView)?.let { cutoutView -> cutoutView.setColor(tintColor) cutoutView.updateRotation(rotation) cutoutView.onDisplayChanged(displayUniqueId) cutoutView.updateConfiguration(displayUniqueId) } } } packages/SystemUI/src/com/android/systemui/decor/FaceScanningProviderFactory.kt +1 −1 Original line number Diff line number Diff line Loading @@ -124,7 +124,7 @@ class FaceScanningOverlayProviderImpl( view.layoutParams = it (view as? FaceScanningOverlay)?.let { overlay -> overlay.setColor(tintColor) overlay.onDisplayChanged(displayUniqueId) overlay.updateConfiguration(displayUniqueId) } } } Loading packages/SystemUI/src/com/android/systemui/decor/RoundedCornerResDelegate.kt +6 −11 Original line number Diff line number Diff line Loading @@ -78,23 +78,18 @@ class RoundedCornerResDelegate( reloadMeasures() } private fun reloadAll(newReloadToken: Int) { if (reloadToken == newReloadToken) { return } reloadToken = newReloadToken reloadRes() reloadMeasures() } fun updateDisplayUniqueId(newDisplayUniqueId: String?, newReloadToken: Int?) { if (displayUniqueId != newDisplayUniqueId) { displayUniqueId = newDisplayUniqueId newReloadToken ?.let { reloadToken = it } reloadRes() reloadMeasures() } else { newReloadToken?.let { reloadAll(it) } } else if (newReloadToken != null) { if (reloadToken == newReloadToken) { return } reloadToken = newReloadToken reloadMeasures() } } Loading Loading
packages/SystemUI/src/com/android/systemui/DisplayCutoutBaseView.kt +19 −11 Original line number Diff line number Diff line Loading @@ -86,30 +86,38 @@ open class DisplayCutoutBaseView : View, RegionInterceptableView { onUpdate() } fun onDisplayChanged(newDisplayUniqueId: String?) { fun updateConfiguration(newDisplayUniqueId: String?) { val info = DisplayInfo() context.display?.getDisplayInfo(info) val oldMode: Display.Mode? = displayMode val display: Display? = context.display displayMode = display?.mode displayMode = info.mode if (displayUniqueId != display?.uniqueId) { displayUniqueId = display?.uniqueId shouldDrawCutout = DisplayCutout.getFillBuiltInDisplayCutout( context.resources, displayUniqueId ) } updateDisplayUniqueId(info.uniqueId) // Skip if display mode or cutout hasn't changed. if (!displayModeChanged(oldMode, displayMode) && display?.cutout == displayInfo.displayCutout) { displayInfo.displayCutout == info.displayCutout && displayRotation == info.rotation) { return } if (newDisplayUniqueId == display?.uniqueId) { if (newDisplayUniqueId == info.uniqueId) { displayRotation = info.rotation updateCutout() updateProtectionBoundingPath() onUpdate() } } open fun updateDisplayUniqueId(newDisplayUniqueId: String?) { if (displayUniqueId != newDisplayUniqueId) { displayUniqueId = newDisplayUniqueId shouldDrawCutout = DisplayCutout.getFillBuiltInDisplayCutout( context.resources, displayUniqueId ) invalidate() } } open fun updateRotation(rotation: Int) { displayRotation = rotation updateCutout() Loading
packages/SystemUI/src/com/android/systemui/ScreenDecorations.java +5 −34 Original line number Diff line number Diff line Loading @@ -456,7 +456,6 @@ public class ScreenDecorations implements CoreStartable, Tunable , Dumpable { } } boolean needToUpdateProviderViews = false; final String newUniqueId = mDisplayInfo.uniqueId; if (!Objects.equals(newUniqueId, mDisplayUniqueId)) { mDisplayUniqueId = newUniqueId; Loading @@ -474,37 +473,6 @@ public class ScreenDecorations implements CoreStartable, Tunable , Dumpable { setupDecorations(); return; } if (mScreenDecorHwcLayer != null) { updateHwLayerRoundedCornerDrawable(); updateHwLayerRoundedCornerExistAndSize(); } needToUpdateProviderViews = true; } final float newRatio = getPhysicalPixelDisplaySizeRatio(); if (mRoundedCornerResDelegate.getPhysicalPixelDisplaySizeRatio() != newRatio) { mRoundedCornerResDelegate.setPhysicalPixelDisplaySizeRatio(newRatio); if (mScreenDecorHwcLayer != null) { updateHwLayerRoundedCornerExistAndSize(); } needToUpdateProviderViews = true; } if (needToUpdateProviderViews) { updateOverlayProviderViews(null); } else { updateOverlayProviderViews(new Integer[] { mFaceScanningViewId, R.id.display_cutout, R.id.display_cutout_left, R.id.display_cutout_right, R.id.display_cutout_bottom, }); } if (mScreenDecorHwcLayer != null) { mScreenDecorHwcLayer.onDisplayChanged(newUniqueId); } } }; Loading Loading @@ -1070,9 +1038,11 @@ public class ScreenDecorations implements CoreStartable, Tunable , Dumpable { && (newRotation != mRotation || displayModeChanged(mDisplayMode, newMod))) { mRotation = newRotation; mDisplayMode = newMod; mRoundedCornerResDelegate.setPhysicalPixelDisplaySizeRatio( getPhysicalPixelDisplaySizeRatio()); if (mScreenDecorHwcLayer != null) { mScreenDecorHwcLayer.pendingConfigChange = false; mScreenDecorHwcLayer.updateRotation(mRotation); mScreenDecorHwcLayer.updateConfiguration(mDisplayUniqueId); updateHwLayerRoundedCornerExistAndSize(); updateHwLayerRoundedCornerDrawable(); } Loading Loading @@ -1111,7 +1081,8 @@ public class ScreenDecorations implements CoreStartable, Tunable , Dumpable { context.getResources(), context.getDisplay().getUniqueId()); } private void updateOverlayProviderViews(@Nullable Integer[] filterIds) { @VisibleForTesting void updateOverlayProviderViews(@Nullable Integer[] filterIds) { if (mOverlays == null) { return; } Loading
packages/SystemUI/src/com/android/systemui/decor/CutoutDecorProviderImpl.kt +1 −1 Original line number Diff line number Diff line Loading @@ -59,7 +59,7 @@ class CutoutDecorProviderImpl( (view as? DisplayCutoutView)?.let { cutoutView -> cutoutView.setColor(tintColor) cutoutView.updateRotation(rotation) cutoutView.onDisplayChanged(displayUniqueId) cutoutView.updateConfiguration(displayUniqueId) } } }
packages/SystemUI/src/com/android/systemui/decor/FaceScanningProviderFactory.kt +1 −1 Original line number Diff line number Diff line Loading @@ -124,7 +124,7 @@ class FaceScanningOverlayProviderImpl( view.layoutParams = it (view as? FaceScanningOverlay)?.let { overlay -> overlay.setColor(tintColor) overlay.onDisplayChanged(displayUniqueId) overlay.updateConfiguration(displayUniqueId) } } } Loading
packages/SystemUI/src/com/android/systemui/decor/RoundedCornerResDelegate.kt +6 −11 Original line number Diff line number Diff line Loading @@ -78,23 +78,18 @@ class RoundedCornerResDelegate( reloadMeasures() } private fun reloadAll(newReloadToken: Int) { if (reloadToken == newReloadToken) { return } reloadToken = newReloadToken reloadRes() reloadMeasures() } fun updateDisplayUniqueId(newDisplayUniqueId: String?, newReloadToken: Int?) { if (displayUniqueId != newDisplayUniqueId) { displayUniqueId = newDisplayUniqueId newReloadToken ?.let { reloadToken = it } reloadRes() reloadMeasures() } else { newReloadToken?.let { reloadAll(it) } } else if (newReloadToken != null) { if (reloadToken == newReloadToken) { return } reloadToken = newReloadToken reloadMeasures() } } Loading