summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorJohn Huang <jsh@google.com>2013-11-13 12:19:53 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2013-11-13 12:19:53 -0800
commit3803ea08921403bedf062afcc57fb142228d0026 (patch)
treed7b236089e5147f3d5a498f5b1ba8a3a0675148d /services
parentc07094c88ddd1ce3f6fda12f7a90b76c1bfe0977 (diff)
parentc4f535bddac2491aa0e354a609fcbf7c49276295 (diff)
downloadframeworks_base-3803ea08921403bedf062afcc57fb142228d0026.zip
frameworks_base-3803ea08921403bedf062afcc57fb142228d0026.tar.gz
frameworks_base-3803ea08921403bedf062afcc57fb142228d0026.tar.bz2
am c4f535bd: am 299e011e: am 54ca9066: Merge "Get rid of a race in NsdService in stopResolveService and getAddrInfo" into klp-dev
* commit 'c4f535bddac2491aa0e354a609fcbf7c49276295': Get rid of a race in NsdService in stopResolveService and getAddrInfo
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/NsdService.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/services/java/com/android/server/NsdService.java b/services/java/com/android/server/NsdService.java
index e0f415b..16d2468 100644
--- a/services/java/com/android/server/NsdService.java
+++ b/services/java/com/android/server/NsdService.java
@@ -483,10 +483,14 @@ public class NsdService extends INsdManager.Stub {
clientInfo.mResolvedService.setPort(Integer.parseInt(cooked[4]));
stopResolveService(id);
- if (!getAddrInfo(id, cooked[3])) {
+ removeRequestMap(clientId, id, clientInfo);
+
+ int id2 = getUniqueId();
+ if (getAddrInfo(id2, cooked[3])) {
+ storeRequestMap(clientId, id2, clientInfo);
+ } else {
clientInfo.mChannel.sendMessage(NsdManager.RESOLVE_SERVICE_FAILED,
NsdManager.FAILURE_INTERNAL_ERROR, clientId);
- removeRequestMap(clientId, id, clientInfo);
clientInfo.mResolvedService = null;
}
break;