From b7adc6843c2f236b237bf2314b9f6094e3c086b0 Mon Sep 17 00:00:00 2001 From: Brandon Liu Date: Wed, 10 May 2023 23:04:30 +0000 Subject: [PATCH] Revert "Lifecycle has to use kotlin syntax" Revert submission 22208109-lifecycle_9778738 Reason for revert: Reverted changes: /q/submissionid:22208109-lifecycle_9778738 Change-Id: I9a5249529dd9b7a8d4c9c59a61b3a780371d7e6b --- .../controls/management/ControlsEditingActivity.kt | 2 +- .../controls/management/ControlsFavoritingActivity.kt | 2 +- .../management/ControlsProviderSelectorActivity.kt | 2 +- .../com/android/systemui/controls/ui/ControlsActivity.kt | 2 +- .../android/systemui/dreams/DreamOverlayLifecycleOwner.kt | 7 +++---- .../com/android/systemui/lifecycle/RepeatWhenAttached.kt | 7 +++---- 6 files changed, 10 insertions(+), 12 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/controls/management/ControlsEditingActivity.kt b/packages/SystemUI/src/com/android/systemui/controls/management/ControlsEditingActivity.kt index 8e41974b9acca..d629e3ea365e7 100644 --- a/packages/SystemUI/src/com/android/systemui/controls/management/ControlsEditingActivity.kt +++ b/packages/SystemUI/src/com/android/systemui/controls/management/ControlsEditingActivity.kt @@ -154,7 +154,7 @@ open class ControlsEditingActivity @Inject constructor( private fun bindViews() { setContentView(R.layout.controls_management) - lifecycle.addObserver( + getLifecycle().addObserver( ControlsAnimations.observerForAnimations( requireViewById(R.id.controls_management_root), window, diff --git a/packages/SystemUI/src/com/android/systemui/controls/management/ControlsFavoritingActivity.kt b/packages/SystemUI/src/com/android/systemui/controls/management/ControlsFavoritingActivity.kt index d3aa449b9cad3..d3ffc95853355 100644 --- a/packages/SystemUI/src/com/android/systemui/controls/management/ControlsFavoritingActivity.kt +++ b/packages/SystemUI/src/com/android/systemui/controls/management/ControlsFavoritingActivity.kt @@ -268,7 +268,7 @@ open class ControlsFavoritingActivity @Inject constructor( private fun bindViews() { setContentView(R.layout.controls_management) - lifecycle.addObserver( + getLifecycle().addObserver( ControlsAnimations.observerForAnimations( requireViewById(R.id.controls_management_root), window, diff --git a/packages/SystemUI/src/com/android/systemui/controls/management/ControlsProviderSelectorActivity.kt b/packages/SystemUI/src/com/android/systemui/controls/management/ControlsProviderSelectorActivity.kt index 782913ef07c8f..e60063248fb0d 100644 --- a/packages/SystemUI/src/com/android/systemui/controls/management/ControlsProviderSelectorActivity.kt +++ b/packages/SystemUI/src/com/android/systemui/controls/management/ControlsProviderSelectorActivity.kt @@ -91,7 +91,7 @@ open class ControlsProviderSelectorActivity @Inject constructor( setContentView(R.layout.controls_management) - lifecycle.addObserver( + getLifecycle().addObserver( ControlsAnimations.observerForAnimations( requireViewById(R.id.controls_management_root), window, 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 bb10a966a03ef..c964b9654955f 100644 --- a/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsActivity.kt +++ b/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsActivity.kt @@ -71,7 +71,7 @@ open class ControlsActivity @Inject constructor( setContentView(R.layout.controls_fullscreen) - lifecycle.addObserver( + getLifecycle().addObserver( ControlsAnimations.observerForAnimations( requireViewById(R.id.control_detail_root), window, diff --git a/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayLifecycleOwner.kt b/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayLifecycleOwner.kt index 003d2c73fa061..83253563e9699 100644 --- a/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayLifecycleOwner.kt +++ b/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayLifecycleOwner.kt @@ -28,8 +28,7 @@ import javax.inject.Inject class DreamOverlayLifecycleOwner @Inject constructor() : LifecycleOwner { val registry: LifecycleRegistry = LifecycleRegistry(this) - override val lifecycle: Lifecycle - get() { - return registry - } + override fun getLifecycle(): Lifecycle { + return registry + } } diff --git a/packages/SystemUI/src/com/android/systemui/lifecycle/RepeatWhenAttached.kt b/packages/SystemUI/src/com/android/systemui/lifecycle/RepeatWhenAttached.kt index e06483990c90b..34a67403fc845 100644 --- a/packages/SystemUI/src/com/android/systemui/lifecycle/RepeatWhenAttached.kt +++ b/packages/SystemUI/src/com/android/systemui/lifecycle/RepeatWhenAttached.kt @@ -167,10 +167,9 @@ class ViewLifecycleOwner( registry.currentState = Lifecycle.State.DESTROYED } - override val lifecycle: Lifecycle - get() { - return registry - } + override fun getLifecycle(): Lifecycle { + return registry + } private fun updateState() { registry.currentState =