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

Commit 3a9f725d authored by William Escande's avatar William Escande Committed by Gerrit Code Review
Browse files

Merge "clear binder identity before executing on executor" into main

parents ac17109c c5f070d6
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 */