From 7632298bae521785a24af7de6dc9476e8d606569 Mon Sep 17 00:00:00 2001 From: Evan Laird Date: Wed, 21 Jul 2021 10:43:32 -0400 Subject: [PATCH] Remove top level interface implementation from PrivacyDotViewController addresses code comments Test: builds Change-Id: Ife29828421e2009fe1c98d0b8a4c35f6aaf2cdee --- .../statusbar/events/PrivacyDotViewController.kt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/events/PrivacyDotViewController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/events/PrivacyDotViewController.kt index 19a00d231ea2a..c1f05782ee928 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/events/PrivacyDotViewController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/events/PrivacyDotViewController.kt @@ -70,7 +70,7 @@ class PrivacyDotViewController @Inject constructor( private val configurationController: ConfigurationController, private val contentInsetsProvider: StatusBarContentInsetsProvider, private val animationScheduler: SystemStatusAnimationScheduler -) : StatusBarContentInsetsChangedListener { +) { private var sbHeightPortrait = 0 private var sbHeightLandscape = 0 @@ -98,7 +98,13 @@ class PrivacyDotViewController @Inject constructor( get() = if (!this::tl.isInitialized) sequenceOf() else sequenceOf(tl, tr, br, bl) init { - contentInsetsProvider.addCallback(this) + contentInsetsProvider.addCallback(object : StatusBarContentInsetsChangedListener { + override fun onStatusBarContentInsetsChanged() { + dlog("onStatusBarContentInsetsChanged: ") + setNewLayoutRects() + } + }) + configurationController.addCallback(object : ConfigurationController.ConfigurationListener { override fun onLayoutDirectionChanged(isRtl: Boolean) { synchronized(this) { @@ -533,11 +539,6 @@ class PrivacyDotViewController @Inject constructor( return -1 } - override fun onStatusBarContentInsetsChanged() { - Log.d(TAG, "onStatusBarContentInsetsChanged: ") - setNewLayoutRects() - } - // Returns [left, top, right, bottom] aka [seascape, none, landscape, upside-down] private fun getLayoutRects(): List { val left = contentInsetsProvider.getStatusBarContentInsetsForRotation(ROTATION_SEASCAPE)