From 6a4cebdb4ccc974d04f125847c03fddec18b2b9f Mon Sep 17 00:00:00 2001 From: zachh Date: Tue, 24 Oct 2017 17:10:06 -0700 Subject: Improved dagger support for executor services. By always creating executor services via dagger, we can now bind special versions during espresso tests that can implement idling resources. We should be using idling resources during espresso tests for threads that we create ourselves, because espresso does not know about them. Hopefully this reduces some of the flakiness of espresso tests that we have today. This required converting all existing calls to DialerExecutors to pass a context used to fetch the component, and also required creating new application classes for espresso tests. Test: temporarily added a task which just slept to DialtactsActivity and verified that its integration test failed due to idling resource timeout PiperOrigin-RevId: 173334773 Change-Id: I876a93022d235d62cfc377bf5b06687e21a34758 --- java/com/android/dialer/callcomposer/camera/CameraManager.java | 1 + 1 file changed, 1 insertion(+) (limited to 'java/com/android/dialer/callcomposer/camera') 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( -- cgit v1.2.3