summaryrefslogtreecommitdiffstats
path: root/test-runner
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-04-24 12:23:57 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-04-24 12:23:57 -0700
commitd004ee1b0a1f869f5e48ffc29b8ce9c6a8c77e23 (patch)
treec2e3422bda20bae7c600b494631d54f1509382cd /test-runner
parentbc2e33b5c81b1d5ddc112ea004a0b7866bd00bec (diff)
parentd9d2f1140b52fd0c014e9deac59f6000564b7e84 (diff)
downloadframeworks_base-d004ee1b0a1f869f5e48ffc29b8ce9c6a8c77e23.zip
frameworks_base-d004ee1b0a1f869f5e48ffc29b8ce9c6a8c77e23.tar.gz
frameworks_base-d004ee1b0a1f869f5e48ffc29b8ce9c6a8c77e23.tar.bz2
Merge change 497
* changes: change the sync framework and users to understand Account
Diffstat (limited to 'test-runner')
-rw-r--r--test-runner/android/test/SyncBaseInstrumentation.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/test-runner/android/test/SyncBaseInstrumentation.java b/test-runner/android/test/SyncBaseInstrumentation.java
index c1d2507..0b4bfed 100644
--- a/test-runner/android/test/SyncBaseInstrumentation.java
+++ b/test-runner/android/test/SyncBaseInstrumentation.java
@@ -23,6 +23,8 @@ import android.os.Bundle;
import android.os.SystemClock;
import android.provider.Sync;
import android.net.Uri;
+import android.accounts.Account;
+
import java.util.Map;
/**
@@ -49,7 +51,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();
@@ -66,7 +69,7 @@ public class SyncBaseInstrumentation extends InstrumentationTestCase {
break;
}
- if (isSyncActive(account, authority)) {
+ if (isSyncActive(account1, authority)) {
counter = 0;
continue;
}
@@ -87,7 +90,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) {
Sync.Pending.QueryMap pendingQueryMap = null;
Sync.Active.QueryMap activeQueryMap = null;
try {
@@ -107,11 +110,12 @@ public class SyncBaseInstrumentation extends InstrumentationTestCase {
}
}
- private boolean isActiveInActiveQueryMap(Sync.Active.QueryMap activemap, String account,
+ private boolean isActiveInActiveQueryMap(Sync.Active.QueryMap activemap, Account account,
String authority) {
Map<String, ContentValues> rows = activemap.getRows();
for (ContentValues values : rows.values()) {
- if (values.getAsString("account").equals(account)
+ if (values.getAsString("account").equals(account.mName)
+ && values.getAsString("account_type").equals(account.mType)
&& values.getAsString("authority").equals(authority)) {
return true;
}