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

Commit c5f070d6 authored by William Escande's avatar William Escande
Browse files

clear binder identity before executing on executor

Bug: 370815283
Test: m .
Flag: com.android.bluetooth.flags.get_profile_use_lock
Change-Id: Ib1efe9e1ae2ddfab179058d1691ffe37746669cb
parent 5fc26449
Loading
Loading
Loading
Loading
+6 −9
Original line number Diff line number Diff line
@@ -338,15 +338,12 @@ public final class BluetoothUtils {
     * @hide
     */
    public static void executeFromBinder(@NonNull Executor executor, @NonNull Runnable callback) {
        executor.execute(
                () -> {
        final long identity = Binder.clearCallingIdentity();
        try {
                        callback.run();
            executor.execute(() -> callback.run());
        } finally {
            Binder.restoreCallingIdentity(identity);
        }
                });
    }

    /** A {@link Consumer} that automatically logs {@link RemoteException} @hide */