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

Commit 9e52462c authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Add JNI call for writing StatsEvent to statsd."

parents bbf2a838 80e3e7a4
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -244,6 +244,16 @@ public final class StatsLog extends StatsLogInternal {
     */
    private static native void writeImpl(@NonNull byte[] buffer, int size, int atomId);

    /**
     * Write an event to stats log using the raw format encapsulated in StatsEvent.
     *
     * @param statsEvent    The StatsEvent object containing the encoded buffer of data to write.
     * @hide
     */
    public static void write(@NonNull final StatsEvent statsEvent) {
        writeImpl(statsEvent.getBytes(), statsEvent.getNumBytes(), statsEvent.getAtomId());
    }

    private static void enforceDumpCallingPermission(Context context) {
        context.enforceCallingPermission(android.Manifest.permission.DUMP, "Need DUMP permission.");
    }