From 939a99cd4d8c536b935585444c2f2296fa563247 Mon Sep 17 00:00:00 2001 From: Matt Pietal Date: Thu, 22 Jul 2021 11:36:22 -0400 Subject: [PATCH] Fix multiple control providers Found an error in the logs: ControlsBindingControllerImpl: Provider for token:android.os.Binder@147a7f9 does not exist anymore And then noticed that the ControlsActivity was being started by framework when transitioning between ControlsFavoritingActivity and ControlsProviderSelelctionActivity. This is strictly due to window animations being enabled, and framework realizing that the ControlsActivity will be visible momentarily between activities. Previously uiController.show() was in the onStart() method, which resulted in ControlsBindingControllerImpl rebinding to a different service. By moving to onResume(), the call to uiController.show() can be avoided, hence avoiding the service rebinding so the controls can correctly be shown in the favoriting activity. Fixes: 191589943 Test: manual (requires multiple control services) Change-Id: I634ab7c386c2098dc8f9971d320a8b80b8cd429a --- .../android/systemui/controls/ui/ControlsActivity.kt | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsActivity.kt b/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsActivity.kt index c241c083a0a38..4104e3184efda 100644 --- a/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsActivity.kt +++ b/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsActivity.kt @@ -64,16 +64,12 @@ class ControlsActivity @Inject constructor( } } - override fun onStart() { - super.onStart() + override fun onResume() { + super.onResume() parent = requireViewById(R.id.global_actions_controls) parent.alpha = 0f uiController.show(parent, { finish() }, this) - } - - override fun onResume() { - super.onResume() ControlsAnimations.enterAnimation(parent).start() } @@ -82,8 +78,8 @@ class ControlsActivity @Inject constructor( finish() } - override fun onStop() { - super.onStop() + override fun onPause() { + super.onPause() uiController.hide() }