Merge "Replace withCleanCallingIdentity with [clear|restore]CallingIdentity" am: 0f08d2fcb7 am: d5cdace044 am: 614d5de20d

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

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2ae6ed673a8c82a7e6326c35c17508d26f2e5236
This commit is contained in:
Chalard Jean
2021-03-09 08:52:01 +00:00
committed by Automerger Merge Worker

View File

@@ -2905,10 +2905,14 @@ public class ConnectivityManager {
ResultReceiver wrappedListener = new ResultReceiver(null) {
@Override
protected void onReceiveResult(int resultCode, Bundle resultData) {
Binder.withCleanCallingIdentity(() ->
executor.execute(() -> {
listener.onTetheringEntitlementResult(resultCode);
}));
final long token = Binder.clearCallingIdentity();
try {
executor.execute(() -> {
listener.onTetheringEntitlementResult(resultCode);
});
} finally {
Binder.restoreCallingIdentity(token);
}
}
};