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

Commit 3723b074 authored by Dmitry Dementyev's avatar Dmitry Dementyev Committed by Automerger Merge Worker
Browse files

Merge "Close AccountManagerService.session after timeout." into rvc-dev am:...

Merge "Close AccountManagerService.session after timeout." into rvc-dev am: 6faf0345 am: d69e6bcc am: 26893bb9

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/25787790



Change-Id: Ie7453cc8ff46ffe19aecf78bf43f6727cdffb171
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 08fab797 26893bb9
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -183,6 +183,7 @@ public class AccountManagerService

    final MessageHandler mHandler;

    private static final int TIMEOUT_DELAY_MS = 1000 * 60 * 15;
    // Messages that can be sent on mHandler
    private static final int MESSAGE_TIMED_OUT = 3;
    private static final int MESSAGE_COPY_SHARED_ACCOUNT = 4;
@@ -4839,6 +4840,7 @@ public class AccountManagerService
            synchronized (mSessions) {
                mSessions.put(toString(), this);
            }
            scheduleTimeout();
            if (response != null) {
                try {
                    response.asBinder().linkToDeath(this, 0 /* flags */);
@@ -5005,6 +5007,11 @@ public class AccountManagerService
            }
        }

        private void scheduleTimeout() {
            mHandler.sendMessageDelayed(
                    mHandler.obtainMessage(MESSAGE_TIMED_OUT, this), TIMEOUT_DELAY_MS);
        }

        public void cancelTimeout() {
            mHandler.removeMessages(MESSAGE_TIMED_OUT, this);
        }
@@ -5041,6 +5048,9 @@ public class AccountManagerService

        public void onTimedOut() {
            IAccountManagerResponse response = getResponseAndClose();
            if (Log.isLoggable(TAG, Log.VERBOSE)) {
                Log.v(TAG, "Session.onTimedOut");
            }
            if (response != null) {
                try {
                    response.onError(AccountManager.ERROR_CODE_REMOTE_EXCEPTION,