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

Commit 5ca7bae4 authored by Ruchir Rastogi's avatar Ruchir Rastogi
Browse files

Move pullers to binder thread

Pass in a direct executor to setPullAtomCallback. This will cause the
puller to execute directly on the binder thread, as opposed to the background
thread, which could be busy with other work.

The move to the binder thread means that pullers could execute
concurrently, but these pullers are already properly synchronized, so no
further work is needed.

Test: m
Bug: 157186182
Change-Id: I17d67af49b60c59c7de61aba2ce6716aade6e737
parent c5401ef0
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -246,6 +246,7 @@ import com.android.internal.os.SomeArgs;
import com.android.internal.statusbar.NotificationVisibility;
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.CollectionUtils;
import com.android.internal.util.ConcurrentUtils;
import com.android.internal.util.DumpUtils;
import com.android.internal.util.FastXmlSerializer;
import com.android.internal.util.Preconditions;
@@ -2172,19 +2173,19 @@ public class NotificationManagerService extends SystemService {
        mStatsManager.setPullAtomCallback(
                PACKAGE_NOTIFICATION_PREFERENCES,
                null, // use default PullAtomMetadata values
                BackgroundThread.getExecutor(),
                ConcurrentUtils.DIRECT_EXECUTOR,
                mPullAtomCallback
        );
        mStatsManager.setPullAtomCallback(
                PACKAGE_NOTIFICATION_CHANNEL_PREFERENCES,
                null, // use default PullAtomMetadata values
                BackgroundThread.getExecutor(),
                ConcurrentUtils.DIRECT_EXECUTOR,
                mPullAtomCallback
        );
        mStatsManager.setPullAtomCallback(
                PACKAGE_NOTIFICATION_CHANNEL_GROUP_PREFERENCES,
                null, // use default PullAtomMetadata values
                BackgroundThread.getExecutor(),
                ConcurrentUtils.DIRECT_EXECUTOR,
                mPullAtomCallback
        );
    }