Add Context.bindService with executor parameter
Allow app to control the thread where ServiceConnection methods are
called on.
Bug: 111434506
Test: Used new bindContext method in chrome and checked callbacks
are on the correct thread.
Change-Id: I480e5bd6773a530fb9e8e73e3a2a2a88b76569ec
diff --git a/test-runner/src/android/test/IsolatedContext.java b/test-runner/src/android/test/IsolatedContext.java
index 73db451..dd4a9a3 100644
--- a/test-runner/src/android/test/IsolatedContext.java
+++ b/test-runner/src/android/test/IsolatedContext.java
@@ -17,13 +17,13 @@
package android.test;
import android.accounts.AccountManager;
-import android.content.ContextWrapper;
-import android.content.ContentResolver;
-import android.content.Intent;
-import android.content.Context;
-import android.content.ServiceConnection;
import android.content.BroadcastReceiver;
+import android.content.ContentResolver;
+import android.content.Context;
+import android.content.ContextWrapper;
+import android.content.Intent;
import android.content.IntentFilter;
+import android.content.ServiceConnection;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.test.mock.MockAccountManager;
@@ -31,6 +31,7 @@
import java.io.File;
import java.util.ArrayList;
import java.util.List;
+import java.util.concurrent.Executor;
/**
@@ -75,8 +76,14 @@
}
@Override
- public boolean bindIsolatedService(Intent service, ServiceConnection conn, int flags,
- String instanceName) {
+ public boolean bindService(Intent service, int flags, Executor executor,
+ ServiceConnection conn) {
+ return false;
+ }
+
+ @Override
+ public boolean bindIsolatedService(Intent service, int flags, String instanceName,
+ Executor executor, ServiceConnection conn) {
return false;
}