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

Commit d588b98d authored by Hai Zhang's avatar Hai Zhang Committed by Android (Google) Code Review
Browse files

Merge "Use IoThread instead of BackgroundThread for HistoricalRegistry." into main

parents cc057fbd a1b7d7af
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -54,13 +54,13 @@ import android.util.Xml;

import com.android.internal.annotations.GuardedBy;
import com.android.internal.os.AtomicDirectory;
import com.android.internal.os.BackgroundThread;
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.XmlUtils;
import com.android.internal.util.function.pooled.PooledLambda;
import com.android.modules.utils.TypedXmlPullParser;
import com.android.modules.utils.TypedXmlSerializer;
import com.android.server.FgThread;
import com.android.server.IoThread;

import org.xmlpull.v1.XmlPullParserException;

@@ -669,7 +669,7 @@ final class HistoricalRegistry {
    }

    private void clearHistoryOnDiskDLocked() {
        BackgroundThread.getHandler().removeMessages(MSG_WRITE_PENDING_HISTORY);
        IoThread.getHandler().removeMessages(MSG_WRITE_PENDING_HISTORY);
        synchronized (mInMemoryLock) {
            mCurrentHistoricalOps = null;
            mNextPersistDueTimeMillis = System.currentTimeMillis();
@@ -745,7 +745,7 @@ final class HistoricalRegistry {

    private void persistPendingHistory(@NonNull List<HistoricalOps> pendingWrites) {
        synchronized (mOnDiskLock) {
            BackgroundThread.getHandler().removeMessages(MSG_WRITE_PENDING_HISTORY);
            IoThread.getHandler().removeMessages(MSG_WRITE_PENDING_HISTORY);
            if (pendingWrites.isEmpty()) {
                return;
            }
@@ -767,7 +767,7 @@ final class HistoricalRegistry {
        final Message message = PooledLambda.obtainMessage(
                HistoricalRegistry::persistPendingHistory, HistoricalRegistry.this);
        message.what = MSG_WRITE_PENDING_HISTORY;
        BackgroundThread.getHandler().sendMessage(message);
        IoThread.getHandler().sendMessage(message);
        mPendingWrites.offerFirst(ops);
    }