Fixing LauncherAppCompoent not available for isolated context
In those cases, creating a new LauncherAppCompoent and storing it in the application context Bug: 372180905 Test: atest LauncherComponentProviderTest Flag: EXEMPT bugfix Change-Id: Ibf517a23801138b1fa18e8e4a7adbdedb994365b
This commit is contained in:
@@ -18,8 +18,8 @@ package com.android.launcher3.util;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.android.launcher3.LauncherApplication;
|
||||
import com.android.launcher3.dagger.LauncherAppComponent;
|
||||
import com.android.launcher3.dagger.LauncherComponentProvider;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
@@ -37,8 +37,6 @@ public class DaggerSingletonObject<T> {
|
||||
}
|
||||
|
||||
public T get(Context context) {
|
||||
LauncherAppComponent component =
|
||||
((LauncherApplication) context.getApplicationContext()).getAppComponent();
|
||||
return mFunction.apply(component);
|
||||
return mFunction.apply(LauncherComponentProvider.get(context));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user