summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorOscar Shu <xshu@google.com>2020-05-08 01:20:01 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-05-08 01:20:01 +0000
commit62369fee2e9d92663175cc6b4f4ed85a7cefaccc (patch)
treedc81115d559db53035d3330bdc8a937bae4b6b53 /service
parentaf62b323f3323aae25eb8459451cac6253fcab30 (diff)
parent6e91afa0d1078528c0d1987a72a539b7b8912776 (diff)
Merge "Fix WifiLockManager Death link does not exist" into rvc-dev am: b980e07ab2 am: 6e91afa0d1
Change-Id: Iccb4868fdb196d26d3b106bb0e9a8bf0741d5604
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiLockManager.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/service/java/com/android/server/wifi/WifiLockManager.java b/service/java/com/android/server/wifi/WifiLockManager.java
index 7bbd3aa2e..7cbeea0d3 100644
--- a/service/java/com/android/server/wifi/WifiLockManager.java
+++ b/service/java/com/android/server/wifi/WifiLockManager.java
@@ -36,6 +36,7 @@ import com.android.server.wifi.util.WorkSourceUtil;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
+import java.util.NoSuchElementException;
/**
* WifiLockManager maintains the list of wake locks held by different applications.
@@ -189,7 +190,6 @@ public class WifiLockManager {
// This is to make sure worksource value can not be changed by caller
// after function returns.
WorkSource newWorkSource = new WorkSource(ws);
-
return addLock(new WifiLock(lockMode, tag, binder, newWorkSource));
}
@@ -804,6 +804,7 @@ public class WifiLockManager {
try {
mBinder.linkToDeath(this, 0);
} catch (RemoteException e) {
+ Log.e(TAG, "mBinder.linkToDeath failed: " + e.getMessage());
binderDied();
}
}
@@ -829,7 +830,11 @@ public class WifiLockManager {
}
public void unlinkDeathRecipient() {
- mBinder.unlinkToDeath(this, 0);
+ try {
+ mBinder.unlinkToDeath(this, 0);
+ } catch (NoSuchElementException e) {
+ Log.e(TAG, "mBinder.unlinkToDeath failed: " + e.getMessage());
+ }
}
public String toString() {