OSDN Git Service

Clear IMMS#mCurClient when it is dead.
authorYohei Yukawa <yukawa@google.com>
Wed, 18 Nov 2015 23:54:34 +0000 (15:54 -0800)
committerYohei Yukawa <yukawa@google.com>
Thu, 19 Nov 2015 03:46:18 +0000 (03:46 +0000)
commit072b1b5183bf3e193b20902b967fb3ecbbb175a3
tree7b02596897242e723d25aead8381a057f457af3f
parent27fe57d5cf8140db1d1ba9c43919d5ad023cca84
Clear IMMS#mCurClient when it is dead.

Suppose the following case:
  1. Launch an activity.
  2. Focus in an EditText on the activity.  IME is shown up.
  3. Kill the activity process in a not graceful way, e.g.,
     'adb shell kill'

After step 3, IMMS#removeClient(client) is immediately called back from
com.android.server.wm.Session, which is good, but we forgot to clear
IMMS#mCurClient to null.

Basically not clearing IMMS#mCurClient there is not so critical, because
1) we already have bunch of RemoteException check for the case where
IPC target is already dead, and in theory we cannot avoid this kind of
runtime error anyway, and 2) in most of cases new input method client
gains focus.

That said, in conjunction with other focus-related issues such
as bug #25373872, not cleaning that can result in the following error
message in 'input_method:' section of bugreport, which might be a bit
confusing.

  Input method client dead: android.os.DeadObjectException

The primary goal of this CL is to make bugreport less confusing.  Any
user/developer-visible changes beyond that is unintentional.

Bug: 25373872
Change-Id: Iee001ad9cce0c8c6324e3c0984be1e6f0e641d05
services/core/java/com/android/server/InputMethodManagerService.java