Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b41def03 authored by Anushree Ganjam's avatar Anushree Ganjam Committed by Android (Google) Code Review
Browse files

Merge "Add LauncherAppSingleton & LauncherActivityScope to dagger graph (3/n)" into main

parents ec5d7a09 fbc0f974
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -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
+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 {
}
+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);
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -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() {
+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