File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -901,6 +901,7 @@ static final class ServiceDispatcher {
901901 private RuntimeException mUnbindLocation ;
902902
903903 private boolean mDied ;
904+ private boolean mForgotten ;
904905
905906 private static class ConnectionInfo {
906907 IBinder binder ;
@@ -959,6 +960,7 @@ void doForget() {
959960 ci .binder .unlinkToDeath (ci .deathMonitor , 0 );
960961 }
961962 mActiveConnections .clear ();
963+ mForgotten = true ;
962964 }
963965 }
964966
@@ -1020,6 +1022,11 @@ public void doConnected(ComponentName name, IBinder service) {
10201022 ServiceDispatcher .ConnectionInfo info ;
10211023
10221024 synchronized (this ) {
1025+ if (mForgotten ) {
1026+ // We unbound before receiving the connection; ignore
1027+ // any connection received.
1028+ return ;
1029+ }
10231030 old = mActiveConnections .get (name );
10241031 if (old != null && old .binder == service ) {
10251032 // Huh, already have this one. Oh well!
You can’t perform that action at this time.
0 commit comments