Merge "Frameworks/base: Refactor TextView initialization" into nyc-dev

am: 4f655de3de

* commit '4f655de3de5819c1076b83747c135554dfd22708':
  Frameworks/base: Refactor TextView initialization
This commit is contained in:
Andreas Gampe
2016-03-01 19:47:19 +00:00
committed by android-build-merger
2 changed files with 5 additions and 2 deletions

View File

@@ -662,11 +662,12 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
*/
private int mDeviceProvisionedState = DEVICE_PROVISIONED_UNKNOWN;
/*
/**
* Kick-start the font cache for the zygote process (to pay the cost of
* initializing freetype for our default font only once).
* @hide
*/
static {
public static void preloadFontCache() {
Paint p = new Paint();
p.setAntiAlias(true);
// We don't care about the result, just the side-effect of measuring.

View File

@@ -36,6 +36,7 @@ import android.text.Hyphenator;
import android.util.EventLog;
import android.util.Log;
import android.webkit.WebViewFactory;
import android.widget.TextView;
import com.android.internal.os.InstallerConnection.InstallerException;
@@ -214,6 +215,7 @@ public class ZygoteInit {
private static void preloadTextResources() {
Hyphenator.init();
TextView.preloadFontCache();
}
/**