Merge synchronized blocks in IMM#hideSoftInputFromView()
This is a follow up CL to our previous CLs [1][2], which introduced @hide InputMethodManager#hideSoftInputFromView() to convert the following boilerplate code we used to see in the Framework code var imm = view.getSystemService(InputMethodManager.class); if (imm != null && imm.isActive(view)) { imm.hideSoftInputFromWindow(view.getWindowToken(), 0); } into the following code. imm.hideSoftInputFromView(view, 0); In Bug 332912075, we however noticed that certain apps had already relied on IMM#checkFocus(), which is internally called in isActive(), and our CL [1] broke such apps. As a preparation before making such apps work again, this CL cleans up the existing code to reduce the complexity around lock acquisition. In general there must be no negative side effect in this change such as deadlock and lock contention. [1]: I01e5a29c0f82d068751774a2c58a1bd7b7b7f91a 2a757ef4 [2]: I7b305a93a7957ba5caebf49d55562fcf23f26766 fee50a4c Bug: 296466613 Bug: 332912075 Test: presubmit Change-Id: I5ff8380e11c8a68afbb56a0f3823461df0119e11
Loading
Please register or sign in to comment