Loading quickstep/dagger/LauncherAppComponent.java +5 −4 Original line number Diff line number Diff line Loading @@ -16,15 +16,16 @@ package com.android.launcher3.dagger; import dagger.Component; import javax.inject.Singleton; import com.android.quickstep.dagger.QuickStepModule; import dagger.Component; /** * Root component for Dagger injection for Launcher Quickstep. */ @Singleton @Component @LauncherAppSingleton @Component(modules = QuickStepModule.class) public interface LauncherAppComponent extends LauncherBaseAppComponent { /** Builder for quickstep LauncherAppComponent. */ @Component.Builder Loading quickstep/src/com/android/quickstep/dagger/QuickStepModule.java 0 → 100644 +24 −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.quickstep.dagger; import com.android.quickstep.logging.LoggingModule; import dagger.Module; @Module(includes = {LoggingModule.class}) public class QuickStepModule { } quickstep/src/com/android/quickstep/logging/LoggingModule.java 0 → 100644 +34 −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.quickstep.logging; import android.content.Context; import com.android.launcher3.dagger.ApplicationContext; import com.android.launcher3.dagger.LauncherAppSingleton; import dagger.Module; import dagger.Provides; @Module public class LoggingModule { @Provides @LauncherAppSingleton SettingsChangeLogger provideSettingsChangeLogger(@ApplicationContext Context context) { return SettingsChangeLogger.INSTANCE.get(context); } } src/com/android/launcher3/LauncherApplication.java +1 −1 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ public class LauncherApplication extends Application { public void onCreate() { super.onCreate(); MainProcessInitializer.initialize(this); mAppComponent = DaggerLauncherAppComponent.builder().build(); mAppComponent = DaggerLauncherAppComponent.builder().appContext(this).build(); } public LauncherBaseAppComponent getAppComponent() { Loading src/com/android/launcher3/dagger/ActivityContextScope.java 0 → 100644 +32 −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.launcher3.dagger; import java.lang.annotation.Documented; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import javax.inject.Scope; /** * Scope annotation for singletons associated with Launcher activity context. */ @Documented @Retention(RetentionPolicy.RUNTIME) @Scope public @interface ActivityContextScope { } Loading
quickstep/dagger/LauncherAppComponent.java +5 −4 Original line number Diff line number Diff line Loading @@ -16,15 +16,16 @@ package com.android.launcher3.dagger; import dagger.Component; import javax.inject.Singleton; import com.android.quickstep.dagger.QuickStepModule; import dagger.Component; /** * Root component for Dagger injection for Launcher Quickstep. */ @Singleton @Component @LauncherAppSingleton @Component(modules = QuickStepModule.class) public interface LauncherAppComponent extends LauncherBaseAppComponent { /** Builder for quickstep LauncherAppComponent. */ @Component.Builder Loading
quickstep/src/com/android/quickstep/dagger/QuickStepModule.java 0 → 100644 +24 −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.quickstep.dagger; import com.android.quickstep.logging.LoggingModule; import dagger.Module; @Module(includes = {LoggingModule.class}) public class QuickStepModule { }
quickstep/src/com/android/quickstep/logging/LoggingModule.java 0 → 100644 +34 −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.quickstep.logging; import android.content.Context; import com.android.launcher3.dagger.ApplicationContext; import com.android.launcher3.dagger.LauncherAppSingleton; import dagger.Module; import dagger.Provides; @Module public class LoggingModule { @Provides @LauncherAppSingleton SettingsChangeLogger provideSettingsChangeLogger(@ApplicationContext Context context) { return SettingsChangeLogger.INSTANCE.get(context); } }
src/com/android/launcher3/LauncherApplication.java +1 −1 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ public class LauncherApplication extends Application { public void onCreate() { super.onCreate(); MainProcessInitializer.initialize(this); mAppComponent = DaggerLauncherAppComponent.builder().build(); mAppComponent = DaggerLauncherAppComponent.builder().appContext(this).build(); } public LauncherBaseAppComponent getAppComponent() { Loading
src/com/android/launcher3/dagger/ActivityContextScope.java 0 → 100644 +32 −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.launcher3.dagger; import java.lang.annotation.Documented; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import javax.inject.Scope; /** * Scope annotation for singletons associated with Launcher activity context. */ @Documented @Retention(RetentionPolicy.RUNTIME) @Scope public @interface ActivityContextScope { }