Merge "profcollect: trace on background thread"
This commit is contained in:
@@ -234,14 +234,16 @@ public final class ProfcollectForwardingService extends SystemService {
|
|||||||
"applaunch_trace_freq", 2);
|
"applaunch_trace_freq", 2);
|
||||||
int randomNum = ThreadLocalRandom.current().nextInt(100);
|
int randomNum = ThreadLocalRandom.current().nextInt(100);
|
||||||
if (randomNum < traceFrequency) {
|
if (randomNum < traceFrequency) {
|
||||||
try {
|
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
Log.d(LOG_TAG, "Tracing on app launch event: " + packageName);
|
Log.d(LOG_TAG, "Tracing on app launch event: " + packageName);
|
||||||
}
|
}
|
||||||
|
BackgroundThread.get().getThreadHandler().post(() -> {
|
||||||
|
try {
|
||||||
mIProfcollect.trace_once("applaunch");
|
mIProfcollect.trace_once("applaunch");
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
Log.e(LOG_TAG, e.getMessage());
|
Log.e(LOG_TAG, e.getMessage());
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user