diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2017-10-25 18:34:28 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-10-25 18:34:28 +0000 |
commit | 37ed24aaa2477bf662a3aebdaa18388bc5a0264a (patch) | |
tree | a1baaedfe7538758e2622ee2746a6487428db1e1 /java/com/android/dialer/callcomposer | |
parent | 951b417e5793d816dac9cfe8c255059654de086a (diff) | |
parent | 6a4cebdb4ccc974d04f125847c03fddec18b2b9f (diff) |
Merge "Improved dagger support for executor services."
Diffstat (limited to 'java/com/android/dialer/callcomposer')
3 files changed, 5 insertions, 12 deletions
diff --git a/java/com/android/dialer/callcomposer/CallComposerActivity.java b/java/com/android/dialer/callcomposer/CallComposerActivity.java index 60826fd5d..bad5d7f54 100644 --- a/java/com/android/dialer/callcomposer/CallComposerActivity.java +++ b/java/com/android/dialer/callcomposer/CallComposerActivity.java @@ -224,6 +224,7 @@ public class CallComposerActivity extends AppCompatActivity copyAndResizeExecutor = DialerExecutors.createUiTaskBuilder( + getApplicationContext(), getFragmentManager(), "copyAndResizeImageToSend", new CopyAndResizeImageWorker(this.getApplicationContext())) diff --git a/java/com/android/dialer/callcomposer/GalleryComposerFragment.java b/java/com/android/dialer/callcomposer/GalleryComposerFragment.java index 2e6a28c33..e604ec1b0 100644 --- a/java/com/android/dialer/callcomposer/GalleryComposerFragment.java +++ b/java/com/android/dialer/callcomposer/GalleryComposerFragment.java @@ -28,7 +28,6 @@ import android.os.Parcelable; import android.provider.Settings; import android.support.annotation.NonNull; import android.support.annotation.Nullable; -import android.support.annotation.VisibleForTesting; import android.support.v4.app.LoaderManager.LoaderCallbacks; import android.support.v4.content.ContextCompat; import android.support.v4.content.CursorLoader; @@ -40,11 +39,9 @@ import android.view.ViewGroup; import android.widget.GridView; import android.widget.ImageView; import android.widget.TextView; -import com.android.dialer.common.Assert; import com.android.dialer.common.LogUtil; -import com.android.dialer.common.concurrent.DefaultDialerExecutorFactory; import com.android.dialer.common.concurrent.DialerExecutor; -import com.android.dialer.common.concurrent.DialerExecutorFactory; +import com.android.dialer.common.concurrent.DialerExecutorComponent; import com.android.dialer.logging.DialerImpression; import com.android.dialer.logging.Logger; import com.android.dialer.util.PermissionsUtil; @@ -62,8 +59,6 @@ public class GalleryComposerFragment extends CallComposerFragment private static final int RESULT_LOAD_IMAGE = 1; private static final int RESULT_OPEN_SETTINGS = 2; - private DialerExecutorFactory executorFactory = new DefaultDialerExecutorFactory(); - private GalleryGridAdapter adapter; private GridView galleryGridView; private View permissionView; @@ -81,11 +76,6 @@ public class GalleryComposerFragment extends CallComposerFragment return new GalleryComposerFragment(); } - @VisibleForTesting - void setExecutorFactory(@NonNull DialerExecutorFactory executorFactory) { - this.executorFactory = Assert.isNotNull(executorFactory); - } - @Nullable @Override public View onCreateView( @@ -123,7 +113,8 @@ public class GalleryComposerFragment extends CallComposerFragment super.onActivityCreated(bundle); copyAndResizeImage = - executorFactory + DialerExecutorComponent.get(getContext()) + .dialerExecutorFactory() .createUiTaskBuilder( getActivity().getFragmentManager(), "copyAndResizeImage", diff --git a/java/com/android/dialer/callcomposer/camera/CameraManager.java b/java/com/android/dialer/callcomposer/camera/CameraManager.java index f79f6548c..9a9577f6f 100644 --- a/java/com/android/dialer/callcomposer/camera/CameraManager.java +++ b/java/com/android/dialer/callcomposer/camera/CameraManager.java @@ -469,6 +469,7 @@ public class CameraManager implements FocusOverlayManager.Listener { LogUtil.i( "CameraManager.onPictureTaken", "taken picture size: " + bytes.length + " bytes"); DialerExecutors.createNonUiTaskBuilder( + mCameraPreview.getContext(), new ImagePersistWorker( width, height, heightPercent, bytes, mCameraPreview.getContext())) .onSuccess( |