Merge "Move OpenCloseListener and TrackingStartedListener out of ShadeViewController" into main
diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
index cdb520f..ee561c4 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
@@ -1540,13 +1540,13 @@
mKeyguardBottomArea = keyguardBottomArea;
}
- @Override
+ /** Sets a listener to be notified when the shade starts opening or finishes closing. */
public void setOpenCloseListener(OpenCloseListener openCloseListener) {
SceneContainerFlag.assertInLegacyMode();
mOpenCloseListener = openCloseListener;
}
- @Override
+ /** Sets a listener to be notified when touch tracking begins. */
public void setTrackingStartedListener(TrackingStartedListener trackingStartedListener) {
mTrackingStartedListener = trackingStartedListener;
}
diff --git a/packages/SystemUI/src/com/android/systemui/shade/OpenCloseListener.kt b/packages/SystemUI/src/com/android/systemui/shade/OpenCloseListener.kt
new file mode 100644
index 0000000..108dd478
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/shade/OpenCloseListener.kt
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.shade
+
+/** Listens for when shade begins opening or finishes closing. */
+interface OpenCloseListener {
+ /** Called when the shade finishes closing. */
+ fun onClosingFinished()
+
+ /** Called when the shade starts opening. */
+ fun onOpenStarted()
+}
diff --git a/packages/SystemUI/src/com/android/systemui/shade/ShadeViewController.kt b/packages/SystemUI/src/com/android/systemui/shade/ShadeViewController.kt
index 07236d1..b595f86 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/ShadeViewController.kt
+++ b/packages/SystemUI/src/com/android/systemui/shade/ShadeViewController.kt
@@ -52,15 +52,9 @@
/** Returns whether the shade's top level view is enabled. */
val isViewEnabled: Boolean
- /** Sets a listener to be notified when the shade starts opening or finishes closing. */
- fun setOpenCloseListener(openCloseListener: OpenCloseListener)
-
/** Returns whether status bar icons should be hidden when the shade is expanded. */
fun shouldHideStatusBarIconsWhenExpanded(): Boolean
- /** Sets a listener to be notified when touch tracking begins. */
- fun setTrackingStartedListener(trackingStartedListener: TrackingStartedListener)
-
/**
* Disables the shade header.
*
@@ -250,17 +244,3 @@
/** Return the fraction of the shade that's expanded, when in lockscreen. */
val lockscreenShadeDragProgress: Float
}
-
-/** Listens for when touch tracking begins. */
-interface TrackingStartedListener {
- fun onTrackingStarted()
-}
-
-/** Listens for when shade begins opening or finishes closing. */
-interface OpenCloseListener {
- /** Called when the shade finishes closing. */
- fun onClosingFinished()
-
- /** Called when the shade starts opening. */
- fun onOpenStarted()
-}
diff --git a/packages/SystemUI/src/com/android/systemui/shade/ShadeViewControllerEmptyImpl.kt b/packages/SystemUI/src/com/android/systemui/shade/ShadeViewControllerEmptyImpl.kt
index 6e03686..23680bb 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/ShadeViewControllerEmptyImpl.kt
+++ b/packages/SystemUI/src/com/android/systemui/shade/ShadeViewControllerEmptyImpl.kt
@@ -43,10 +43,8 @@
override val isFullyCollapsed: Boolean = false
override val isTracking: Boolean = false
override val isViewEnabled: Boolean = false
- override fun setOpenCloseListener(openCloseListener: OpenCloseListener) {}
override fun shouldHideStatusBarIconsWhenExpanded() = false
override fun blockExpansionForCurrentTouch() {}
- override fun setTrackingStartedListener(trackingStartedListener: TrackingStartedListener) {}
override fun disableHeader(state1: Int, state2: Int, animated: Boolean) {}
override fun startExpandLatencyTracking() {}
override fun startBouncerPreHideAnimation() {}
diff --git a/packages/SystemUI/src/com/android/systemui/shade/TrackingStartedListener.kt b/packages/SystemUI/src/com/android/systemui/shade/TrackingStartedListener.kt
new file mode 100644
index 0000000..3803c27
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/shade/TrackingStartedListener.kt
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.shade
+
+/** Listens for when touch tracking begins. */
+interface TrackingStartedListener {
+ fun onTrackingStarted()
+}