diff options
author | 2021-04-01 02:38:58 +0000 | |
---|---|---|
committer | 2021-04-01 02:38:58 +0000 | |
commit | 6269d2eb7a2740fc18c95dbba70d6686f178fdad (patch) | |
tree | 9fa5b019d8ff77274f7c76e96a96ea602c17d3ad | |
parent | 222b1e4ad71608afdea98234f101fdff58dcc35e (diff) | |
parent | 088550048864aa836e9411acc28ae8f8fed28a03 (diff) |
Merge "Calling linkToDeath on binder in NRI constructor"
-rw-r--r-- | services/core/java/com/android/server/ConnectivityService.java | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java index e3ce7a31b97e..70c9fe7f3ac9 100644 --- a/services/core/java/com/android/server/ConnectivityService.java +++ b/services/core/java/com/android/server/ConnectivityService.java @@ -5542,12 +5542,7 @@ public class ConnectivityService extends IConnectivityManager.Stub incrementRequestCountOrThrow(this); mCallbackFlags = callbackFlags; mCallingAttributionTag = callingAttributionTag; - - try { - mBinder.linkToDeath(this, 0); - } catch (RemoteException e) { - binderDied(); - } + linkDeathRecipient(); } NetworkRequestInfo(@NonNull final NetworkRequestInfo nri, @@ -5585,6 +5580,7 @@ public class ConnectivityService extends IConnectivityManager.Stub incrementRequestCountOrThrow(this); mCallbackFlags = nri.mCallbackFlags; mCallingAttributionTag = nri.mCallingAttributionTag; + linkDeathRecipient(); } NetworkRequestInfo(int asUid, @NonNull final NetworkRequest r) { @@ -5613,8 +5609,18 @@ public class ConnectivityService extends IConnectivityManager.Stub return Collections.unmodifiableList(tempRequests); } + void linkDeathRecipient() { + if (null != mBinder) { + try { + mBinder.linkToDeath(this, 0); + } catch (RemoteException e) { + binderDied(); + } + } + } + void unlinkDeathRecipient() { - if (mBinder != null) { + if (null != mBinder) { mBinder.unlinkToDeath(this, 0); } } |