summaryrefslogtreecommitdiffstats
path: root/test-runner/android/test/SyncBaseInstrumentation.java
diff options
context:
space:
mode:
Diffstat (limited to 'test-runner/android/test/SyncBaseInstrumentation.java')
-rw-r--r--test-runner/android/test/SyncBaseInstrumentation.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/test-runner/android/test/SyncBaseInstrumentation.java b/test-runner/android/test/SyncBaseInstrumentation.java
index 772d75c..bf9e783 100644
--- a/test-runner/android/test/SyncBaseInstrumentation.java
+++ b/test-runner/android/test/SyncBaseInstrumentation.java
@@ -22,6 +22,7 @@ import android.os.Bundle;
import android.os.RemoteException;
import android.os.SystemClock;
import android.net.Uri;
+import android.accounts.Account;
/**
* If you would like to test sync a single provider with an
@@ -47,7 +48,8 @@ public class SyncBaseInstrumentation extends InstrumentationTestCase {
protected void syncProvider(Uri uri, String account, String authority) throws Exception {
Bundle extras = new Bundle();
extras.putBoolean(ContentResolver.SYNC_EXTRAS_FORCE, true);
- extras.putString(ContentResolver.SYNC_EXTRAS_ACCOUNT, account);
+ Account account1 = new Account(account, "com.google.GAIA");
+ extras.putParcelable(ContentResolver.SYNC_EXTRAS_ACCOUNT, account1);
mContentResolver.startSync(uri, extras);
long startTimeInMillis = SystemClock.elapsedRealtime();
@@ -64,7 +66,7 @@ public class SyncBaseInstrumentation extends InstrumentationTestCase {
break;
}
- if (isSyncActive(account, authority)) {
+ if (isSyncActive(account1, authority)) {
counter = 0;
continue;
}
@@ -85,7 +87,7 @@ public class SyncBaseInstrumentation extends InstrumentationTestCase {
* entry is in either the Pending or Active tables.
* @return
*/
- private boolean isSyncActive(String account, String authority) {
+ private boolean isSyncActive(Account account, String authority) {
try {
return ContentResolver.getContentService().isSyncActive(account,
authority);