Make ApiWrapper to be injected by dagger (12/n)
Bug: 361850561 Test: Manual Flag: EXEMPT Dagger Integration Change-Id: I53ec78999085b3e0ad6df69e177806e0cb1b52d1
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
package com.android.launcher3.util;
|
||||
|
||||
import static com.android.launcher3.LauncherConstants.ActivityCodes.REQUEST_HOME_ROLE;
|
||||
import static com.android.launcher3.util.MainThreadInitializedObject.forOverride;
|
||||
|
||||
import android.app.ActivityOptions;
|
||||
import android.app.Person;
|
||||
@@ -38,24 +37,30 @@ import androidx.annotation.Nullable;
|
||||
|
||||
import com.android.launcher3.BuildConfig;
|
||||
import com.android.launcher3.Launcher;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.dagger.ApplicationContext;
|
||||
import com.android.launcher3.dagger.LauncherAppComponent;
|
||||
import com.android.launcher3.dagger.LauncherAppSingleton;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* A wrapper for the hidden API calls
|
||||
*/
|
||||
public class ApiWrapper implements ResourceBasedOverride, SafeCloseable {
|
||||
@LauncherAppSingleton
|
||||
public class ApiWrapper {
|
||||
|
||||
public static final MainThreadInitializedObject<ApiWrapper> INSTANCE =
|
||||
forOverride(ApiWrapper.class, R.string.api_wrapper_class);
|
||||
public static final DaggerSingletonObject<ApiWrapper> INSTANCE = new DaggerSingletonObject<>(
|
||||
LauncherAppComponent::getApiWrapper);
|
||||
|
||||
protected final Context mContext;
|
||||
|
||||
public ApiWrapper(Context context) {
|
||||
@Inject
|
||||
public ApiWrapper(@ApplicationContext Context context) {
|
||||
mContext = context;
|
||||
}
|
||||
|
||||
@@ -166,9 +171,6 @@ public class ApiWrapper implements ResourceBasedOverride, SafeCloseable {
|
||||
return appInfo.sourceDir;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() { }
|
||||
|
||||
private static class NoopDrawable extends ColorDrawable {
|
||||
@Override
|
||||
public int getIntrinsicHeight() {
|
||||
|
||||
Reference in New Issue
Block a user