@@ -815,7 +815,10 @@ public AccountManagerFuture<Bundle> getAuthToken(
815815 final Activity activity , AccountManagerCallback <Bundle > callback , Handler handler ) {
816816 if (account == null ) throw new IllegalArgumentException ("account is null" );
817817 if (authTokenType == null ) throw new IllegalArgumentException ("authTokenType is null" );
818- final Bundle optionsIn = options == null ? new Bundle () : options ;
818+ final Bundle optionsIn = new Bundle ();
819+ if (options != null ) {
820+ optionsIn .putAll (options );
821+ }
819822 optionsIn .putString (KEY_ANDROID_PACKAGE_NAME , mContext .getPackageName ());
820823 return new AmsTask (activity , handler , callback ) {
821824 public void doWork () throws RemoteException {
@@ -982,7 +985,10 @@ public AccountManagerFuture<Bundle> getAuthToken(
982985
983986 if (account == null ) throw new IllegalArgumentException ("account is null" );
984987 if (authTokenType == null ) throw new IllegalArgumentException ("authTokenType is null" );
985- final Bundle optionsIn = options == null ? new Bundle () : options ;
988+ final Bundle optionsIn = new Bundle ();
989+ if (options != null ) {
990+ optionsIn .putAll (options );
991+ }
986992 optionsIn .putString (KEY_ANDROID_PACKAGE_NAME , mContext .getPackageName ());
987993 return new AmsTask (null , handler , callback ) {
988994 public void doWork () throws RemoteException {
@@ -1045,14 +1051,16 @@ public AccountManagerFuture<Bundle> addAccount(final String accountType,
10451051 final Bundle addAccountOptions ,
10461052 final Activity activity , AccountManagerCallback <Bundle > callback , Handler handler ) {
10471053 if (accountType == null ) throw new IllegalArgumentException ("accountType is null" );
1048- final Bundle options = (addAccountOptions == null ) ? new Bundle () :
1049- addAccountOptions ;
1050- options .putString (KEY_ANDROID_PACKAGE_NAME , mContext .getPackageName ());
1054+ final Bundle optionsIn = new Bundle ();
1055+ if (addAccountOptions != null ) {
1056+ optionsIn .putAll (addAccountOptions );
1057+ }
1058+ optionsIn .putString (KEY_ANDROID_PACKAGE_NAME , mContext .getPackageName ());
10511059
10521060 return new AmsTask (activity , handler , callback ) {
10531061 public void doWork () throws RemoteException {
10541062 mService .addAcount (mResponse , accountType , authTokenType ,
1055- requiredFeatures , activity != null , options );
1063+ requiredFeatures , activity != null , optionsIn );
10561064 }
10571065 }.start ();
10581066 }
0 commit comments