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

Commit 1bc9c3a2 authored by Yi Kong's avatar Yi Kong
Browse files

profcollect: fix camera event delay logic

Follow up to https://r.android.com/3186246, we should *not* delay trace capture, instead of always adding the delay.

Change-Id: I93d917963a1c73e4a28e945488b9b5cb1b16925b
Test: presubmit
Bug: 319394981
parent cd170297
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -398,17 +398,16 @@ public final class ProfcollectForwardingService extends SystemService {
                if (randomNum >= traceFrequency) {
                    return;
                }
                final int traceDelay = 1000;
                final int traceDuration = 5000;
                final String traceTag = "camera";
                BackgroundThread.get().getThreadHandler().postDelayed(() -> {
                BackgroundThread.get().getThreadHandler().post(() -> {
                    try {
                        mIProfcollect.trace_process(traceTag, "android.hardware.camera.provider",
                                traceDuration);
                    } catch (RemoteException e) {
                        Log.e(LOG_TAG, "Failed to initiate trace: " + e.getMessage());
                    }
                }, traceDelay);
                });
            }
        }, null);
    }