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

Commit a61493fa authored by Utkarsh Nigam's avatar Utkarsh Nigam
Browse files

Check if the executor is shutdown before submitting more tasks.


Bug: 409170985
Flag: EXEMPT minor bugfix
Test: Existing CTS and Unit tests
Change-Id: I1b0690e5c1913976443af811b0b42ede63d94f1b
parent 4bf3ab68
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -137,9 +137,13 @@ public class MetadataSyncAdapter {
        synchronized (mLock) {
            if (mCurrentSyncTask != null && !mCurrentSyncTask.isDone()) {
                var unused = mCurrentSyncTask.cancel(false);
                mCurrentSyncTask = null;
            }

            if (!mExecutor.isShutdown()) {
                mCurrentSyncTask = mExecutor.submit(runnable);
            }
        }

        return settableSyncStatus;
    }