From: tiansiming Date: Fri, 13 Oct 2017 02:57:25 +0000 (+0800) Subject: Remove "result2" in AccountManagerService X-Git-Tag: android-x86-9.0-r1~348^2~1^2~3^2~6^2~7^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=5330b5a78c7380a1b7c7b717aed2d240cd97530e;p=android-x86%2Fframeworks-base.git Remove "result2" in AccountManagerService I think result2 here is to filter out other value returned from getAccountRemovalAllowed. As the annotation shown in getAccountRemovalAllowed in AbstractAccountAuthenticator, the result will only contain KEY_INTENT or KEY_BOOLEAN_RESULT or KEY_ERROR_CODE and KEY_ERROR_MESSAGE. KEY_INTENT has been judged at the beginning of onResult, KEY_ERROR_CODE and KEY_ERROR_MESSAGE seem extraneous when back to AccountManager, so i believe that it's ok to use result directly here other than get one more Bundle object. (tip: if result2 is nessesary, its name doesn't looks formal) Bug:N/A Test:N/A Change-Id: I4e352baa1e74ac680398c328db0c4bc873ba528b Signed-off-by: tiansiming --- diff --git a/services/core/java/com/android/server/accounts/AccountManagerService.java b/services/core/java/com/android/server/accounts/AccountManagerService.java index d6a010fc01b3..fd7acdf63389 100644 --- a/services/core/java/com/android/server/accounts/AccountManagerService.java +++ b/services/core/java/com/android/server/accounts/AccountManagerService.java @@ -2233,12 +2233,10 @@ public class AccountManagerService Log.v(TAG, getClass().getSimpleName() + " calling onResult() on response " + response); } - Bundle result2 = new Bundle(); - result2.putBoolean(AccountManager.KEY_BOOLEAN_RESULT, removalAllowed); try { - response.onResult(result2); + response.onResult(result); } catch (RemoteException e) { - // ignore + Slog.e(TAG, "Error calling onResult()", e); } } }