commit | da9d0e669b90e5d5f0ef9be2effb4856386c99fb | [log] [tgz] |
---|---|---|
author | Yi Kong <yikong@google.com> | Fri Nov 19 16:23:37 2021 +0800 |
committer | Yi Kong <yikong@google.com> | Fri Nov 19 09:40:12 2021 +0000 |
tree | 0315f89053f4c89a84809cc48fb65eb9bb202db9 | |
parent | 9b6a363c8ca6d721b078df8fa2cb139df0c85ac6 [diff] |
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
diff --git a/services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java b/services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java index fb7ef84..62a16f7 100644 --- a/services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java +++ b/services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java
@@ -91,10 +91,12 @@ if (mIProfcollect == null) { return; } - if (serviceHasSupportedTraceProvider()) { - registerObservers(); - } - ProfcollectBGJobService.schedule(getContext()); + BackgroundThread.get().getThreadHandler().post(() -> { + if (serviceHasSupportedTraceProvider()) { + registerObservers(); + ProfcollectBGJobService.schedule(getContext()); + } + }); } }