summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Anvesh Renikindi <renikindi@google.com> 2023-05-11 17:20:42 +0000
committer Anvesh Renikindi <renikindi@google.com> 2023-06-23 16:18:17 +0000
commit08e2fd0c4a0b04e01100377dca340dfc49ae1e4a (patch)
treecf563b9592490bbebeb0b5bf58725cda042e6426
parentacac3be162efd2e56862b3d8fc3753eea4d04cc6 (diff)
Revert^2 "Lifecycle has to use kotlin syntax"
b7adc6843c2f236b237bf2314b9f6094e3c086b0 Change-Id: I170a7b21ca63c8e655bfb1735e33c9b163ff3d72 (cherry picked from commit 204693859147e3c2e4b552569e57bf3e6588f426)
-rw-r--r--packages/SystemUI/src/com/android/systemui/controls/management/ControlsEditingActivity.kt2
-rw-r--r--packages/SystemUI/src/com/android/systemui/controls/management/ControlsFavoritingActivity.kt2
-rw-r--r--packages/SystemUI/src/com/android/systemui/controls/management/ControlsProviderSelectorActivity.kt2
-rw-r--r--packages/SystemUI/src/com/android/systemui/controls/ui/ControlsActivity.kt2
-rw-r--r--packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayLifecycleOwner.kt7
-rw-r--r--packages/SystemUI/src/com/android/systemui/lifecycle/RepeatWhenAttached.kt7
6 files changed, 12 insertions, 10 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 d629e3ea365e..8e41974b9acc 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)
- getLifecycle().addObserver(
+ lifecycle.addObserver(
ControlsAnimations.observerForAnimations(
requireViewById<ViewGroup>(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 d3ffc9585335..d3aa449b9cad 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)
- getLifecycle().addObserver(
+ lifecycle.addObserver(
ControlsAnimations.observerForAnimations(
requireViewById<ViewGroup>(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 fb19ac99d19e..d5b8693af42d 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)
- getLifecycle().addObserver(
+ lifecycle.addObserver(
ControlsAnimations.observerForAnimations(
requireViewById<ViewGroup>(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 4a22e4eecc2b..557dcf4accc7 100644
--- a/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsActivity.kt
+++ b/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsActivity.kt
@@ -72,7 +72,7 @@ open class ControlsActivity @Inject constructor(
setContentView(R.layout.controls_fullscreen)
- getLifecycle().addObserver(
+ lifecycle.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 83253563e969..003d2c73fa06 100644
--- a/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayLifecycleOwner.kt
+++ b/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayLifecycleOwner.kt
@@ -28,7 +28,8 @@ import javax.inject.Inject
class DreamOverlayLifecycleOwner @Inject constructor() : LifecycleOwner {
val registry: LifecycleRegistry = LifecycleRegistry(this)
- override fun getLifecycle(): Lifecycle {
- return registry
- }
+ override val lifecycle: Lifecycle
+ get() {
+ 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 34a67403fc84..e06483990c90 100644
--- a/packages/SystemUI/src/com/android/systemui/lifecycle/RepeatWhenAttached.kt
+++ b/packages/SystemUI/src/com/android/systemui/lifecycle/RepeatWhenAttached.kt
@@ -167,9 +167,10 @@ class ViewLifecycleOwner(
registry.currentState = Lifecycle.State.DESTROYED
}
- override fun getLifecycle(): Lifecycle {
- return registry
- }
+ override val lifecycle: Lifecycle
+ get() {
+ return registry
+ }
private fun updateState() {
registry.currentState =