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

Commit a668a2d5 authored by lucaslin's avatar lucaslin
Browse files

Replace withCleanCallingIdentity with [clear|restore]CallingIdentity

To prevent using @hide method - withCleanCallingIdentity() from
mainline module, use clearCallingIdentity() &
restoreCallingIdentity() instead.

Bug: 172183305
Test: FrameworksNetTests, CtsNetTestCasesLatestSdk
Change-Id: I8221bb8717ba6809c5087ea2808cd4ccef948cfd
parent 48054e5c
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -2886,10 +2886,14 @@ public class ConnectivityManager {
        ResultReceiver wrappedListener = new ResultReceiver(null) {
            @Override
            protected void onReceiveResult(int resultCode, Bundle resultData) {
                Binder.withCleanCallingIdentity(() ->
                final long token = Binder.clearCallingIdentity();
                try {
                    executor.execute(() -> {
                        listener.onTetheringEntitlementResult(resultCode);
                            }));
                    });
                } finally {
                    Binder.restoreCallingIdentity(token);
                }
            }
        };