Make Log.isLogagble @FastNative

This CL doens't change println_native() because:
- To avoid potential risks (jank?) because it's kind of late in the RVC
cycle.
- The JNI overhead is unlikely to be a major problem in logging. If apps
are making *that* many log calls, that itself would be a bigger
problem.

Test: treehugger / boot
Bug: 152217649
Change-Id: I86aeb62b217e5331e6bbd02a0ba592fd050a41b2
This commit is contained in:
Makoto Onuki
2020-03-23 10:05:48 -07:00
parent 123991d017
commit 8e81742dc0

View File

@@ -27,6 +27,8 @@ import com.android.internal.os.RuntimeInit;
import com.android.internal.util.FastPrintWriter;
import com.android.internal.util.LineBreakBufferedWriter;
import dalvik.annotation.optimization.FastNative;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.io.Writer;
@@ -228,6 +230,7 @@ public final class Log {
* for Nougat (7.0) releases (API <= 23) and prior, there is no
* tag limit of concern after this API level.
*/
@FastNative
public static native boolean isLoggable(@Nullable String tag, @Level int level);
/**