Loading services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +3 −1 Original line number Diff line number Diff line Loading @@ -964,6 +964,8 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. Process.THREAD_PRIORITY_FOREGROUND, true /* allowIo */); ioThread.start(); SecureSettingsWrapper.setContentResolver(context.getContentResolver()); return new InputMethodManagerService(context, shouldEnableConcurrentMultiUserMode(context), thread.getLooper(), Handler.createAsync(ioThread.getLooper()), Loading Loading @@ -1019,6 +1021,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. public void onUserRemoved(UserInfo user) { // Called directly from UserManagerService. Do not block the calling thread. final int userId = user.id; SecureSettingsWrapper.onUserRemoved(userId); mService.mUserDataRepository.remove(userId); } Loading Loading @@ -1099,7 +1102,6 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. mConcurrentMultiUserModeEnabled = concurrentMultiUserModeEnabled; mContext = context; mRes = context.getResources(); SecureSettingsWrapper.onStart(mContext); mHandler = Handler.createAsync(uiLooper, this); mIoHandler = ioHandler; Loading services/core/java/com/android/server/inputmethod/SecureSettingsWrapper.java +16 −24 Original line number Diff line number Diff line Loading @@ -20,10 +20,7 @@ import android.annotation.AnyThread; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.UserIdInt; import android.app.ActivityManagerInternal; import android.content.ContentResolver; import android.content.Context; import android.content.pm.UserInfo; import android.provider.Settings; import android.util.ArrayMap; import android.util.ArraySet; Loading Loading @@ -321,30 +318,13 @@ final class SecureSettingsWrapper { } /** * Called when {@link InputMethodManagerService} is starting. * Called when the system is starting. * * @param context the {@link Context} to be used. * @param contentResolver the {@link ContentResolver} to be used */ @AnyThread static void onStart(@NonNull Context context) { sContentResolver = context.getContentResolver(); final int userId = LocalServices.getService(ActivityManagerInternal.class) .getCurrentUserId(); final UserManagerInternal userManagerInternal = LocalServices.getService(UserManagerInternal.class); putOrGet(userId, createImpl(userManagerInternal, userId)); userManagerInternal.addUserLifecycleListener( new UserManagerInternal.UserLifecycleListener() { @Override public void onUserRemoved(UserInfo user) { synchronized (sUserMap) { sUserMap.remove(userId); } } } ); static void setContentResolver(@NonNull ContentResolver contentResolver) { sContentResolver = contentResolver; } /** Loading Loading @@ -376,6 +356,18 @@ final class SecureSettingsWrapper { putOrGet(userId, readerWriter); } /** * Called when a user is being removed. * * @param userId the ID of the user whose storage is being removed. */ @AnyThread static void onUserRemoved(@UserIdInt int userId) { synchronized (sUserMap) { sUserMap.remove(userId); } } /** * Put the given string {@code value} to {@code key}. * Loading Loading
services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +3 −1 Original line number Diff line number Diff line Loading @@ -964,6 +964,8 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. Process.THREAD_PRIORITY_FOREGROUND, true /* allowIo */); ioThread.start(); SecureSettingsWrapper.setContentResolver(context.getContentResolver()); return new InputMethodManagerService(context, shouldEnableConcurrentMultiUserMode(context), thread.getLooper(), Handler.createAsync(ioThread.getLooper()), Loading Loading @@ -1019,6 +1021,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. public void onUserRemoved(UserInfo user) { // Called directly from UserManagerService. Do not block the calling thread. final int userId = user.id; SecureSettingsWrapper.onUserRemoved(userId); mService.mUserDataRepository.remove(userId); } Loading Loading @@ -1099,7 +1102,6 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. mConcurrentMultiUserModeEnabled = concurrentMultiUserModeEnabled; mContext = context; mRes = context.getResources(); SecureSettingsWrapper.onStart(mContext); mHandler = Handler.createAsync(uiLooper, this); mIoHandler = ioHandler; Loading
services/core/java/com/android/server/inputmethod/SecureSettingsWrapper.java +16 −24 Original line number Diff line number Diff line Loading @@ -20,10 +20,7 @@ import android.annotation.AnyThread; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.UserIdInt; import android.app.ActivityManagerInternal; import android.content.ContentResolver; import android.content.Context; import android.content.pm.UserInfo; import android.provider.Settings; import android.util.ArrayMap; import android.util.ArraySet; Loading Loading @@ -321,30 +318,13 @@ final class SecureSettingsWrapper { } /** * Called when {@link InputMethodManagerService} is starting. * Called when the system is starting. * * @param context the {@link Context} to be used. * @param contentResolver the {@link ContentResolver} to be used */ @AnyThread static void onStart(@NonNull Context context) { sContentResolver = context.getContentResolver(); final int userId = LocalServices.getService(ActivityManagerInternal.class) .getCurrentUserId(); final UserManagerInternal userManagerInternal = LocalServices.getService(UserManagerInternal.class); putOrGet(userId, createImpl(userManagerInternal, userId)); userManagerInternal.addUserLifecycleListener( new UserManagerInternal.UserLifecycleListener() { @Override public void onUserRemoved(UserInfo user) { synchronized (sUserMap) { sUserMap.remove(userId); } } } ); static void setContentResolver(@NonNull ContentResolver contentResolver) { sContentResolver = contentResolver; } /** Loading Loading @@ -376,6 +356,18 @@ final class SecureSettingsWrapper { putOrGet(userId, readerWriter); } /** * Called when a user is being removed. * * @param userId the ID of the user whose storage is being removed. */ @AnyThread static void onUserRemoved(@UserIdInt int userId) { synchronized (sUserMap) { sUserMap.remove(userId); } } /** * Put the given string {@code value} to {@code key}. * Loading