Loading packages/SystemUI/src/com/android/systemui/ScreenDecorations.java +15 −20 Original line number Diff line number Diff line Loading @@ -64,7 +64,6 @@ import android.view.ViewGroup.LayoutParams; import android.view.ViewTreeObserver; import android.view.WindowManager; import android.widget.FrameLayout; import android.widget.ImageView; import androidx.annotation.VisibleForTesting; Loading Loading @@ -292,11 +291,6 @@ public class ScreenDecorations extends CoreStartable implements Tunable , Dumpab return decorProviders; } private void updateDisplayIdToProviderFactories() { mDotFactory.onDisplayUniqueIdChanged(mDisplayUniqueId); mRoundedCornerFactory.onDisplayUniqueIdChanged(mDisplayUniqueId); } /** * Check that newProviders is the same list with decorProviders inside mOverlay. * @param newProviders expected comparing DecorProviders Loading Loading @@ -389,7 +383,7 @@ public class ScreenDecorations extends CoreStartable implements Tunable , Dumpab final DisplayDecorationSupport newScreenDecorationSupport = mContext.getDisplay().getDisplayDecorationSupport(); updateDisplayIdToProviderFactories(); mRoundedCornerResDelegate.updateDisplayUniqueId(newUniqueId, null); // When providers or the value of mSupportHwcScreenDecoration is changed, // re-setup the whole screen decoration. Loading Loading @@ -857,6 +851,15 @@ public class ScreenDecorations extends CoreStartable implements Tunable , Dumpab } ColorStateList tintList = ColorStateList.valueOf(mTintColor); mRoundedCornerResDelegate.setColorTintList(tintList); Integer[] roundedCornerIds = { R.id.rounded_corner_top_left, R.id.rounded_corner_top_right, R.id.rounded_corner_bottom_left, R.id.rounded_corner_bottom_right }; for (int i = 0; i < BOUNDS_POSITION_LENGTH; i++) { if (mOverlays[i] == null) { continue; Loading @@ -866,19 +869,12 @@ public class ScreenDecorations extends CoreStartable implements Tunable , Dumpab View child; for (int j = 0; j < size; j++) { child = overlayView.getChildAt(j); if (child.getId() == R.id.privacy_dot_top_left_container || child.getId() == R.id.privacy_dot_top_right_container || child.getId() == R.id.privacy_dot_bottom_left_container || child.getId() == R.id.privacy_dot_bottom_right_container) { // Exclude privacy dot from color inversion (for now?) continue; } if (child instanceof ImageView) { ((ImageView) child).setImageTintList(tintList); } else if (child instanceof DisplayCutoutView) { if (child instanceof DisplayCutoutView) { ((DisplayCutoutView) child).setColor(mTintColor); } } mOverlays[i].onReloadResAndMeasure(roundedCornerIds, mProviderRefreshToken, mRotation, mDisplayUniqueId); } } Loading Loading @@ -1067,12 +1063,11 @@ public class ScreenDecorations extends CoreStartable implements Tunable , Dumpab if (mOverlays == null || !SIZE.equals(key)) { return; } ++mProviderRefreshToken; try { final int sizeFactor = Integer.parseInt(newValue); mRoundedCornerResDelegate.updateTuningSizeFactor(sizeFactor, mProviderRefreshToken); mRoundedCornerResDelegate.setTuningSizeFactor(sizeFactor); } catch (NumberFormatException e) { mRoundedCornerResDelegate.updateTuningSizeFactor(null, mProviderRefreshToken); mRoundedCornerResDelegate.setTuningSizeFactor(null); } Integer[] filterIds = { R.id.rounded_corner_top_left, Loading packages/SystemUI/src/com/android/systemui/decor/DecorProviderFactory.kt +0 −1 Original line number Diff line number Diff line Loading @@ -19,5 +19,4 @@ package com.android.systemui.decor abstract class DecorProviderFactory { abstract val providers: List<DecorProvider> abstract val hasProviders: Boolean abstract fun onDisplayUniqueIdChanged(displayUniqueId: String?) } No newline at end of file packages/SystemUI/src/com/android/systemui/decor/PrivacyDotDecorProviderFactory.kt +0 −4 Original line number Diff line number Diff line Loading @@ -39,10 +39,6 @@ class PrivacyDotDecorProviderFactory @Inject constructor( override val hasProviders: Boolean get() = isPrivacyDotEnabled override fun onDisplayUniqueIdChanged(displayUniqueId: String?) { // Do nothing for privacy dot } override val providers: List<DecorProvider> get() { return if (hasProviders) { Loading packages/SystemUI/src/com/android/systemui/decor/RoundedCornerDecorProviderFactory.kt +0 −4 Original line number Diff line number Diff line Loading @@ -28,10 +28,6 @@ class RoundedCornerDecorProviderFactory( hasTop || hasBottom } override fun onDisplayUniqueIdChanged(displayUniqueId: String?) { roundedCornerResDelegate.updateDisplayUniqueId(displayUniqueId, null) } override val providers: List<DecorProvider> get() { val hasTop = roundedCornerResDelegate.hasTop Loading packages/SystemUI/src/com/android/systemui/decor/RoundedCornerDecorProviderImpl.kt +1 −3 Original line number Diff line number Diff line Loading @@ -65,7 +65,7 @@ class RoundedCornerDecorProviderImpl( private fun initView(view: ImageView, @Surface.Rotation rotation: Int) { view.setRoundedCornerImage(roundedCornerResDelegate, isTop) view.adjustRotation(alignedBounds, rotation) view.setColorFilter(IMAGE_TINT_COLOR) view.imageTintList = roundedCornerResDelegate.colorTintList } override fun onReloadResAndMeasure( Loading Loading @@ -93,8 +93,6 @@ class RoundedCornerDecorProviderImpl( } } private const val IMAGE_TINT_COLOR: Int = 0xFF000000.toInt() @DisplayCutout.BoundsPosition private fun Int.toLayoutGravity(@Surface.Rotation rotation: Int): Int = when (rotation) { Surface.ROTATION_0 -> when (this) { Loading Loading
packages/SystemUI/src/com/android/systemui/ScreenDecorations.java +15 −20 Original line number Diff line number Diff line Loading @@ -64,7 +64,6 @@ import android.view.ViewGroup.LayoutParams; import android.view.ViewTreeObserver; import android.view.WindowManager; import android.widget.FrameLayout; import android.widget.ImageView; import androidx.annotation.VisibleForTesting; Loading Loading @@ -292,11 +291,6 @@ public class ScreenDecorations extends CoreStartable implements Tunable , Dumpab return decorProviders; } private void updateDisplayIdToProviderFactories() { mDotFactory.onDisplayUniqueIdChanged(mDisplayUniqueId); mRoundedCornerFactory.onDisplayUniqueIdChanged(mDisplayUniqueId); } /** * Check that newProviders is the same list with decorProviders inside mOverlay. * @param newProviders expected comparing DecorProviders Loading Loading @@ -389,7 +383,7 @@ public class ScreenDecorations extends CoreStartable implements Tunable , Dumpab final DisplayDecorationSupport newScreenDecorationSupport = mContext.getDisplay().getDisplayDecorationSupport(); updateDisplayIdToProviderFactories(); mRoundedCornerResDelegate.updateDisplayUniqueId(newUniqueId, null); // When providers or the value of mSupportHwcScreenDecoration is changed, // re-setup the whole screen decoration. Loading Loading @@ -857,6 +851,15 @@ public class ScreenDecorations extends CoreStartable implements Tunable , Dumpab } ColorStateList tintList = ColorStateList.valueOf(mTintColor); mRoundedCornerResDelegate.setColorTintList(tintList); Integer[] roundedCornerIds = { R.id.rounded_corner_top_left, R.id.rounded_corner_top_right, R.id.rounded_corner_bottom_left, R.id.rounded_corner_bottom_right }; for (int i = 0; i < BOUNDS_POSITION_LENGTH; i++) { if (mOverlays[i] == null) { continue; Loading @@ -866,19 +869,12 @@ public class ScreenDecorations extends CoreStartable implements Tunable , Dumpab View child; for (int j = 0; j < size; j++) { child = overlayView.getChildAt(j); if (child.getId() == R.id.privacy_dot_top_left_container || child.getId() == R.id.privacy_dot_top_right_container || child.getId() == R.id.privacy_dot_bottom_left_container || child.getId() == R.id.privacy_dot_bottom_right_container) { // Exclude privacy dot from color inversion (for now?) continue; } if (child instanceof ImageView) { ((ImageView) child).setImageTintList(tintList); } else if (child instanceof DisplayCutoutView) { if (child instanceof DisplayCutoutView) { ((DisplayCutoutView) child).setColor(mTintColor); } } mOverlays[i].onReloadResAndMeasure(roundedCornerIds, mProviderRefreshToken, mRotation, mDisplayUniqueId); } } Loading Loading @@ -1067,12 +1063,11 @@ public class ScreenDecorations extends CoreStartable implements Tunable , Dumpab if (mOverlays == null || !SIZE.equals(key)) { return; } ++mProviderRefreshToken; try { final int sizeFactor = Integer.parseInt(newValue); mRoundedCornerResDelegate.updateTuningSizeFactor(sizeFactor, mProviderRefreshToken); mRoundedCornerResDelegate.setTuningSizeFactor(sizeFactor); } catch (NumberFormatException e) { mRoundedCornerResDelegate.updateTuningSizeFactor(null, mProviderRefreshToken); mRoundedCornerResDelegate.setTuningSizeFactor(null); } Integer[] filterIds = { R.id.rounded_corner_top_left, Loading
packages/SystemUI/src/com/android/systemui/decor/DecorProviderFactory.kt +0 −1 Original line number Diff line number Diff line Loading @@ -19,5 +19,4 @@ package com.android.systemui.decor abstract class DecorProviderFactory { abstract val providers: List<DecorProvider> abstract val hasProviders: Boolean abstract fun onDisplayUniqueIdChanged(displayUniqueId: String?) } No newline at end of file
packages/SystemUI/src/com/android/systemui/decor/PrivacyDotDecorProviderFactory.kt +0 −4 Original line number Diff line number Diff line Loading @@ -39,10 +39,6 @@ class PrivacyDotDecorProviderFactory @Inject constructor( override val hasProviders: Boolean get() = isPrivacyDotEnabled override fun onDisplayUniqueIdChanged(displayUniqueId: String?) { // Do nothing for privacy dot } override val providers: List<DecorProvider> get() { return if (hasProviders) { Loading
packages/SystemUI/src/com/android/systemui/decor/RoundedCornerDecorProviderFactory.kt +0 −4 Original line number Diff line number Diff line Loading @@ -28,10 +28,6 @@ class RoundedCornerDecorProviderFactory( hasTop || hasBottom } override fun onDisplayUniqueIdChanged(displayUniqueId: String?) { roundedCornerResDelegate.updateDisplayUniqueId(displayUniqueId, null) } override val providers: List<DecorProvider> get() { val hasTop = roundedCornerResDelegate.hasTop Loading
packages/SystemUI/src/com/android/systemui/decor/RoundedCornerDecorProviderImpl.kt +1 −3 Original line number Diff line number Diff line Loading @@ -65,7 +65,7 @@ class RoundedCornerDecorProviderImpl( private fun initView(view: ImageView, @Surface.Rotation rotation: Int) { view.setRoundedCornerImage(roundedCornerResDelegate, isTop) view.adjustRotation(alignedBounds, rotation) view.setColorFilter(IMAGE_TINT_COLOR) view.imageTintList = roundedCornerResDelegate.colorTintList } override fun onReloadResAndMeasure( Loading Loading @@ -93,8 +93,6 @@ class RoundedCornerDecorProviderImpl( } } private const val IMAGE_TINT_COLOR: Int = 0xFF000000.toInt() @DisplayCutout.BoundsPosition private fun Int.toLayoutGravity(@Surface.Rotation rotation: Int): Int = when (rotation) { Surface.ROTATION_0 -> when (this) { Loading