diff --git a/services/core/java/com/android/server/SystemConfig.java b/services/core/java/com/android/server/SystemConfig.java index fdcb3b9029e53..cf2a49f922e2f 100644 --- a/services/core/java/com/android/server/SystemConfig.java +++ b/services/core/java/com/android/server/SystemConfig.java @@ -50,19 +50,16 @@ public class SystemConfig { // These are the built-in uid -> permission mappings that were read from the // system configuration files. - final SparseArray> mSystemPermissions = - new SparseArray>(); + final SparseArray> mSystemPermissions = new SparseArray<>(); // These are the built-in shared libraries that were read from the // system configuration files. Keys are the library names; strings are the // paths to the libraries. - final ArrayMap mSharedLibraries - = new ArrayMap(); + final ArrayMap mSharedLibraries = new ArrayMap<>(); // These are the features this devices supports that were read from the // system configuration files. - final HashMap mAvailableFeatures = - new HashMap(); + final HashMap mAvailableFeatures = new HashMap<>(); public static final class PermissionEntry { public final String name; @@ -75,12 +72,14 @@ public class SystemConfig { // These are the permission -> gid mappings that were read from the // system configuration files. - final ArrayMap mPermissions = - new ArrayMap(); + final ArrayMap mPermissions = new ArrayMap<>(); // These are the packages that are white-listed to be able to run in the // background while in power save mode, as read from the configuration files. - final ArraySet mAllowInPowerSave = new ArraySet(); + final ArraySet mAllowInPowerSave = new ArraySet<>(); + + // These are the app package names that should not allow IME switching. + final ArraySet mFixedImeApps = new ArraySet<>(); public static SystemConfig getInstance() { synchronized (SystemConfig.class) { @@ -115,6 +114,10 @@ public class SystemConfig { return mAllowInPowerSave; } + public ArraySet getFixedImeApps() { + return mFixedImeApps; + } + SystemConfig() { // Read configuration from system readPermissions(Environment.buildPath( @@ -298,6 +301,17 @@ public class SystemConfig { XmlUtils.skipCurrentTag(parser); continue; + } else if ("fixed-ime-app".equals(name)) { + String pkgname = parser.getAttributeValue(null, "package"); + if (pkgname == null) { + Slog.w(TAG, " without package at " + + parser.getPositionDescription()); + } else { + mFixedImeApps.add(pkgname); + } + XmlUtils.skipCurrentTag(parser); + continue; + } else { XmlUtils.skipCurrentTag(parser); continue;