summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/binary
diff options
context:
space:
mode:
authorzachh <zachh@google.com>2017-10-24 17:10:06 -0700
committerEric Erfanian <erfanian@google.com>2017-10-25 16:59:31 +0000
commit6a4cebdb4ccc974d04f125847c03fddec18b2b9f (patch)
treea1baaedfe7538758e2622ee2746a6487428db1e1 /java/com/android/dialer/binary
parent35ec9146f0f44898f2249be3e505ff7bef171e11 (diff)
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
Diffstat (limited to 'java/com/android/dialer/binary')
-rw-r--r--java/com/android/dialer/binary/aosp/testing/AndroidManifest.xml24
-rw-r--r--java/com/android/dialer/binary/common/DialerApplication.java4
2 files changed, 2 insertions, 26 deletions
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 @@
-<!--
- ~ Copyright (C) 2017 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License
- -->
-
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.android.dialer.binary.aosp.testing">
-
- <application>
- <activity android:name="com.android.dialer.binary.aosp.testing.TestActivity"/>
- </application>
-
-</manifest>
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);