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

Commit da9d0e66 authored by Yi Kong's avatar Yi Kong
Browse files

profcollect: check hardware capability on a background thread

This is a blocking event, needs to be moved off from the main thread.

Also, don't schedule background processing service if the hardware
has no tracing support.

Test: manual
Bug: 79161490
Bug: 206986559
Change-Id: I039211b26f25ead66cf125f152e794b0c08057ee
parent 9b6a363c
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -91,11 +91,13 @@ public final class ProfcollectForwardingService extends SystemService {
            if (mIProfcollect == null) {
                return;
            }
            BackgroundThread.get().getThreadHandler().post(() -> {
                if (serviceHasSupportedTraceProvider()) {
                    registerObservers();
            }
                    ProfcollectBGJobService.schedule(getContext());
                }
            });
        }
    }

    private boolean serviceHasSupportedTraceProvider() {