summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authord34d <clark@cyngn.com>2015-09-09 11:37:11 -0700
committerClark Scheff <clark@cyngn.com>2015-10-27 18:28:01 -0700
commitef7243e0694f6ec765931d5b0521acd1701d714f (patch)
tree1c0fba6cd1ec2e75c6c307a7a5884d9abdf2d73b /graphics
parent0deb5c80ed989741b08b00228d5967ecae4af93c (diff)
downloadframeworks_base-ef7243e0694f6ec765931d5b0521acd1701d714f.zip
frameworks_base-ef7243e0694f6ec765931d5b0521acd1701d714f.tar.gz
frameworks_base-ef7243e0694f6ec765931d5b0521acd1701d714f.tar.bz2
Themes: Don't use themed fonts for non themable packages
Change-Id: I8a86e13a7ebc8be59286700c26a55d9d6a013db9
Diffstat (limited to 'graphics')
-rw-r--r--graphics/java/android/graphics/Typeface.java15
1 files changed, 10 insertions, 5 deletions
diff --git a/graphics/java/android/graphics/Typeface.java b/graphics/java/android/graphics/Typeface.java
index a64c0af..4e9788a 100644
--- a/graphics/java/android/graphics/Typeface.java
+++ b/graphics/java/android/graphics/Typeface.java
@@ -350,7 +350,7 @@ public class Typeface {
*
* This should only be called once, from the static class initializer block.
*/
- private static void init() {
+ private static void init(boolean forceSystemFonts) {
// Load font config and initialize Minikin state
File systemFontConfigLocation = getSystemFontConfigLocation();
File themeFontConfigLocation = getThemeFontConfigLocation();
@@ -360,7 +360,7 @@ public class Typeface {
File configFile = null;
File fontDir;
- if (themeConfigFile.exists()) {
+ if (!forceSystemFonts && themeConfigFile.exists()) {
configFile = themeConfigFile;
fontDir = getThemeFontDirLocation();
} else {
@@ -437,15 +437,20 @@ public class Typeface {
}
}
+ /** @hide */
+ public static void recreateDefaults() {
+ recreateDefaults(false);
+ }
+
/**
* Clears caches in java and skia.
* Skia will then reparse font config
* @hide
*/
- public static void recreateDefaults() {
+ public static void recreateDefaults(boolean forceSystemFonts) {
sTypefaceCache.clear();
sSystemFontMap.clear();
- init();
+ init(forceSystemFonts);
DEFAULT_INTERNAL = create((String) null, 0);
DEFAULT_BOLD_INTERNAL = create((String) null, Typeface.BOLD);
@@ -463,7 +468,7 @@ public class Typeface {
}
static {
- init();
+ init(false);
// Set up defaults and typefaces exposed in public API
DEFAULT_INTERNAL = create((String) null, 0);
DEFAULT_BOLD_INTERNAL = create((String) null, Typeface.BOLD);