OSDN Git Service

MountService listeners can not be unregistered
authorNiklas Brunlid <niklas.brunlid@sonymobile.com>
Fri, 5 Jul 2013 06:54:03 +0000 (08:54 +0200)
committerJohan Redestig <johan.redestig@sonymobile.com>
Wed, 18 Dec 2013 11:51:26 +0000 (12:51 +0100)
When unregistering MountService listeners, their Binder proxy
objects were compared to registered listeners instead of their
backing objects.

Change-Id: Ie98a686b1d17544f1eda59fb3eb0dc02d836c1b2

services/java/com/android/server/MountService.java

index e60231a..0d535cc 100644 (file)
@@ -1411,7 +1411,7 @@ class MountService extends IMountService.Stub
     public void unregisterListener(IMountServiceListener listener) {
         synchronized (mListeners) {
             for(MountServiceBinderListener bl : mListeners) {
-                if (bl.mListener == listener) {
+                if (bl.mListener.asBinder() == listener.asBinder()) {
                     mListeners.remove(mListeners.indexOf(bl));
                     listener.asBinder().unlinkToDeath(bl, 0);
                     return;