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

Commit a4223b98 authored by Roshan Pius's avatar Roshan Pius Committed by Automerger Merge Worker
Browse files

Merge "UwbServiceImpl: Use cleanCallingIdentity to perform permission checks"...

Merge "UwbServiceImpl: Use cleanCallingIdentity to perform permission checks" into sc-dev am: c519e91e am: db340247

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

Change-Id: Ieaf82b833ad95e8d3751a86eafaa4fa22877fd13
parents 1878d52c db340247
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.server.uwb;
import android.annotation.NonNull;
import android.content.AttributionSource;
import android.content.Context;
import android.os.Binder;
import android.os.IBinder;
import android.os.PersistableBundle;
import android.os.RemoteException;
@@ -171,8 +172,10 @@ public class UwbServiceImpl extends IUwbAdapter.Stub implements IBinder.DeathRec
                RangingReport rangingReport)
                throws RemoteException {
            if (!mIsValid) return;
            if (!mUwbInjector.checkUwbRangingPermissionForDataDelivery(
                    mAttributionSource, "uwb ranging result")) {
            boolean permissionGranted = Binder.withCleanCallingIdentity(
                    () -> mUwbInjector.checkUwbRangingPermissionForDataDelivery(
                            mAttributionSource, "uwb ranging result"));
            if (!permissionGranted) {
                Log.e(TAG, "Not delivering ranging result because of permission denial"
                        + mSessionHandle);
                return;