Skip to content

Commit

Permalink
Fixed for Deadlock in IMMS Proxy Service.
Browse files Browse the repository at this point in the history
Observed deadlock while switching user.

Updating imms service based on user in seperate thread.

Tests: Switch user few times. there is no dead lock issue.

Tracked-On: OAM-122779
Signed-off-by: Ankit Agrawal <[email protected]>
  • Loading branch information
ankithbti52509 committed Sep 19, 2024
1 parent 3b87e8e commit 1110e52
Showing 1 changed file with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
From 0f12a1f03d3883878158d67b735c16c67576cc11 Mon Sep 17 00:00:00 2001
From: Ankit Agrawal <[email protected]>
Date: Thu, 19 Sep 2024 19:24:33 +0530
Subject: [PATCH] Fixed for Deadlock in IMMS.

Observed deadlock while switching user.

Updating imms service based on user in seperate thread.

Tests: Switch user few times. there is no dead lock issue.

Tracked-On: OAM-122779
Signed-off-by: Ankit Agrawal <[email protected]>
---
.../server/inputmethod/InputMethodManagerServiceProxy.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/builtInServices/src_imms/com/android/server/inputmethod/InputMethodManagerServiceProxy.java b/builtInServices/src_imms/com/android/server/inputmethod/InputMethodManagerServiceProxy.java
index e7bb329..3978fa9 100644
--- a/builtInServices/src_imms/com/android/server/inputmethod/InputMethodManagerServiceProxy.java
+++ b/builtInServices/src_imms/com/android/server/inputmethod/InputMethodManagerServiceProxy.java
@@ -1088,8 +1088,10 @@ public final class InputMethodManagerServiceProxy extends IInputMethodManager.St
Slogf.d(mImmiTag, "User {%d} invoking maybeFinishStylusHandwriting",
callingUserId);
}
- InputMethodManagerInternal immi = getLocalServiceForUser(callingUserId);
- immi.maybeFinishStylusHandwriting();
+ sExecutor.execute(() -> {
+ InputMethodManagerInternal immi = getLocalServiceForUser(callingUserId);
+ immi.maybeFinishStylusHandwriting();
+ });
}

@Override
--
2.34.1

0 comments on commit 1110e52

Please sign in to comment.