Loading packages/SystemUI/src/com/android/systemui/dagger/GlobalModule.java +2 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import com.android.systemui.plugins.PluginsModule; import com.android.systemui.unfold.UnfoldTransitionModule; import com.android.systemui.util.concurrency.GlobalConcurrencyModule; import com.android.systemui.util.kotlin.GlobalCoroutinesModule; import com.android.systemui.util.time.dagger.TimeModule; import dagger.Module; import dagger.Provides; Loading @@ -52,6 +53,7 @@ import dagger.Provides; GlobalCoroutinesModule.class, UnfoldTransitionModule.class, PluginsModule.class, TimeModule.class, }) public class GlobalModule { /** Loading packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java +0 −6 Original line number Diff line number Diff line Loading @@ -176,8 +176,6 @@ import com.android.systemui.util.reference.ReferenceModule; import com.android.systemui.util.sensors.SensorModule; import com.android.systemui.util.settings.SettingsProxy; import com.android.systemui.util.settings.SettingsUtilModule; import com.android.systemui.util.time.SystemClock; import com.android.systemui.util.time.SystemClockImpl; import com.android.systemui.wallet.dagger.WalletModule; import com.android.systemui.wmshell.BubblesManager; import com.android.wm.shell.bubbles.Bubbles; Loading Loading @@ -409,10 +407,6 @@ public abstract class SystemUIModule { abstract Optional<DeviceStateRotationLockSettingController> optionalDeviceStateRotationLockSettingController(); @SysUISingleton @Binds abstract SystemClock bindSystemClock(SystemClockImpl systemClock); // TODO: This should provided by the WM component /** Provides Optional of BubbleManager */ Loading packages/SystemUI/src/com/android/systemui/unfold/UnfoldTransitionModule.kt +9 −9 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ import com.android.systemui.unfold.util.NaturalRotationUnfoldProgressProvider import com.android.systemui.unfold.util.ScopedUnfoldTransitionProgressProvider import com.android.systemui.unfold.util.UnfoldOnlyProgressProvider import com.android.systemui.unfold.util.UnfoldTransitionATracePrefix import com.android.systemui.util.time.SystemClockImpl import com.android.systemui.util.time.SystemClock import com.android.wm.shell.unfold.ShellUnfoldProgressProvider import dagger.Binds import dagger.Lazy Loading @@ -60,7 +60,7 @@ import javax.inject.Singleton [ UnfoldSharedModule::class, SystemUnfoldSharedModule::class, UnfoldTransitionModule.Bindings::class UnfoldTransitionModule.Bindings::class, ] ) class UnfoldTransitionModule { Loading @@ -78,7 +78,7 @@ class UnfoldTransitionModule { fun providesFoldStateListener( deviceStateManager: DeviceStateManager, @Application context: Context, @Main executor: Executor @Main executor: Executor, ): DeviceStateManager.FoldStateListener { val listener = DeviceStateManager.FoldStateListener(context) deviceStateManager.registerCallback(executor, listener) Loading @@ -90,10 +90,11 @@ class UnfoldTransitionModule { @Singleton fun providesFoldStateLoggingProvider( config: UnfoldTransitionConfig, foldStateProvider: Lazy<FoldStateProvider> foldStateProvider: Lazy<FoldStateProvider>, systemClock: SystemClock, ): Optional<FoldStateLoggingProvider> = if (config.isHingeAngleEnabled) { Optional.of(FoldStateLoggingProviderImpl(foldStateProvider.get(), SystemClockImpl())) Optional.of(FoldStateLoggingProviderImpl(foldStateProvider.get(), systemClock)) } else { Optional.empty() } Loading @@ -112,7 +113,7 @@ class UnfoldTransitionModule { fun provideNaturalRotationProgressProvider( context: Context, @UnfoldMain rotationChangeProvider: RotationChangeProvider, unfoldTransitionProgressProvider: Optional<UnfoldTransitionProgressProvider> unfoldTransitionProgressProvider: Optional<UnfoldTransitionProgressProvider>, ): Optional<NaturalRotationUnfoldProgressProvider> = unfoldTransitionProgressProvider.map { provider -> NaturalRotationUnfoldProgressProvider(context, rotationChangeProvider, provider) Loading Loading @@ -145,7 +146,7 @@ class UnfoldTransitionModule { foldProvider: FoldProvider, provider: Provider<Optional<UnfoldTransitionProgressProvider>>, @Named(UNFOLD_ONLY_PROVIDER) unfoldOnlyProvider: Provider<Optional<UnfoldTransitionProgressProvider>> unfoldOnlyProvider: Provider<Optional<UnfoldTransitionProgressProvider>>, ): ShellUnfoldProgressProvider { val resultingProvider = if (config.isEnabled) { Loading @@ -162,8 +163,7 @@ class UnfoldTransitionModule { return resultingProvider?.get()?.orElse(null)?.let { unfoldProgressProvider -> UnfoldProgressProvider(unfoldProgressProvider, foldProvider) } ?: ShellUnfoldProgressProvider.NO_PROVIDER } ?: ShellUnfoldProgressProvider.NO_PROVIDER } @Provides Loading packages/SystemUI/src/com/android/systemui/util/time/dagger/TimeModule.kt 0 → 100644 +28 −0 Original line number Diff line number Diff line /* * Copyright (C) 2025 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.util.time.dagger import com.android.systemui.util.time.SystemClock import com.android.systemui.util.time.SystemClockImpl import dagger.Binds import dagger.Module import javax.inject.Singleton @Module public abstract class TimeModule { @Singleton @Binds public abstract fun bindSystemClock(impl: SystemClockImpl): SystemClock } Loading
packages/SystemUI/src/com/android/systemui/dagger/GlobalModule.java +2 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import com.android.systemui.plugins.PluginsModule; import com.android.systemui.unfold.UnfoldTransitionModule; import com.android.systemui.util.concurrency.GlobalConcurrencyModule; import com.android.systemui.util.kotlin.GlobalCoroutinesModule; import com.android.systemui.util.time.dagger.TimeModule; import dagger.Module; import dagger.Provides; Loading @@ -52,6 +53,7 @@ import dagger.Provides; GlobalCoroutinesModule.class, UnfoldTransitionModule.class, PluginsModule.class, TimeModule.class, }) public class GlobalModule { /** Loading
packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java +0 −6 Original line number Diff line number Diff line Loading @@ -176,8 +176,6 @@ import com.android.systemui.util.reference.ReferenceModule; import com.android.systemui.util.sensors.SensorModule; import com.android.systemui.util.settings.SettingsProxy; import com.android.systemui.util.settings.SettingsUtilModule; import com.android.systemui.util.time.SystemClock; import com.android.systemui.util.time.SystemClockImpl; import com.android.systemui.wallet.dagger.WalletModule; import com.android.systemui.wmshell.BubblesManager; import com.android.wm.shell.bubbles.Bubbles; Loading Loading @@ -409,10 +407,6 @@ public abstract class SystemUIModule { abstract Optional<DeviceStateRotationLockSettingController> optionalDeviceStateRotationLockSettingController(); @SysUISingleton @Binds abstract SystemClock bindSystemClock(SystemClockImpl systemClock); // TODO: This should provided by the WM component /** Provides Optional of BubbleManager */ Loading
packages/SystemUI/src/com/android/systemui/unfold/UnfoldTransitionModule.kt +9 −9 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ import com.android.systemui.unfold.util.NaturalRotationUnfoldProgressProvider import com.android.systemui.unfold.util.ScopedUnfoldTransitionProgressProvider import com.android.systemui.unfold.util.UnfoldOnlyProgressProvider import com.android.systemui.unfold.util.UnfoldTransitionATracePrefix import com.android.systemui.util.time.SystemClockImpl import com.android.systemui.util.time.SystemClock import com.android.wm.shell.unfold.ShellUnfoldProgressProvider import dagger.Binds import dagger.Lazy Loading @@ -60,7 +60,7 @@ import javax.inject.Singleton [ UnfoldSharedModule::class, SystemUnfoldSharedModule::class, UnfoldTransitionModule.Bindings::class UnfoldTransitionModule.Bindings::class, ] ) class UnfoldTransitionModule { Loading @@ -78,7 +78,7 @@ class UnfoldTransitionModule { fun providesFoldStateListener( deviceStateManager: DeviceStateManager, @Application context: Context, @Main executor: Executor @Main executor: Executor, ): DeviceStateManager.FoldStateListener { val listener = DeviceStateManager.FoldStateListener(context) deviceStateManager.registerCallback(executor, listener) Loading @@ -90,10 +90,11 @@ class UnfoldTransitionModule { @Singleton fun providesFoldStateLoggingProvider( config: UnfoldTransitionConfig, foldStateProvider: Lazy<FoldStateProvider> foldStateProvider: Lazy<FoldStateProvider>, systemClock: SystemClock, ): Optional<FoldStateLoggingProvider> = if (config.isHingeAngleEnabled) { Optional.of(FoldStateLoggingProviderImpl(foldStateProvider.get(), SystemClockImpl())) Optional.of(FoldStateLoggingProviderImpl(foldStateProvider.get(), systemClock)) } else { Optional.empty() } Loading @@ -112,7 +113,7 @@ class UnfoldTransitionModule { fun provideNaturalRotationProgressProvider( context: Context, @UnfoldMain rotationChangeProvider: RotationChangeProvider, unfoldTransitionProgressProvider: Optional<UnfoldTransitionProgressProvider> unfoldTransitionProgressProvider: Optional<UnfoldTransitionProgressProvider>, ): Optional<NaturalRotationUnfoldProgressProvider> = unfoldTransitionProgressProvider.map { provider -> NaturalRotationUnfoldProgressProvider(context, rotationChangeProvider, provider) Loading Loading @@ -145,7 +146,7 @@ class UnfoldTransitionModule { foldProvider: FoldProvider, provider: Provider<Optional<UnfoldTransitionProgressProvider>>, @Named(UNFOLD_ONLY_PROVIDER) unfoldOnlyProvider: Provider<Optional<UnfoldTransitionProgressProvider>> unfoldOnlyProvider: Provider<Optional<UnfoldTransitionProgressProvider>>, ): ShellUnfoldProgressProvider { val resultingProvider = if (config.isEnabled) { Loading @@ -162,8 +163,7 @@ class UnfoldTransitionModule { return resultingProvider?.get()?.orElse(null)?.let { unfoldProgressProvider -> UnfoldProgressProvider(unfoldProgressProvider, foldProvider) } ?: ShellUnfoldProgressProvider.NO_PROVIDER } ?: ShellUnfoldProgressProvider.NO_PROVIDER } @Provides Loading
packages/SystemUI/src/com/android/systemui/util/time/dagger/TimeModule.kt 0 → 100644 +28 −0 Original line number Diff line number Diff line /* * Copyright (C) 2025 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.util.time.dagger import com.android.systemui.util.time.SystemClock import com.android.systemui.util.time.SystemClockImpl import dagger.Binds import dagger.Module import javax.inject.Singleton @Module public abstract class TimeModule { @Singleton @Binds public abstract fun bindSystemClock(impl: SystemClockImpl): SystemClock }