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

Commit a6f8a96d authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Add JNI call for writing StatsEvent to statsd." am: 9e52462c am: a4bba9ad

Change-Id: I22294b7a9a0eb15b82b865d6ad271b59af9ef9ba
parents 93f094ba a4bba9ad
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -246,6 +246,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.");
    }