summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Adrian Roos <roosa@google.com> 2016-07-22 17:03:42 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2016-07-22 17:03:43 +0000
commit1dcda854141d2660ec151e45c9336512f87c0832 (patch)
treeb49a50a9b435c8e2fab8bdc78afc4f788454b68c
parent6b69f6597ed1808dee82cc0036a865315e553d0c (diff)
parenta9b43182c6b43204a79e22e7efeadbd190520dd2 (diff)
Merge "ServiceConnection: Properly serialize events" into nyc-mr1-dev
-rw-r--r--core/java/android/app/LoadedApk.java25
1 files changed, 12 insertions, 13 deletions
diff --git a/core/java/android/app/LoadedApk.java b/core/java/android/app/LoadedApk.java
index b889c8f9a81b..7754244cae8e 100644
--- a/core/java/android/app/LoadedApk.java
+++ b/core/java/android/app/LoadedApk.java
@@ -1396,18 +1396,6 @@ public final class LoadedApk {
}
public void death(ComponentName name, IBinder service) {
- ServiceDispatcher.ConnectionInfo old;
-
- synchronized (this) {
- old = mActiveConnections.remove(name);
- if (old == null || old.binder != service) {
- // Death for someone different than who we last
- // reported... just ignore it.
- return;
- }
- old.binder.unlinkToDeath(old.deathMonitor, 0);
- }
-
if (mActivityThread != null) {
mActivityThread.post(new RunConnection(name, service, 1));
} else {
@@ -1456,7 +1444,7 @@ public final class LoadedApk {
}
}
- // If there was an old service, it is not disconnected.
+ // If there was an old service, it is now disconnected.
if (old != null) {
mConnection.onServiceDisconnected(name);
}
@@ -1467,6 +1455,17 @@ public final class LoadedApk {
}
public void doDeath(ComponentName name, IBinder service) {
+ synchronized (this) {
+ ConnectionInfo old = mActiveConnections.get(name);
+ if (old == null || old.binder != service) {
+ // Death for someone different than who we last
+ // reported... just ignore it.
+ return;
+ }
+ mActiveConnections.remove(name);
+ old.binder.unlinkToDeath(old.deathMonitor, 0);
+ }
+
mConnection.onServiceDisconnected(name);
}