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

Commit f24a737c authored by Aseem Kumar's avatar Aseem Kumar Committed by Android (Google) Code Review
Browse files

Merge "Improve logs in AccountManager[Service] for better debugging."

parents 6937d5dc 4da70e56
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -2384,12 +2384,8 @@ public class AccountManager {
                } else {
                    return get(timeout, unit);
                }
            } catch (CancellationException e) {
                throw new OperationCanceledException();
            } catch (TimeoutException e) {
                // fall through and cancel
            } catch (InterruptedException e) {
                // fall through and cancel
            } catch (CancellationException | TimeoutException | InterruptedException e) {
                throw new OperationCanceledException(e);
            } catch (ExecutionException e) {
                final Throwable cause = e.getCause();
                if (cause instanceof IOException) {
@@ -2408,7 +2404,6 @@ public class AccountManager {
            } finally {
                cancel(true /* interrupt if running */);
            }
            throw new OperationCanceledException();
        }

        @Override
+8 −8
Original line number Diff line number Diff line
@@ -2311,6 +2311,7 @@ public class AccountManagerService
                response.onError(AccountManager.ERROR_CODE_MANAGEMENT_DISABLED_FOR_ACCOUNT_TYPE,
                        "User cannot modify accounts of this type (policy).");
            } catch (RemoteException re) {
                Log.w(TAG, "RemoteException while removing account", re);
            }
            return;
        }
@@ -5053,7 +5054,7 @@ public class AccountManagerService
                Log.v(TAG, "initiating bind to authenticator type " + mAccountType);
            }
            if (!bindToAuthenticator(mAccountType)) {
                Log.d(TAG, "bind attempt failed for " + toDebugString());
                Log.w(TAG, "bind attempt failed for " + toDebugString());
                onError(AccountManager.ERROR_CODE_REMOTE_EXCEPTION, "bind failure");
            }
        }
@@ -5248,10 +5249,9 @@ public class AccountManagerService
            authenticatorInfo = mAuthenticatorCache.getServiceInfo(
                    AuthenticatorDescription.newKey(authenticatorType), mAccounts.userId);
            if (authenticatorInfo == null) {
                if (Log.isLoggable(TAG, Log.VERBOSE)) {
                    Log.v(TAG, "there is no authenticator for " + authenticatorType
                Log.w(TAG, "there is no authenticator for " + authenticatorType
                        + ", bailing out");
                }

                return false;
            }

@@ -5273,9 +5273,9 @@ public class AccountManagerService
                flags |= Context.BIND_ALLOW_INSTANT;
            }
            if (!mContext.bindServiceAsUser(intent, this, flags, UserHandle.of(mAccounts.userId))) {
                if (Log.isLoggable(TAG, Log.VERBOSE)) {
                    Log.v(TAG, "bindService to " + authenticatorInfo.componentName + " failed");
                }
                Log.w(TAG, "bindService to " + authenticatorInfo.componentName + " failed");
                // Perform unbind as per documentation at Context.bindServiceAsUser
                mContext.unbindService(this);
                return false;
            }