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

Commit 19fd95bb authored by Xin Guan's avatar Xin Guan
Browse files

UsageStats: Use dedicated thread to monitor the state of packages.

Bug: 345133288
Bug: 302675504
Test: build/trace
Change-Id: I021a913e6b94b0b246bf37bd31a86b2721d828fd
parent 973e9d64
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -403,7 +403,9 @@ public class UsageStatsService extends SystemService implements

        mAppStandby.addListener(mStandbyChangeListener);

        mPackageMonitor.register(getContext(), null, UserHandle.ALL, true);
        mPackageMonitor.register(getContext(),
                /* thread= */ USE_DEDICATED_HANDLER_THREAD ? mHandler.getLooper() : null,
                UserHandle.ALL, true);

        IntentFilter filter = new IntentFilter(Intent.ACTION_USER_REMOVED);
        filter.addAction(Intent.ACTION_USER_STARTED);