OSDN Git Service

Frameworks: Move Log holder to be preloaded
authorAndreas Gampe <agampe@google.com>
Wed, 27 Sep 2017 18:57:27 +0000 (11:57 -0700)
committerAndreas Gampe <agampe@google.com>
Wed, 27 Sep 2017 22:34:01 +0000 (15:34 -0700)
To avoid issues with late initialization, let the holder be
initialized in the zygote.

Bug: 65927416
Test: m
Change-Id: I6f454df46d4c64d295e1f2510793d5087b74fb74

config/preloaded-classes
config/preloaded-classes-extra
core/java/android/util/Log.java

index ff61d18..479cda4 100644 (file)
@@ -2192,6 +2192,7 @@ android.util.IntProperty
 android.util.Log
 android.util.Log$1
 android.util.Log$ImmediateLogWriter
+android.util.Log$PreloadHolder
 android.util.Log$TerribleFailureHandler
 android.util.LogPrinter
 android.util.LongArray
index 959fff5..09f393a 100644 (file)
@@ -8,6 +8,7 @@ android.media.MediaPlayer
 android.media.SoundPool
 android.text.format.Formatter
 android.text.Html$HtmlParser
+android.util.Log$PreloadHolder
 com.android.org.conscrypt.TrustedCertificateStore
 org.ccil.cowan.tagsoup.HTMLScanner
 sun.security.jca.Providers
index 8691136..0299865 100644 (file)
@@ -392,7 +392,7 @@ public final class Log {
         // and the length of the tag.
         // Note: we implicitly accept possible truncation for Modified-UTF8 differences. It
         //       is too expensive to compute that ahead of time.
-        int bufferSize = NoPreloadHolder.LOGGER_ENTRY_MAX_PAYLOAD  // Base.
+        int bufferSize = PreloadHolder.LOGGER_ENTRY_MAX_PAYLOAD    // Base.
                 - 2                                                // Two terminators.
                 - (tag != null ? tag.length() : 0)                 // Tag length.
                 - 32;                                              // Some slack.
@@ -429,10 +429,10 @@ public final class Log {
     }
 
     /**
-     * NoPreloadHelper class. Caches the LOGGER_ENTRY_MAX_PAYLOAD value to avoid
+     * PreloadHelper class. Caches the LOGGER_ENTRY_MAX_PAYLOAD value to avoid
      * a JNI call during logging.
      */
-    static class NoPreloadHolder {
+    static class PreloadHolder {
         public final static int LOGGER_ENTRY_MAX_PAYLOAD =
                 logger_entry_max_payload_native();
     }