Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 29e94b81 authored by Fred Quintana's avatar Fred Quintana
Browse files

check if the binding to the authenticator has been disconnected

during the GetAccuintsByTypeAndFeature operation and abort
if it has been, thus avoiding an NPE

Change-Id: I7f707c7b0a1bdf80c0de9dfa7a3ae32323d623de
http://b/2497196
parent e8df25a9
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -1071,8 +1071,20 @@ public class AccountManagerService
                return;
            }

            final IAccountAuthenticator accountAuthenticator = mAuthenticator;
            if (accountAuthenticator == null) {
                // It is possible that the authenticator has died, which is indicated by
                // mAuthenticator being set to null. If this happens then just abort.
                // There is no need to send back a result or error in this case since
                // that already happened when mAuthenticator was cleared.
                if (Log.isLoggable(TAG, Log.VERBOSE)) {
                    Log.v(TAG, "checkAccount: aborting session since we are no longer"
                            + " connected to the authenticator, " + toDebugString());
                }
                return;
            }
            try {
                mAuthenticator.hasFeatures(this, mAccountsOfType[mCurrentAccount], mFeatures);
                accountAuthenticator.hasFeatures(this, mAccountsOfType[mCurrentAccount], mFeatures);
            } catch (RemoteException e) {
                onError(AccountManager.ERROR_CODE_REMOTE_EXCEPTION, "remote exception");
            }