From 68856e13d3e8e86351123fc5888508288df7d8c8 Mon Sep 17 00:00:00 2001 From: Antonio Kantek Date: Thu, 18 Jul 2024 17:43:45 +0000 Subject: Perform minor code clean up Clean up: * Removed unused local variable (focusWindowClient) in #dumpAsStringNoCheck * Removed unnecessary fully qualified name 'ImeVisibilityStateComputer.STATE_HIDE_IME' due to existing static import. * Remove the static import for both STYLUS_HANDWRITING_DEFAULT_VALUE and STYLUS_HANDWRITING_ENABLED with direct references from Settings.Secure. This will ensure consistency in how settings are accessed. Bug: 339089063 Test: m Flag: EXEMPT refactor Change-Id: Ic786df7c7c9c2e730819f666a2d68861c0ba63a0 --- .../server/inputmethod/InputMethodManagerService.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java index ecbbd46bea76..bd543fa7f402 100644 --- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java @@ -22,8 +22,6 @@ import static android.os.IServiceManager.DUMP_FLAG_PRIORITY_NORMAL; import static android.os.IServiceManager.DUMP_FLAG_PROTO; import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER; import static android.os.UserManager.USER_TYPE_SYSTEM_HEADLESS; -import static android.provider.Settings.Secure.STYLUS_HANDWRITING_DEFAULT_VALUE; -import static android.provider.Settings.Secure.STYLUS_HANDWRITING_ENABLED; import static android.server.inputmethod.InputMethodManagerServiceProto.BACK_DISPOSITION; import static android.server.inputmethod.InputMethodManagerServiceProto.BOUND_TO_METHOD; import static android.server.inputmethod.InputMethodManagerServiceProto.CONCURRENT_MULTI_USER_MODE_ENABLED; @@ -51,6 +49,7 @@ import static android.view.inputmethod.ConnectionlessHandwritingCallback.CONNECT import static com.android.server.inputmethod.ImeVisibilityStateComputer.ImeTargetWindowState; import static com.android.server.inputmethod.ImeVisibilityStateComputer.ImeVisibilityResult; +import static com.android.server.inputmethod.ImeVisibilityStateComputer.STATE_SHOW_IME; import static com.android.server.inputmethod.ImeVisibilityStateComputer.STATE_HIDE_IME; import static com.android.server.inputmethod.InputMethodBindingController.TIME_TO_RECONNECT; import static com.android.server.inputmethod.InputMethodSubtypeSwitchingController.MODE_AUTO; @@ -597,7 +596,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. } break; } - case STYLUS_HANDWRITING_ENABLED: { + case Settings.Secure.STYLUS_HANDWRITING_ENABLED: { InputMethodManager.invalidateLocalStylusHandwritingAvailabilityCaches(); InputMethodManager .invalidateLocalConnectionlessStylusHandwritingAvailabilityCaches(); @@ -1617,8 +1616,8 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. // If user is a profile, use preference of it`s parent profile. final int profileParentUserId = mUserManagerInternal.getProfileParentId(userId); if (Settings.Secure.getIntForUser(context.getContentResolver(), - STYLUS_HANDWRITING_ENABLED, STYLUS_HANDWRITING_DEFAULT_VALUE, - profileParentUserId) == 0) { + Settings.Secure.STYLUS_HANDWRITING_ENABLED, + Settings.Secure.STYLUS_HANDWRITING_DEFAULT_VALUE, profileParentUserId) == 0) { return false; } return true; @@ -4787,8 +4786,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. final IBinder requestToken = mVisibilityStateComputer.getWindowTokenFrom( windowToken, userId); mVisibilityApplier.applyImeVisibility(requestToken, statsToken, - setVisible ? ImeVisibilityStateComputer.STATE_SHOW_IME - : ImeVisibilityStateComputer.STATE_HIDE_IME, + setVisible ? STATE_SHOW_IME : STATE_HIDE_IME, SoftInputShowHideReason.NOT_SET /* ignore reason */, userId); } } finally { @@ -6274,7 +6272,6 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. boolean isCritical) { IInputMethodInvoker method; ClientState client; - ClientState focusedWindowClient; final Printer p = new PrintWriterPrinter(pw); -- cgit v1.2.3-59-g8ed1b