Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f9cf886d authored by James Mattis's avatar James Mattis Committed by Automerger Merge Worker
Browse files

Merge "Calling linkToDeath on binder in NRI constructor" am: 6269d2eb

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1661222

Change-Id: Iec83a93593e52cdb2baf12fa76c70af9df263ee4
parents 64c20457 6269d2eb
Loading
Loading
Loading
Loading
+13 −7
Original line number Diff line number Diff line
@@ -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);
            }
        }