Loading libs/WindowManager/Shell/src/com/android/wm/shell/dagger/HasWMComponent.kt 0 → 100644 +27 −0 Original line number Diff line number Diff line /* * 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.wm.shell.dagger /** * An interface implemented by the application that uses [WMComponent]. * * This exposes the component to allow classes to do member injection for bindings where constructor * injection is not possible, e.g. views. */ interface HasWMComponent { fun getWMComponent(): WMComponent } packages/SystemUI/src/com/android/systemui/dagger/WMComponent.java→libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMComponent.java +4 −8 Original line number Diff line number Diff line Loading @@ -14,17 +14,14 @@ * limitations under the License. */ package com.android.systemui.dagger; package com.android.wm.shell.dagger; import android.os.HandlerThread; import androidx.annotation.Nullable; import com.android.systemui.SystemUIInitializer; import com.android.wm.shell.back.BackAnimation; import com.android.wm.shell.bubbles.Bubbles; import com.android.wm.shell.dagger.WMShellModule; import com.android.wm.shell.dagger.WMSingleton; import com.android.wm.shell.desktopmode.DesktopMode; import com.android.wm.shell.displayareahelper.DisplayAreaHelper; import com.android.wm.shell.keyguard.KeyguardTransitions; Loading @@ -45,12 +42,11 @@ import java.util.Optional; /** * Dagger Subcomponent for WindowManager. This class explicitly describes the interfaces exported * from the WM component into the SysUI component (in * {@link SystemUIInitializer#init(boolean)}), and references the specific dependencies * from the WM component into the SysUI component, and references the specific dependencies * provided by its particular device/form-factor SystemUI implementation. * * ie. {@link WMComponent} includes {@link WMShellModule} * and {@code TvWMComponent} includes {@link com.android.wm.shell.dagger.TvWMShellModule} * <p> ie. {@link WMComponent} includes {@link WMShellModule} and {@code TvWMComponent} includes * {@link TvWMShellModule} */ @WMSingleton @Subcomponent(modules = {WMShellModule.class}) Loading packages/SystemUI/src/com/android/systemui/SystemUIApplication.java +9 −1 Original line number Diff line number Diff line Loading @@ -46,6 +46,8 @@ import com.android.systemui.process.ProcessWrapper; import com.android.systemui.res.R; import com.android.systemui.statusbar.phone.ConfigurationForwarder; import com.android.systemui.util.NotificationChannels; import com.android.wm.shell.dagger.HasWMComponent; import com.android.wm.shell.dagger.WMComponent; import java.lang.reflect.InvocationTargetException; import java.util.ArrayDeque; Loading @@ -62,7 +64,7 @@ import javax.inject.Provider; * Application class for SystemUI. */ public class SystemUIApplication extends Application implements SystemUIAppComponentFactoryBase.ContextInitializer { SystemUIAppComponentFactoryBase.ContextInitializer, HasWMComponent { public static final String TAG = "SystemUIService"; private static final boolean DEBUG = false; Loading Loading @@ -490,4 +492,10 @@ public class SystemUIApplication extends Application implements n.addExtras(extras); } @NonNull @Override public WMComponent getWMComponent() { return mInitializer.getWMComponent(); } } packages/SystemUI/src/com/android/systemui/SystemUIInitializer.java +1 −1 Original line number Diff line number Diff line Loading @@ -24,9 +24,9 @@ import android.util.Log; import com.android.systemui.dagger.GlobalRootComponent; import com.android.systemui.dagger.SysUIComponent; import com.android.systemui.dagger.WMComponent; import com.android.systemui.res.R; import com.android.systemui.util.InitializationChecker; import com.android.wm.shell.dagger.WMComponent; import com.android.wm.shell.dagger.WMShellConcurrencyModule; import com.android.wm.shell.keyguard.KeyguardTransitions; import com.android.wm.shell.shared.ShellTransitions; Loading packages/SystemUI/src/com/android/systemui/dagger/GlobalRootComponent.java +1 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.flags.SystemPropertiesHelper; import com.android.systemui.process.ProcessWrapper; import com.android.systemui.util.InitializationChecker; import com.android.wm.shell.dagger.WMComponent; import dagger.BindsInstance; Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/dagger/HasWMComponent.kt 0 → 100644 +27 −0 Original line number Diff line number Diff line /* * 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.wm.shell.dagger /** * An interface implemented by the application that uses [WMComponent]. * * This exposes the component to allow classes to do member injection for bindings where constructor * injection is not possible, e.g. views. */ interface HasWMComponent { fun getWMComponent(): WMComponent }
packages/SystemUI/src/com/android/systemui/dagger/WMComponent.java→libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMComponent.java +4 −8 Original line number Diff line number Diff line Loading @@ -14,17 +14,14 @@ * limitations under the License. */ package com.android.systemui.dagger; package com.android.wm.shell.dagger; import android.os.HandlerThread; import androidx.annotation.Nullable; import com.android.systemui.SystemUIInitializer; import com.android.wm.shell.back.BackAnimation; import com.android.wm.shell.bubbles.Bubbles; import com.android.wm.shell.dagger.WMShellModule; import com.android.wm.shell.dagger.WMSingleton; import com.android.wm.shell.desktopmode.DesktopMode; import com.android.wm.shell.displayareahelper.DisplayAreaHelper; import com.android.wm.shell.keyguard.KeyguardTransitions; Loading @@ -45,12 +42,11 @@ import java.util.Optional; /** * Dagger Subcomponent for WindowManager. This class explicitly describes the interfaces exported * from the WM component into the SysUI component (in * {@link SystemUIInitializer#init(boolean)}), and references the specific dependencies * from the WM component into the SysUI component, and references the specific dependencies * provided by its particular device/form-factor SystemUI implementation. * * ie. {@link WMComponent} includes {@link WMShellModule} * and {@code TvWMComponent} includes {@link com.android.wm.shell.dagger.TvWMShellModule} * <p> ie. {@link WMComponent} includes {@link WMShellModule} and {@code TvWMComponent} includes * {@link TvWMShellModule} */ @WMSingleton @Subcomponent(modules = {WMShellModule.class}) Loading
packages/SystemUI/src/com/android/systemui/SystemUIApplication.java +9 −1 Original line number Diff line number Diff line Loading @@ -46,6 +46,8 @@ import com.android.systemui.process.ProcessWrapper; import com.android.systemui.res.R; import com.android.systemui.statusbar.phone.ConfigurationForwarder; import com.android.systemui.util.NotificationChannels; import com.android.wm.shell.dagger.HasWMComponent; import com.android.wm.shell.dagger.WMComponent; import java.lang.reflect.InvocationTargetException; import java.util.ArrayDeque; Loading @@ -62,7 +64,7 @@ import javax.inject.Provider; * Application class for SystemUI. */ public class SystemUIApplication extends Application implements SystemUIAppComponentFactoryBase.ContextInitializer { SystemUIAppComponentFactoryBase.ContextInitializer, HasWMComponent { public static final String TAG = "SystemUIService"; private static final boolean DEBUG = false; Loading Loading @@ -490,4 +492,10 @@ public class SystemUIApplication extends Application implements n.addExtras(extras); } @NonNull @Override public WMComponent getWMComponent() { return mInitializer.getWMComponent(); } }
packages/SystemUI/src/com/android/systemui/SystemUIInitializer.java +1 −1 Original line number Diff line number Diff line Loading @@ -24,9 +24,9 @@ import android.util.Log; import com.android.systemui.dagger.GlobalRootComponent; import com.android.systemui.dagger.SysUIComponent; import com.android.systemui.dagger.WMComponent; import com.android.systemui.res.R; import com.android.systemui.util.InitializationChecker; import com.android.wm.shell.dagger.WMComponent; import com.android.wm.shell.dagger.WMShellConcurrencyModule; import com.android.wm.shell.keyguard.KeyguardTransitions; import com.android.wm.shell.shared.ShellTransitions; Loading
packages/SystemUI/src/com/android/systemui/dagger/GlobalRootComponent.java +1 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.flags.SystemPropertiesHelper; import com.android.systemui.process.ProcessWrapper; import com.android.systemui.util.InitializationChecker; import com.android.wm.shell.dagger.WMComponent; import dagger.BindsInstance; Loading