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 --- .../dialer/binary/aosp/testing/AndroidManifest.xml | 24 ---------------------- .../dialer/binary/common/DialerApplication.java | 4 ++-- 2 files changed, 2 insertions(+), 26 deletions(-) delete mode 100644 java/com/android/dialer/binary/aosp/testing/AndroidManifest.xml (limited to 'java/com/android/dialer/binary') diff --git a/java/com/android/dialer/binary/aosp/testing/AndroidManifest.xml b/java/com/android/dialer/binary/aosp/testing/AndroidManifest.xml deleted file mode 100644 index 15870cb85..000000000 --- a/java/com/android/dialer/binary/aosp/testing/AndroidManifest.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - diff --git a/java/com/android/dialer/binary/common/DialerApplication.java b/java/com/android/dialer/binary/common/DialerApplication.java index 19af57579..c0e6ae660 100644 --- a/java/com/android/dialer/binary/common/DialerApplication.java +++ b/java/com/android/dialer/binary/common/DialerApplication.java @@ -23,7 +23,7 @@ import android.support.v4.os.BuildCompat; import com.android.dialer.blocking.BlockedNumbersAutoMigrator; import com.android.dialer.blocking.FilteredNumberAsyncQueryHandler; import com.android.dialer.calllog.CallLogComponent; -import com.android.dialer.common.concurrent.DefaultDialerExecutorFactory; +import com.android.dialer.common.concurrent.DialerExecutorComponent; import com.android.dialer.inject.HasRootComponent; import com.android.dialer.notification.NotificationChannelManager; import com.android.dialer.persistentlog.PersistentLogger; @@ -43,7 +43,7 @@ public abstract class DialerApplication extends Application implements HasRootCo new BlockedNumbersAutoMigrator( this.getApplicationContext(), new FilteredNumberAsyncQueryHandler(this), - new DefaultDialerExecutorFactory()) + DialerExecutorComponent.get(this).dialerExecutorFactory()) .asyncAutoMigrate(); CallLogComponent.get(this).callLogFramework().registerContentObservers(getApplicationContext()); PersistentLogger.initialize(this); -- cgit v1.2.3