Loading services/core/java/com/android/server/graphics/fonts/FontManagerService.java +6 −0 Original line number Diff line number Diff line Loading @@ -227,6 +227,12 @@ public final class FontManagerService extends IFontManager.Stub { mContext = context; mIsSafeMode = safeMode; initialize(); try { Typeface.setSystemFontMap(getCurrentFontMap()); } catch (IOException | ErrnoException e) { Slog.w(TAG, "Failed to set system font map of system_server"); } } @Nullable Loading services/core/java/com/android/server/policy/ModifierShortcutManager.java +12 −28 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ import android.content.ActivityNotFoundException; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.pm.ActivityInfo; import android.content.pm.PackageManager; import android.content.res.XmlResourceParser; import android.os.RemoteException; Loading Loading @@ -59,8 +58,8 @@ class ModifierShortcutManager { private static final String ATTRIBUTE_CATEGORY = "category"; private static final String ATTRIBUTE_SHIFT = "shift"; private final SparseArray<ShortcutInfo> mIntentShortcuts = new SparseArray<>(); private final SparseArray<ShortcutInfo> mShiftShortcuts = new SparseArray<>(); private final SparseArray<Intent> mIntentShortcuts = new SparseArray<>(); private final SparseArray<Intent> mShiftShortcuts = new SparseArray<>(); private LongSparseArray<IShortcutService> mShortcutKeyServices = new LongSparseArray<>(); Loading Loading @@ -118,26 +117,26 @@ class ModifierShortcutManager { return null; } ShortcutInfo shortcut = null; Intent shortcutIntent = null; // If the Shift key is pressed, then search for the shift shortcuts. SparseArray<ShortcutInfo> shortcutMap = isShiftOn ? mShiftShortcuts : mIntentShortcuts; SparseArray<Intent> shortcutMap = isShiftOn ? mShiftShortcuts : mIntentShortcuts; // First try the exact keycode (with modifiers). int shortcutChar = kcm.get(keyCode, metaState); if (shortcutChar != 0) { shortcut = shortcutMap.get(shortcutChar); shortcutIntent = shortcutMap.get(shortcutChar); } // Next try the primary character on that key. if (shortcut == null) { if (shortcutIntent == null) { shortcutChar = Character.toLowerCase(kcm.getDisplayLabel(keyCode)); if (shortcutChar != 0) { shortcut = shortcutMap.get(shortcutChar); shortcutIntent = shortcutMap.get(shortcutChar); } } return (shortcut != null) ? shortcut.intent : null; return shortcutIntent; } private void loadShortcuts() { Loading Loading @@ -173,12 +172,10 @@ class ModifierShortcutManager { final boolean isShiftShortcut = (shiftName != null && shiftName.equals("true")); final Intent intent; final String title; if (packageName != null && className != null) { ActivityInfo info = null; ComponentName componentName = new ComponentName(packageName, className); try { info = packageManager.getActivityInfo(componentName, packageManager.getActivityInfo(componentName, PackageManager.MATCH_DIRECT_BOOT_AWARE | PackageManager.MATCH_DIRECT_BOOT_UNAWARE | PackageManager.MATCH_UNINSTALLED_PACKAGES); Loading @@ -187,7 +184,7 @@ class ModifierShortcutManager { new String[] { packageName }); componentName = new ComponentName(packages[0], className); try { info = packageManager.getActivityInfo(componentName, packageManager.getActivityInfo(componentName, PackageManager.MATCH_DIRECT_BOOT_AWARE | PackageManager.MATCH_DIRECT_BOOT_UNAWARE | PackageManager.MATCH_UNINSTALLED_PACKAGES); Loading @@ -201,21 +198,18 @@ class ModifierShortcutManager { intent = new Intent(Intent.ACTION_MAIN); intent.addCategory(Intent.CATEGORY_LAUNCHER); intent.setComponent(componentName); title = info.loadLabel(packageManager).toString(); } else if (categoryName != null) { intent = Intent.makeMainSelectorActivity(Intent.ACTION_MAIN, categoryName); title = ""; } else { Log.w(TAG, "Unable to add bookmark for shortcut " + shortcutName + ": missing package/class or category attributes"); continue; } ShortcutInfo shortcut = new ShortcutInfo(title, intent); if (isShiftShortcut) { mShiftShortcuts.put(shortcutChar, shortcut); mShiftShortcuts.put(shortcutChar, intent); } else { mIntentShortcuts.put(shortcutChar, shortcut); mIntentShortcuts.put(shortcutChar, intent); } } } catch (XmlPullParserException | IOException e) { Loading Loading @@ -370,14 +364,4 @@ class ModifierShortcutManager { return false; } private static final class ShortcutInfo { public final String title; public final Intent intent; ShortcutInfo(String title, Intent intent) { this.title = title; this.intent = intent; } } } services/java/com/android/server/SystemServer.java +0 −8 Original line number Diff line number Diff line Loading @@ -51,7 +51,6 @@ import android.credentials.CredentialManager; import android.database.sqlite.SQLiteCompatibilityWalFlags; import android.database.sqlite.SQLiteGlobal; import android.graphics.GraphicsStatsService; import android.graphics.Typeface; import android.hardware.display.DisplayManagerInternal; import android.net.ConnectivityManager; import android.net.ConnectivityModuleConnector; Loading Loading @@ -910,13 +909,6 @@ public final class SystemServer implements Dumpable { SystemServerInitThreadPool tp = SystemServerInitThreadPool.start(); mDumper.addDumpable(tp); // Load preinstalled system fonts for system server, so that WindowManagerService, etc // can start using Typeface. Note that fonts are required not only for text rendering, // but also for some text operations (e.g. TextUtils.makeSafeForPresentation()). if (Typeface.ENABLE_LAZY_TYPEFACE_INITIALIZATION) { Typeface.loadPreinstalledSystemFontMap(); } // Attach JVMTI agent if this is a debuggable build and the system property is set. if (Build.IS_DEBUGGABLE) { // Property is of the form "library_path=parameters". Loading Loading
services/core/java/com/android/server/graphics/fonts/FontManagerService.java +6 −0 Original line number Diff line number Diff line Loading @@ -227,6 +227,12 @@ public final class FontManagerService extends IFontManager.Stub { mContext = context; mIsSafeMode = safeMode; initialize(); try { Typeface.setSystemFontMap(getCurrentFontMap()); } catch (IOException | ErrnoException e) { Slog.w(TAG, "Failed to set system font map of system_server"); } } @Nullable Loading
services/core/java/com/android/server/policy/ModifierShortcutManager.java +12 −28 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ import android.content.ActivityNotFoundException; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.pm.ActivityInfo; import android.content.pm.PackageManager; import android.content.res.XmlResourceParser; import android.os.RemoteException; Loading Loading @@ -59,8 +58,8 @@ class ModifierShortcutManager { private static final String ATTRIBUTE_CATEGORY = "category"; private static final String ATTRIBUTE_SHIFT = "shift"; private final SparseArray<ShortcutInfo> mIntentShortcuts = new SparseArray<>(); private final SparseArray<ShortcutInfo> mShiftShortcuts = new SparseArray<>(); private final SparseArray<Intent> mIntentShortcuts = new SparseArray<>(); private final SparseArray<Intent> mShiftShortcuts = new SparseArray<>(); private LongSparseArray<IShortcutService> mShortcutKeyServices = new LongSparseArray<>(); Loading Loading @@ -118,26 +117,26 @@ class ModifierShortcutManager { return null; } ShortcutInfo shortcut = null; Intent shortcutIntent = null; // If the Shift key is pressed, then search for the shift shortcuts. SparseArray<ShortcutInfo> shortcutMap = isShiftOn ? mShiftShortcuts : mIntentShortcuts; SparseArray<Intent> shortcutMap = isShiftOn ? mShiftShortcuts : mIntentShortcuts; // First try the exact keycode (with modifiers). int shortcutChar = kcm.get(keyCode, metaState); if (shortcutChar != 0) { shortcut = shortcutMap.get(shortcutChar); shortcutIntent = shortcutMap.get(shortcutChar); } // Next try the primary character on that key. if (shortcut == null) { if (shortcutIntent == null) { shortcutChar = Character.toLowerCase(kcm.getDisplayLabel(keyCode)); if (shortcutChar != 0) { shortcut = shortcutMap.get(shortcutChar); shortcutIntent = shortcutMap.get(shortcutChar); } } return (shortcut != null) ? shortcut.intent : null; return shortcutIntent; } private void loadShortcuts() { Loading Loading @@ -173,12 +172,10 @@ class ModifierShortcutManager { final boolean isShiftShortcut = (shiftName != null && shiftName.equals("true")); final Intent intent; final String title; if (packageName != null && className != null) { ActivityInfo info = null; ComponentName componentName = new ComponentName(packageName, className); try { info = packageManager.getActivityInfo(componentName, packageManager.getActivityInfo(componentName, PackageManager.MATCH_DIRECT_BOOT_AWARE | PackageManager.MATCH_DIRECT_BOOT_UNAWARE | PackageManager.MATCH_UNINSTALLED_PACKAGES); Loading @@ -187,7 +184,7 @@ class ModifierShortcutManager { new String[] { packageName }); componentName = new ComponentName(packages[0], className); try { info = packageManager.getActivityInfo(componentName, packageManager.getActivityInfo(componentName, PackageManager.MATCH_DIRECT_BOOT_AWARE | PackageManager.MATCH_DIRECT_BOOT_UNAWARE | PackageManager.MATCH_UNINSTALLED_PACKAGES); Loading @@ -201,21 +198,18 @@ class ModifierShortcutManager { intent = new Intent(Intent.ACTION_MAIN); intent.addCategory(Intent.CATEGORY_LAUNCHER); intent.setComponent(componentName); title = info.loadLabel(packageManager).toString(); } else if (categoryName != null) { intent = Intent.makeMainSelectorActivity(Intent.ACTION_MAIN, categoryName); title = ""; } else { Log.w(TAG, "Unable to add bookmark for shortcut " + shortcutName + ": missing package/class or category attributes"); continue; } ShortcutInfo shortcut = new ShortcutInfo(title, intent); if (isShiftShortcut) { mShiftShortcuts.put(shortcutChar, shortcut); mShiftShortcuts.put(shortcutChar, intent); } else { mIntentShortcuts.put(shortcutChar, shortcut); mIntentShortcuts.put(shortcutChar, intent); } } } catch (XmlPullParserException | IOException e) { Loading Loading @@ -370,14 +364,4 @@ class ModifierShortcutManager { return false; } private static final class ShortcutInfo { public final String title; public final Intent intent; ShortcutInfo(String title, Intent intent) { this.title = title; this.intent = intent; } } }
services/java/com/android/server/SystemServer.java +0 −8 Original line number Diff line number Diff line Loading @@ -51,7 +51,6 @@ import android.credentials.CredentialManager; import android.database.sqlite.SQLiteCompatibilityWalFlags; import android.database.sqlite.SQLiteGlobal; import android.graphics.GraphicsStatsService; import android.graphics.Typeface; import android.hardware.display.DisplayManagerInternal; import android.net.ConnectivityManager; import android.net.ConnectivityModuleConnector; Loading Loading @@ -910,13 +909,6 @@ public final class SystemServer implements Dumpable { SystemServerInitThreadPool tp = SystemServerInitThreadPool.start(); mDumper.addDumpable(tp); // Load preinstalled system fonts for system server, so that WindowManagerService, etc // can start using Typeface. Note that fonts are required not only for text rendering, // but also for some text operations (e.g. TextUtils.makeSafeForPresentation()). if (Typeface.ENABLE_LAZY_TYPEFACE_INITIALIZATION) { Typeface.loadPreinstalledSystemFontMap(); } // Attach JVMTI agent if this is a debuggable build and the system property is set. if (Build.IS_DEBUGGABLE) { // Property is of the form "library_path=parameters". Loading