diff options
| author | Costin Manolache <costin@google.com> | 2011-09-14 12:52:19 -0700 |
|---|---|---|
| committer | Costin Manolache <costin@google.com> | 2011-09-14 12:53:18 -0700 |
| commit | e5847ada7bdf99386dc13471a7d4f08bf779531b (patch) | |
| tree | 039e5f65b8423fff44e4c620fee3aaf82c48d7b4 /core/java/android/accounts | |
| parent | f9fa7543b12b4c54ee21f205b7d537494dbbbdf1 (diff) | |
| download | frameworks_base-e5847ada7bdf99386dc13471a7d4f08bf779531b.zip frameworks_base-e5847ada7bdf99386dc13471a7d4f08bf779531b.tar.gz frameworks_base-e5847ada7bdf99386dc13471a7d4f08bf779531b.tar.bz2 | |
b/5316640 fix bundle add
Change-Id: I567c26f6d8fc1a0ea5827fd32f9012b979cbea71
Diffstat (limited to 'core/java/android/accounts')
| -rw-r--r-- | core/java/android/accounts/AccountManager.java | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/core/java/android/accounts/AccountManager.java b/core/java/android/accounts/AccountManager.java index be9070d..dbf4de8 100644 --- a/core/java/android/accounts/AccountManager.java +++ b/core/java/android/accounts/AccountManager.java @@ -815,7 +815,10 @@ public class AccountManager { final Activity activity, AccountManagerCallback<Bundle> callback, Handler handler) { if (account == null) throw new IllegalArgumentException("account is null"); if (authTokenType == null) throw new IllegalArgumentException("authTokenType is null"); - final Bundle optionsIn = options == null ? new Bundle() : options; + final Bundle optionsIn = new Bundle(); + if (options != null) { + optionsIn.putAll(options); + } optionsIn.putString(KEY_ANDROID_PACKAGE_NAME, mContext.getPackageName()); return new AmsTask(activity, handler, callback) { public void doWork() throws RemoteException { @@ -982,7 +985,10 @@ public class AccountManager { if (account == null) throw new IllegalArgumentException("account is null"); if (authTokenType == null) throw new IllegalArgumentException("authTokenType is null"); - final Bundle optionsIn = options == null ? new Bundle() : options; + final Bundle optionsIn = new Bundle(); + if (options != null) { + optionsIn.putAll(options); + } optionsIn.putString(KEY_ANDROID_PACKAGE_NAME, mContext.getPackageName()); return new AmsTask(null, handler, callback) { public void doWork() throws RemoteException { @@ -1045,14 +1051,16 @@ public class AccountManager { final Bundle addAccountOptions, final Activity activity, AccountManagerCallback<Bundle> callback, Handler handler) { if (accountType == null) throw new IllegalArgumentException("accountType is null"); - final Bundle options = (addAccountOptions == null) ? new Bundle() : - addAccountOptions; - options.putString(KEY_ANDROID_PACKAGE_NAME, mContext.getPackageName()); + final Bundle optionsIn = new Bundle(); + if (addAccountOptions != null) { + optionsIn.putAll(addAccountOptions); + } + optionsIn.putString(KEY_ANDROID_PACKAGE_NAME, mContext.getPackageName()); return new AmsTask(activity, handler, callback) { public void doWork() throws RemoteException { mService.addAcount(mResponse, accountType, authTokenType, - requiredFeatures, activity != null, options); + requiredFeatures, activity != null, optionsIn); } }.start(); } |
