Loading packages/SystemUI/aconfig/systemui.aconfig +0 −10 Original line number Diff line number Diff line Loading @@ -1047,16 +1047,6 @@ flag { } } flag { namespace: "systemui" name: "privacy_dot_unfold_wrong_corner_fix" description: "Fixes an issue where the privacy dot is at the wrong corner after unfolding/folding." bug: "339335643" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "validate_keyboard_shortcut_helper_icon_uri" namespace: "systemui" Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/events/PrivacyDotViewControllerTest.kt +2 −28 Original line number Diff line number Diff line Loading @@ -18,8 +18,6 @@ package com.android.systemui.statusbar.events import android.graphics.Point import android.graphics.Rect import android.platform.test.annotations.DisableFlags import android.platform.test.annotations.EnableFlags import android.testing.TestableLooper.RunWithLooper import android.view.Display import android.view.DisplayAdjustments Loading @@ -28,7 +26,6 @@ import android.widget.FrameLayout import android.widget.FrameLayout.LayoutParams.UNSPECIFIED_GRAVITY import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.Flags import com.android.systemui.SysuiTestCase import com.android.systemui.res.R import com.android.systemui.statusbar.FakeStatusBarStateController Loading Loading @@ -297,8 +294,7 @@ class PrivacyDotViewControllerTest : SysuiTestCase() { } @Test @EnableFlags(Flags.FLAG_PRIVACY_DOT_UNFOLD_WRONG_CORNER_FIX) fun initialize_newViews_fixFlagEnabled_gravityIsUpdated() { fun initialize_newViews_gravityIsUpdated() { val newTopLeftView = initDotView() val newTopRightView = initDotView() val newBottomLeftView = initDotView() Loading @@ -318,28 +314,6 @@ class PrivacyDotViewControllerTest : SysuiTestCase() { .isNotEqualTo(UNSPECIFIED_GRAVITY) } @Test @DisableFlags(Flags.FLAG_PRIVACY_DOT_UNFOLD_WRONG_CORNER_FIX) fun initialize_newViews_fixFlagDisabled_gravityIsNotUpdated() { val newTopLeftView = initDotView() val newTopRightView = initDotView() val newBottomLeftView = initDotView() val newBottomRightView = initDotView() setRotation(ROTATION_LANDSCAPE) // Bottom right used in landscape val controller = createAndInitializeController() // Re-init with different views, but same rotation controller.initialize( newTopLeftView, newTopRightView, newBottomLeftView, newBottomRightView ) assertThat((newBottomRightView.layoutParams as FrameLayout.LayoutParams).gravity) .isEqualTo(UNSPECIFIED_GRAVITY) } private fun setRotation(rotation: Int) { whenever(mockDisplay.rotation).thenReturn(rotation) } Loading packages/SystemUI/src/com/android/systemui/statusbar/events/PrivacyDotViewController.kt +107 −108 Original line number Diff line number Diff line Loading @@ -26,7 +26,6 @@ import android.widget.FrameLayout import androidx.core.animation.Animator import com.android.app.animation.Interpolators import com.android.internal.annotations.GuardedBy import com.android.systemui.Flags.privacyDotUnfoldWrongCornerFix import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.dagger.qualifiers.Main Loading @@ -45,10 +44,10 @@ import com.android.systemui.util.leak.RotationUtils.ROTATION_NONE import com.android.systemui.util.leak.RotationUtils.ROTATION_SEASCAPE import com.android.systemui.util.leak.RotationUtils.ROTATION_UPSIDE_DOWN import com.android.systemui.util.leak.RotationUtils.Rotation import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch import java.util.concurrent.Executor import javax.inject.Inject import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch /** * Understands how to keep the persistent privacy dot in the corner of the screen in Loading @@ -61,12 +60,13 @@ import javax.inject.Inject * Views will match the status bar top padding and status bar height so that the dot can appear to * reside directly after the status bar system contents (basically after the battery). * * NOTE: any operation that modifies views directly must run on the provided executor, because * these views are owned by ScreenDecorations and it runs in its own thread * NOTE: any operation that modifies views directly must run on the provided executor, because these * views are owned by ScreenDecorations and it runs in its own thread */ @SysUISingleton open class PrivacyDotViewController @Inject constructor( open class PrivacyDotViewController @Inject constructor( @Main private val mainExecutor: Executor, @Application scope: CoroutineScope, private val stateController: StatusBarStateController, Loading @@ -90,6 +90,7 @@ open class PrivacyDotViewController @Inject constructor( field = value scheduleUpdate() } private val lock = Object() private var cancelRunnable: Runnable? = null Loading @@ -106,14 +107,17 @@ open class PrivacyDotViewController @Inject constructor( get() = field init { contentInsetsProvider.addCallback(object : StatusBarContentInsetsChangedListener { contentInsetsProvider.addCallback( object : StatusBarContentInsetsChangedListener { override fun onStatusBarContentInsetsChanged() { dlog("onStatusBarContentInsetsChanged: ") setNewLayoutRects() } }) } ) configurationController.addCallback(object : ConfigurationController.ConfigurationListener { configurationController.addCallback( object : ConfigurationController.ConfigurationListener { override fun onLayoutDirectionChanged(isRtl: Boolean) { uiExecutor?.execute { // If rtl changed, hide all dotes until the next state resolves Loading @@ -121,16 +125,16 @@ open class PrivacyDotViewController @Inject constructor( synchronized(this) { val corner = selectDesignatedCorner(nextViewState.rotation, isRtl) nextViewState = nextViewState.copy( layoutRtl = isRtl, designatedCorner = corner ) nextViewState = nextViewState.copy(layoutRtl = isRtl, designatedCorner = corner) } } } } }) ) stateController.addCallback(object : StatusBarStateController.StateListener { stateController.addCallback( object : StatusBarStateController.StateListener { override fun onExpandedChanged(isExpanded: Boolean) { updateStatusBarState() } Loading @@ -138,14 +142,13 @@ open class PrivacyDotViewController @Inject constructor( override fun onStateChanged(newState: Int) { updateStatusBarState() } }) } ) scope.launch { shadeInteractor?.isQsExpanded?.collect { isQsExpanded -> dlog("setQsExpanded $isQsExpanded") synchronized(lock) { nextViewState = nextViewState.copy(qsExpanded = isQsExpanded) } synchronized(lock) { nextViewState = nextViewState.copy(qsExpanded = isQsExpanded) } } } } Loading Loading @@ -179,11 +182,13 @@ open class PrivacyDotViewController @Inject constructor( val paddingTop = contentInsetsProvider.getStatusBarPaddingTop(rot) synchronized(lock) { nextViewState = nextViewState.copy( nextViewState = nextViewState.copy( rotation = rot, paddingTop = paddingTop, designatedCorner = newCorner, cornerIndex = index) cornerIndex = index ) } } Loading Loading @@ -241,8 +246,8 @@ open class PrivacyDotViewController @Inject constructor( } // Set the dot's view gravity to hug the status bar (corner.requireViewById<View>(R.id.privacy_dot) .layoutParams as FrameLayout.LayoutParams) (corner.requireViewById<View>(R.id.privacy_dot).layoutParams as FrameLayout.LayoutParams) .gravity = rotatedCorner.innerGravity() } } Loading Loading @@ -353,10 +358,7 @@ open class PrivacyDotViewController @Inject constructor( clearAnimation() visibility = View.VISIBLE alpha = 0f animate() .alpha(1.0f) .setDuration(300) .start() animate().alpha(1.0f).setDuration(300).start() } } } Loading Loading @@ -405,15 +407,21 @@ open class PrivacyDotViewController @Inject constructor( private fun widthForCorner(corner: Int, left: Int, right: Int): Int { return when (corner) { TOP_LEFT, BOTTOM_LEFT -> left TOP_RIGHT, BOTTOM_RIGHT -> right TOP_LEFT, BOTTOM_LEFT -> left TOP_RIGHT, BOTTOM_RIGHT -> right else -> throw IllegalArgumentException("Unknown corner") } } fun initialize(topLeft: View, topRight: View, bottomLeft: View, bottomRight: View) { if (this::tl.isInitialized && this::tr.isInitialized && this::bl.isInitialized && this::br.isInitialized) { if ( this::tl.isInitialized && this::tr.isInitialized && this::bl.isInitialized && this::br.isInitialized ) { if (tl == topLeft && tr == topRight && bl == bottomLeft && br == bottomRight) { return } Loading @@ -430,19 +438,17 @@ open class PrivacyDotViewController @Inject constructor( val index = dc.cornerIndex() mainExecutor.execute { animationScheduler.addCallback(systemStatusAnimationCallback) } mainExecutor.execute { animationScheduler.addCallback(systemStatusAnimationCallback) } val left = contentInsetsProvider.getStatusBarContentAreaForRotation(ROTATION_SEASCAPE) val top = contentInsetsProvider.getStatusBarContentAreaForRotation(ROTATION_NONE) val right = contentInsetsProvider.getStatusBarContentAreaForRotation(ROTATION_LANDSCAPE) val bottom = contentInsetsProvider .getStatusBarContentAreaForRotation(ROTATION_UPSIDE_DOWN) val bottom = contentInsetsProvider.getStatusBarContentAreaForRotation(ROTATION_UPSIDE_DOWN) val paddingTop = contentInsetsProvider.getStatusBarPaddingTop() synchronized(lock) { nextViewState = nextViewState.copy( nextViewState = nextViewState.copy( viewInitialized = true, designatedCorner = dc, cornerIndex = index, Loading @@ -457,9 +463,7 @@ open class PrivacyDotViewController @Inject constructor( } private fun updateStatusBarState() { synchronized(lock) { nextViewState = nextViewState.copy(shadeExpanded = isShadeInQs()) } synchronized(lock) { nextViewState = nextViewState.copy(shadeExpanded = isShadeInQs()) } } /** Loading @@ -476,9 +480,7 @@ open class PrivacyDotViewController @Inject constructor( dlog("scheduleUpdate: ") cancelRunnable?.run() cancelRunnable = uiExecutor?.executeDelayed({ processNextViewState() }, 100) cancelRunnable = uiExecutor?.executeDelayed({ processNextViewState() }, 100) } @UiThread Loading @@ -486,9 +488,7 @@ open class PrivacyDotViewController @Inject constructor( dlog("processNextViewState: ") val newState: ViewState synchronized(lock) { newState = nextViewState.copy() } synchronized(lock) { newState = nextViewState.copy() } resolveState(newState) } Loading @@ -508,7 +508,7 @@ open class PrivacyDotViewController @Inject constructor( val designatedCornerChanged = state.designatedCorner != currentViewState.designatedCorner val rotationChanged = state.rotation != currentViewState.rotation if (rotationChanged || (designatedCornerChanged && privacyDotUnfoldWrongCornerFix())) { if (rotationChanged || designatedCornerChanged) { // A rotation has started, hide the views to avoid flicker updateRotations(state.rotation, state.paddingTop) } Loading Loading @@ -550,9 +550,11 @@ open class PrivacyDotViewController @Inject constructor( contentDescr: String? ): Animator? { synchronized(lock) { nextViewState = nextViewState.copy( nextViewState = nextViewState.copy( systemPrivacyEventIsActive = true, contentDescription = contentDescr) contentDescription = contentDescr ) } return null Loading @@ -579,8 +581,7 @@ open class PrivacyDotViewController @Inject constructor( val left = contentInsetsProvider.getStatusBarContentAreaForRotation(ROTATION_SEASCAPE) val top = contentInsetsProvider.getStatusBarContentAreaForRotation(ROTATION_NONE) val right = contentInsetsProvider.getStatusBarContentAreaForRotation(ROTATION_LANDSCAPE) val bottom = contentInsetsProvider .getStatusBarContentAreaForRotation(ROTATION_UPSIDE_DOWN) val bottom = contentInsetsProvider.getStatusBarContentAreaForRotation(ROTATION_UPSIDE_DOWN) return listOf(left, top, right, bottom) } Loading @@ -589,7 +590,8 @@ open class PrivacyDotViewController @Inject constructor( val rects = getLayoutRects() synchronized(lock) { nextViewState = nextViewState.copy( nextViewState = nextViewState.copy( seascapeRect = rects[0], portraitRect = rects[1], landscapeRect = rects[2], Loading @@ -600,6 +602,7 @@ open class PrivacyDotViewController @Inject constructor( interface ShowingListener { fun onPrivacyDotShown(v: View?) fun onPrivacyDotHidden(v: View?) } } Loading Loading @@ -647,22 +650,18 @@ private fun Int.innerGravity(): Int { data class ViewState( val viewInitialized: Boolean = false, val systemPrivacyEventIsActive: Boolean = false, val shadeExpanded: Boolean = false, val qsExpanded: Boolean = false, val portraitRect: Rect? = null, val landscapeRect: Rect? = null, val upsideDownRect: Rect? = null, val seascapeRect: Rect? = null, val layoutRtl: Boolean = false, val rotation: Int = 0, val paddingTop: Int = 0, val cornerIndex: Int = -1, val designatedCorner: View? = null, val contentDescription: String? = null ) { fun shouldShowDot(): Boolean { Loading Loading
packages/SystemUI/aconfig/systemui.aconfig +0 −10 Original line number Diff line number Diff line Loading @@ -1047,16 +1047,6 @@ flag { } } flag { namespace: "systemui" name: "privacy_dot_unfold_wrong_corner_fix" description: "Fixes an issue where the privacy dot is at the wrong corner after unfolding/folding." bug: "339335643" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "validate_keyboard_shortcut_helper_icon_uri" namespace: "systemui" Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/events/PrivacyDotViewControllerTest.kt +2 −28 Original line number Diff line number Diff line Loading @@ -18,8 +18,6 @@ package com.android.systemui.statusbar.events import android.graphics.Point import android.graphics.Rect import android.platform.test.annotations.DisableFlags import android.platform.test.annotations.EnableFlags import android.testing.TestableLooper.RunWithLooper import android.view.Display import android.view.DisplayAdjustments Loading @@ -28,7 +26,6 @@ import android.widget.FrameLayout import android.widget.FrameLayout.LayoutParams.UNSPECIFIED_GRAVITY import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.Flags import com.android.systemui.SysuiTestCase import com.android.systemui.res.R import com.android.systemui.statusbar.FakeStatusBarStateController Loading Loading @@ -297,8 +294,7 @@ class PrivacyDotViewControllerTest : SysuiTestCase() { } @Test @EnableFlags(Flags.FLAG_PRIVACY_DOT_UNFOLD_WRONG_CORNER_FIX) fun initialize_newViews_fixFlagEnabled_gravityIsUpdated() { fun initialize_newViews_gravityIsUpdated() { val newTopLeftView = initDotView() val newTopRightView = initDotView() val newBottomLeftView = initDotView() Loading @@ -318,28 +314,6 @@ class PrivacyDotViewControllerTest : SysuiTestCase() { .isNotEqualTo(UNSPECIFIED_GRAVITY) } @Test @DisableFlags(Flags.FLAG_PRIVACY_DOT_UNFOLD_WRONG_CORNER_FIX) fun initialize_newViews_fixFlagDisabled_gravityIsNotUpdated() { val newTopLeftView = initDotView() val newTopRightView = initDotView() val newBottomLeftView = initDotView() val newBottomRightView = initDotView() setRotation(ROTATION_LANDSCAPE) // Bottom right used in landscape val controller = createAndInitializeController() // Re-init with different views, but same rotation controller.initialize( newTopLeftView, newTopRightView, newBottomLeftView, newBottomRightView ) assertThat((newBottomRightView.layoutParams as FrameLayout.LayoutParams).gravity) .isEqualTo(UNSPECIFIED_GRAVITY) } private fun setRotation(rotation: Int) { whenever(mockDisplay.rotation).thenReturn(rotation) } Loading
packages/SystemUI/src/com/android/systemui/statusbar/events/PrivacyDotViewController.kt +107 −108 Original line number Diff line number Diff line Loading @@ -26,7 +26,6 @@ import android.widget.FrameLayout import androidx.core.animation.Animator import com.android.app.animation.Interpolators import com.android.internal.annotations.GuardedBy import com.android.systemui.Flags.privacyDotUnfoldWrongCornerFix import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.dagger.qualifiers.Main Loading @@ -45,10 +44,10 @@ import com.android.systemui.util.leak.RotationUtils.ROTATION_NONE import com.android.systemui.util.leak.RotationUtils.ROTATION_SEASCAPE import com.android.systemui.util.leak.RotationUtils.ROTATION_UPSIDE_DOWN import com.android.systemui.util.leak.RotationUtils.Rotation import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch import java.util.concurrent.Executor import javax.inject.Inject import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch /** * Understands how to keep the persistent privacy dot in the corner of the screen in Loading @@ -61,12 +60,13 @@ import javax.inject.Inject * Views will match the status bar top padding and status bar height so that the dot can appear to * reside directly after the status bar system contents (basically after the battery). * * NOTE: any operation that modifies views directly must run on the provided executor, because * these views are owned by ScreenDecorations and it runs in its own thread * NOTE: any operation that modifies views directly must run on the provided executor, because these * views are owned by ScreenDecorations and it runs in its own thread */ @SysUISingleton open class PrivacyDotViewController @Inject constructor( open class PrivacyDotViewController @Inject constructor( @Main private val mainExecutor: Executor, @Application scope: CoroutineScope, private val stateController: StatusBarStateController, Loading @@ -90,6 +90,7 @@ open class PrivacyDotViewController @Inject constructor( field = value scheduleUpdate() } private val lock = Object() private var cancelRunnable: Runnable? = null Loading @@ -106,14 +107,17 @@ open class PrivacyDotViewController @Inject constructor( get() = field init { contentInsetsProvider.addCallback(object : StatusBarContentInsetsChangedListener { contentInsetsProvider.addCallback( object : StatusBarContentInsetsChangedListener { override fun onStatusBarContentInsetsChanged() { dlog("onStatusBarContentInsetsChanged: ") setNewLayoutRects() } }) } ) configurationController.addCallback(object : ConfigurationController.ConfigurationListener { configurationController.addCallback( object : ConfigurationController.ConfigurationListener { override fun onLayoutDirectionChanged(isRtl: Boolean) { uiExecutor?.execute { // If rtl changed, hide all dotes until the next state resolves Loading @@ -121,16 +125,16 @@ open class PrivacyDotViewController @Inject constructor( synchronized(this) { val corner = selectDesignatedCorner(nextViewState.rotation, isRtl) nextViewState = nextViewState.copy( layoutRtl = isRtl, designatedCorner = corner ) nextViewState = nextViewState.copy(layoutRtl = isRtl, designatedCorner = corner) } } } } }) ) stateController.addCallback(object : StatusBarStateController.StateListener { stateController.addCallback( object : StatusBarStateController.StateListener { override fun onExpandedChanged(isExpanded: Boolean) { updateStatusBarState() } Loading @@ -138,14 +142,13 @@ open class PrivacyDotViewController @Inject constructor( override fun onStateChanged(newState: Int) { updateStatusBarState() } }) } ) scope.launch { shadeInteractor?.isQsExpanded?.collect { isQsExpanded -> dlog("setQsExpanded $isQsExpanded") synchronized(lock) { nextViewState = nextViewState.copy(qsExpanded = isQsExpanded) } synchronized(lock) { nextViewState = nextViewState.copy(qsExpanded = isQsExpanded) } } } } Loading Loading @@ -179,11 +182,13 @@ open class PrivacyDotViewController @Inject constructor( val paddingTop = contentInsetsProvider.getStatusBarPaddingTop(rot) synchronized(lock) { nextViewState = nextViewState.copy( nextViewState = nextViewState.copy( rotation = rot, paddingTop = paddingTop, designatedCorner = newCorner, cornerIndex = index) cornerIndex = index ) } } Loading Loading @@ -241,8 +246,8 @@ open class PrivacyDotViewController @Inject constructor( } // Set the dot's view gravity to hug the status bar (corner.requireViewById<View>(R.id.privacy_dot) .layoutParams as FrameLayout.LayoutParams) (corner.requireViewById<View>(R.id.privacy_dot).layoutParams as FrameLayout.LayoutParams) .gravity = rotatedCorner.innerGravity() } } Loading Loading @@ -353,10 +358,7 @@ open class PrivacyDotViewController @Inject constructor( clearAnimation() visibility = View.VISIBLE alpha = 0f animate() .alpha(1.0f) .setDuration(300) .start() animate().alpha(1.0f).setDuration(300).start() } } } Loading Loading @@ -405,15 +407,21 @@ open class PrivacyDotViewController @Inject constructor( private fun widthForCorner(corner: Int, left: Int, right: Int): Int { return when (corner) { TOP_LEFT, BOTTOM_LEFT -> left TOP_RIGHT, BOTTOM_RIGHT -> right TOP_LEFT, BOTTOM_LEFT -> left TOP_RIGHT, BOTTOM_RIGHT -> right else -> throw IllegalArgumentException("Unknown corner") } } fun initialize(topLeft: View, topRight: View, bottomLeft: View, bottomRight: View) { if (this::tl.isInitialized && this::tr.isInitialized && this::bl.isInitialized && this::br.isInitialized) { if ( this::tl.isInitialized && this::tr.isInitialized && this::bl.isInitialized && this::br.isInitialized ) { if (tl == topLeft && tr == topRight && bl == bottomLeft && br == bottomRight) { return } Loading @@ -430,19 +438,17 @@ open class PrivacyDotViewController @Inject constructor( val index = dc.cornerIndex() mainExecutor.execute { animationScheduler.addCallback(systemStatusAnimationCallback) } mainExecutor.execute { animationScheduler.addCallback(systemStatusAnimationCallback) } val left = contentInsetsProvider.getStatusBarContentAreaForRotation(ROTATION_SEASCAPE) val top = contentInsetsProvider.getStatusBarContentAreaForRotation(ROTATION_NONE) val right = contentInsetsProvider.getStatusBarContentAreaForRotation(ROTATION_LANDSCAPE) val bottom = contentInsetsProvider .getStatusBarContentAreaForRotation(ROTATION_UPSIDE_DOWN) val bottom = contentInsetsProvider.getStatusBarContentAreaForRotation(ROTATION_UPSIDE_DOWN) val paddingTop = contentInsetsProvider.getStatusBarPaddingTop() synchronized(lock) { nextViewState = nextViewState.copy( nextViewState = nextViewState.copy( viewInitialized = true, designatedCorner = dc, cornerIndex = index, Loading @@ -457,9 +463,7 @@ open class PrivacyDotViewController @Inject constructor( } private fun updateStatusBarState() { synchronized(lock) { nextViewState = nextViewState.copy(shadeExpanded = isShadeInQs()) } synchronized(lock) { nextViewState = nextViewState.copy(shadeExpanded = isShadeInQs()) } } /** Loading @@ -476,9 +480,7 @@ open class PrivacyDotViewController @Inject constructor( dlog("scheduleUpdate: ") cancelRunnable?.run() cancelRunnable = uiExecutor?.executeDelayed({ processNextViewState() }, 100) cancelRunnable = uiExecutor?.executeDelayed({ processNextViewState() }, 100) } @UiThread Loading @@ -486,9 +488,7 @@ open class PrivacyDotViewController @Inject constructor( dlog("processNextViewState: ") val newState: ViewState synchronized(lock) { newState = nextViewState.copy() } synchronized(lock) { newState = nextViewState.copy() } resolveState(newState) } Loading @@ -508,7 +508,7 @@ open class PrivacyDotViewController @Inject constructor( val designatedCornerChanged = state.designatedCorner != currentViewState.designatedCorner val rotationChanged = state.rotation != currentViewState.rotation if (rotationChanged || (designatedCornerChanged && privacyDotUnfoldWrongCornerFix())) { if (rotationChanged || designatedCornerChanged) { // A rotation has started, hide the views to avoid flicker updateRotations(state.rotation, state.paddingTop) } Loading Loading @@ -550,9 +550,11 @@ open class PrivacyDotViewController @Inject constructor( contentDescr: String? ): Animator? { synchronized(lock) { nextViewState = nextViewState.copy( nextViewState = nextViewState.copy( systemPrivacyEventIsActive = true, contentDescription = contentDescr) contentDescription = contentDescr ) } return null Loading @@ -579,8 +581,7 @@ open class PrivacyDotViewController @Inject constructor( val left = contentInsetsProvider.getStatusBarContentAreaForRotation(ROTATION_SEASCAPE) val top = contentInsetsProvider.getStatusBarContentAreaForRotation(ROTATION_NONE) val right = contentInsetsProvider.getStatusBarContentAreaForRotation(ROTATION_LANDSCAPE) val bottom = contentInsetsProvider .getStatusBarContentAreaForRotation(ROTATION_UPSIDE_DOWN) val bottom = contentInsetsProvider.getStatusBarContentAreaForRotation(ROTATION_UPSIDE_DOWN) return listOf(left, top, right, bottom) } Loading @@ -589,7 +590,8 @@ open class PrivacyDotViewController @Inject constructor( val rects = getLayoutRects() synchronized(lock) { nextViewState = nextViewState.copy( nextViewState = nextViewState.copy( seascapeRect = rects[0], portraitRect = rects[1], landscapeRect = rects[2], Loading @@ -600,6 +602,7 @@ open class PrivacyDotViewController @Inject constructor( interface ShowingListener { fun onPrivacyDotShown(v: View?) fun onPrivacyDotHidden(v: View?) } } Loading Loading @@ -647,22 +650,18 @@ private fun Int.innerGravity(): Int { data class ViewState( val viewInitialized: Boolean = false, val systemPrivacyEventIsActive: Boolean = false, val shadeExpanded: Boolean = false, val qsExpanded: Boolean = false, val portraitRect: Rect? = null, val landscapeRect: Rect? = null, val upsideDownRect: Rect? = null, val seascapeRect: Rect? = null, val layoutRtl: Boolean = false, val rotation: Int = 0, val paddingTop: Int = 0, val cornerIndex: Int = -1, val designatedCorner: View? = null, val contentDescription: String? = null ) { fun shouldShowDot(): Boolean { Loading