Merge "Fix AddAccountSettings memory leak"

am: 104501fa29

Change-Id: I844d7ce66a162ba1e72a099d429e17de9c72fb86
This commit is contained in:
Fyodor Kupolov
2017-09-19 18:42:07 +00:00
committed by android-build-merger
2 changed files with 7 additions and 0 deletions

View File

@@ -175,6 +175,9 @@ public abstract class AbstractAccountAuthenticator {
}
if (result != null) {
response.onResult(result);
} else {
response.onError(AccountManager.ERROR_CODE_INVALID_RESPONSE,
"null bundle returned");
}
} catch (Exception e) {
handleException(response, "addAccount", accountType, e);

View File

@@ -2318,6 +2318,10 @@ public class AccountManager {
private class Response extends IAccountManagerResponse.Stub {
@Override
public void onResult(Bundle bundle) {
if (bundle == null) {
onError(ERROR_CODE_INVALID_RESPONSE, "null bundle returned");
return;
}
Intent intent = bundle.getParcelable(KEY_INTENT);
if (intent != null && mActivity != null) {
// since the user provided an Activity we will silently start intents