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

Commit 23171665 authored by William Escande's avatar William Escande Committed by Automerger Merge Worker
Browse files

Merge "clear binder identity before executing on executor" into main am: 3a9f725d

parents 2b173d8d 3a9f725d
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 */