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

Commit ab815f9a authored by Shai Barack's avatar Shai Barack
Browse files

Annotate native methods that can be @FastNative as such

These methods don't make any high/variable latency operations,
so should be safe to annotate as such.

Bug: 374158990
Flag: EXEMPT annotation change can't be flagged
Test: presubmit
Change-Id: Icac1aea2f3db48ecce2a544c0772474481ef8e81
parent 9a1f0592
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@ package android.os;
import android.compat.annotation.UnsupportedAppUsage;
import android.system.ErrnoException;

import dalvik.annotation.optimization.FastNative;

import java.io.FileDescriptor;
import java.io.IOException;
import java.io.InputStream;
@@ -41,8 +43,10 @@ public class MemoryFile {
    private static String TAG = "MemoryFile";

    // Returns 'true' if purged, 'false' otherwise
    @FastNative
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
    private static native boolean native_pin(FileDescriptor fd, boolean pin) throws IOException;
    @FastNative
    @UnsupportedAppUsage
    private static native int native_get_size(FileDescriptor fd) throws IOException;