Temporarily move MULTI_CLIENT_IME_ENABLED to frameworks.jar
This is a preparation to implement per-profile IME in
InputMethodManagerService (IMMS).
Multi-client IME is designed and implemented to be able to deal with
multiple profiles at the same time from its beginning [1]. This means
that when multi-client IME is enabled with system properties, it also
means that per-profile IME is enabled.
At the same time, the following classes need to change its behavior
whether per-profile IME is enabled or not.
* android.provider.Setings
* com.android.server.inputmethod.InputMethodManagerService
* com.android.server.textservices.TextServicesManagerService
* com.android.server.devicepolicy.DevicePolicyManagerService
* com.android.server.devicepolicy.OverlayPackagesProvider
The problem is that android.provider.Setings lives in the
frameworks.jar. Hence if we want to expose something like
PER_PROFILE_IME_ENABLED to android.provider.Setings, then such a flag
needs to live in frameworks.jar.
Note that this is expected to be a temporary change. Once per-profile
IME becomes always enabled in IMMS, we can safely roll back this
change.
Note also that static initializer of InputMethodSystemProperty is
expected to be evaluated only once as long as
InputMethodSystemProperty is loaded before Zygote.
[1]: I41dfe854557b178d8af740bc2869c936fc88608b
bae5bea23cfac3769569a230b56ad85cdd000675
Bug: 120709962
Test: prebuilts/checkstyle/checkstyle.py -f \
frameworks/base/core/java/android/view/inputmethod/InputMethodSystemProperty.java
Test: Manually verified as follows:
1. make -j MultiClientInputMethod
2. adb install -r $OUT/system/priv-app/MultiClientInputMethod/MultiClientInputMethod.apk
3. adb root
4. adb shell setprop persist.debug.multi_client_ime \
com.example.android.multiclientinputmethod/.MultiClientInputMethod
5. adb reboot
6. Make sure that multi-client IME is enabled
Change-Id: Iad8aba7edb1e60ccc1ce5192a11e01b6aa8d00a0
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index 046c991..1862636 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -63,6 +63,7 @@
import android.util.Slog;
import android.util.TimingsTraceLog;
import android.view.WindowManager;
+import android.view.inputmethod.InputMethodSystemProperty;
import com.android.internal.R;
import com.android.internal.logging.MetricsLogger;
@@ -1019,7 +1020,7 @@
// Bring up services needed for UI.
if (mFactoryTestMode != FactoryTest.FACTORY_TEST_LOW_LEVEL) {
traceBeginAndSlog("StartInputMethodManagerLifecycle");
- if (MultiClientInputMethodManagerService.isConfiguredToUse()) {
+ if (InputMethodSystemProperty.MULTI_CLIENT_IME_ENABLED) {
mSystemServiceManager.startService(
MultiClientInputMethodManagerService.Lifecycle.class);
} else {