commit | eb298dfae54ce8c1d9e125b3b0068d7cc64c91d1 | [log] [tgz] |
---|---|---|
author | Lifu Tang <lifu@google.com> | Wed Nov 22 12:13:12 2017 -0800 |
committer | Lifu Tang <lifu@google.com> | Mon Nov 27 15:55:05 2017 -0800 |
tree | 736fc2dc4b7fd59862deaa66c815765e2beee59c | |
parent | 70164985f534f667df19e7b789534a1a9d9d1138 [diff] |
Clear the IBinder before calling unbindService The IBinder becomes invalid when unbindService() is called. Clear the reference to it to prevent the caller from accessing an already closed Binder. Bug: 69008332 Test: build and run on a device manually Change-Id: Id3340ac2799afaa1ea131f116b803de029161172
diff --git a/services/core/java/com/android/server/ServiceWatcher.java b/services/core/java/com/android/server/ServiceWatcher.java index f20ca43..f4238f2 100644 --- a/services/core/java/com/android/server/ServiceWatcher.java +++ b/services/core/java/com/android/server/ServiceWatcher.java
@@ -282,6 +282,7 @@ mBoundUserId = UserHandle.USER_NULL; if (component != null) { if (D) Log.d(mTag, "unbinding " + component); + mBoundService = null; mContext.unbindService(this); } }