Override getAccounts to return an empty AccountSet in MockAccountManager. This used to throw an NPE instead since IAccountManagerService is set to NULL.

This commit is contained in:
Cynthia Wong
2009-09-03 10:06:55 -07:00
parent ea6fca8231
commit 904de61465

View File

@@ -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() {