From b2f7ee84cfbd08d0ffd4c03f8403d647f46ca65b Mon Sep 17 00:00:00 2001 From: Hawkwood Glazier Date: Sat, 21 May 2022 00:54:52 +0000 Subject: [PATCH] Move ClockRegistry to SystemUISharedLib Bug: 229771520 Test: Automated Change-Id: I7e921038a803188eee4cc437b7076db97ecdd853 (cherry picked from commit 1323984dac09429d1d39150518065daf01c7d002) Merged-In: I7e921038a803188eee4cc437b7076db97ecdd853 --- .../systemui/shared/clocks}/ClockProviderPlugin.kt | 3 ++- .../android/systemui/shared/clocks}/ClockRegistry.kt | 10 +--------- .../shared/clocks}/ClockRegistryTest.kt | 7 +------ 3 files changed, 4 insertions(+), 16 deletions(-) rename packages/SystemUI/{plugin/src/com/android/systemui/plugins => shared/src/com/android/systemui/shared/clocks}/ClockProviderPlugin.kt (96%) rename packages/SystemUI/{src/com/android/keyguard/clock => shared/src/com/android/systemui/shared/clocks}/ClockRegistry.kt (89%) rename packages/SystemUI/tests/src/com/android/{keyguard/clock => systemui/shared/clocks}/ClockRegistryTest.kt (95%) diff --git a/packages/SystemUI/plugin/src/com/android/systemui/plugins/ClockProviderPlugin.kt b/packages/SystemUI/shared/src/com/android/systemui/shared/clocks/ClockProviderPlugin.kt similarity index 96% rename from packages/SystemUI/plugin/src/com/android/systemui/plugins/ClockProviderPlugin.kt rename to packages/SystemUI/shared/src/com/android/systemui/shared/clocks/ClockProviderPlugin.kt index 032f946faead2..916a557d7af82 100644 --- a/packages/SystemUI/plugin/src/com/android/systemui/plugins/ClockProviderPlugin.kt +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/clocks/ClockProviderPlugin.kt @@ -11,8 +11,9 @@ * KIND, either express or implied. See the License for the specific language governing * permissions and limitations under the License. */ -package com.android.systemui.plugins +package com.android.systemui.shared.clocks +import com.android.systemui.plugins.Plugin import com.android.systemui.plugins.annotations.ProvidesInterface import android.annotation.FloatRange import android.graphics.drawable.Drawable diff --git a/packages/SystemUI/src/com/android/keyguard/clock/ClockRegistry.kt b/packages/SystemUI/shared/src/com/android/systemui/shared/clocks/ClockRegistry.kt similarity index 89% rename from packages/SystemUI/src/com/android/keyguard/clock/ClockRegistry.kt rename to packages/SystemUI/shared/src/com/android/systemui/shared/clocks/ClockRegistry.kt index c168a466e20dc..209b5761b0049 100644 --- a/packages/SystemUI/src/com/android/keyguard/clock/ClockRegistry.kt +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/clocks/ClockRegistry.kt @@ -11,17 +11,11 @@ * KIND, either express or implied. See the License for the specific language governing * permissions and limitations under the License. */ -package com.android.keyguard.clock +package com.android.systemui.shared.clocks import android.content.Context import android.graphics.drawable.Drawable import android.util.Log -import com.android.systemui.dagger.SysUISingleton -import com.android.systemui.plugins.Clock -import com.android.systemui.plugins.ClockId -import com.android.systemui.plugins.ClockMetadata -import com.android.systemui.plugins.ClockProvider -import com.android.systemui.plugins.ClockProviderPlugin import com.android.systemui.plugins.PluginListener import com.android.systemui.shared.plugins.PluginManager import javax.inject.Inject @@ -32,8 +26,6 @@ private const val DEFAULT_CLOCK_ID = "DEFAULT" typealias ClockChangeListener = () -> Unit /** ClockRegistry aggregates providers and plugins */ -// TODO: Is this the right place for this? -@SysUISingleton class ClockRegistry @Inject constructor( val context: Context, val pluginManager: PluginManager diff --git a/packages/SystemUI/tests/src/com/android/keyguard/clock/ClockRegistryTest.kt b/packages/SystemUI/tests/src/com/android/systemui/shared/clocks/ClockRegistryTest.kt similarity index 95% rename from packages/SystemUI/tests/src/com/android/keyguard/clock/ClockRegistryTest.kt rename to packages/SystemUI/tests/src/com/android/systemui/shared/clocks/ClockRegistryTest.kt index dc28e4d67af12..5d3c57511631c 100644 --- a/packages/SystemUI/tests/src/com/android/keyguard/clock/ClockRegistryTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/shared/clocks/ClockRegistryTest.kt @@ -13,18 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License */ - -package com.android.keyguard.clock +package com.android.systemui.shared.clocks import android.content.Context import android.graphics.drawable.Drawable import android.testing.AndroidTestingRunner import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase -import com.android.systemui.plugins.Clock -import com.android.systemui.plugins.ClockId -import com.android.systemui.plugins.ClockMetadata -import com.android.systemui.plugins.ClockProviderPlugin import com.android.systemui.plugins.PluginListener import com.android.systemui.shared.plugins.PluginManager import com.android.systemui.util.mockito.argumentCaptor