summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Cynthia Wong <cynthiaw@google.com> 2009-09-03 10:06:55 -0700
committer Cynthia Wong <cynthiaw@google.com> 2009-09-03 10:06:55 -0700
commit904de61465abff8dba6fcc768d6bf5586f86ed0f (patch)
treeea64e3f181c5c8f968c1fdbd3f1de5a7e0ff53fb
parentea6fca8231c94064917e40dea23be8df50930cf9 (diff)
Override getAccounts to return an empty AccountSet in MockAccountManager. This used to throw an NPE instead since IAccountManagerService is set to NULL.
-rw-r--r--test-runner/android/test/IsolatedContext.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/test-runner/android/test/IsolatedContext.java b/test-runner/android/test/IsolatedContext.java
index 4bd9528ade45..5c6616980c66 100644
--- a/test-runner/android/test/IsolatedContext.java
+++ b/test-runner/android/test/IsolatedContext.java
@@ -4,6 +4,7 @@ import com.google.android.collect.Lists;
import android.accounts.AccountManager;
import android.accounts.OnAccountsUpdatedListener;
+import android.accounts.Account;
import android.content.ContextWrapper;
import android.content.ContentResolver;
import android.content.Intent;
@@ -101,6 +102,10 @@ public class IsolatedContext extends ContextWrapper {
Handler handler, boolean updateImmediately) {
// do nothing
}
+
+ public Account[] getAccounts() {
+ return new Account[]{};
+ }
}
@Override
public File getFilesDir() {