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

Commit 8c67385a authored by Yi Kong's avatar Yi Kong Committed by Automerger Merge Worker
Browse files

Merge "profcollect: collect intilization code behavior for camera open events"...

Merge "profcollect: collect intilization code behavior for camera open events" into main am: 3b42eb54

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/3160031



Change-Id: I6ea24e6a3683627aeb5a1c4f7f7912d19640eb56
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 6a844014 3b42eb54
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -398,14 +398,17 @@ public final class ProfcollectForwardingService extends SystemService {
                if (randomNum >= traceFrequency) {
                    return;
                }
                // Wait for 1s before starting tracing.
                // For a small percentage a traces, we collect the initialization behavior.
                boolean traceInitialization = ThreadLocalRandom.current().nextInt(10) < 1;
                int traceDelay = traceInitialization ? 0 : 1000;
                String traceTag = traceInitialization ? "camera_init" : "camera";
                BackgroundThread.get().getThreadHandler().postDelayed(() -> {
                    try {
                        mIProfcollect.trace_once("camera");
                        mIProfcollect.trace_once(traceTag);
                    } catch (RemoteException e) {
                        Log.e(LOG_TAG, "Failed to initiate trace: " + e.getMessage());
                    }
                }, 1000);
                }, traceDelay);
            }
        }, null);
    }