Merge "UwbServiceImpl: Use cleanCallingIdentity to perform permission checks" into sc-dev
This commit is contained in:
@@ -19,6 +19,7 @@ package com.android.server.uwb;
|
|||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
import android.content.AttributionSource;
|
import android.content.AttributionSource;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.os.Binder;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import android.os.PersistableBundle;
|
import android.os.PersistableBundle;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
@@ -171,8 +172,10 @@ public class UwbServiceImpl extends IUwbAdapter.Stub implements IBinder.DeathRec
|
|||||||
RangingReport rangingReport)
|
RangingReport rangingReport)
|
||||||
throws RemoteException {
|
throws RemoteException {
|
||||||
if (!mIsValid) return;
|
if (!mIsValid) return;
|
||||||
if (!mUwbInjector.checkUwbRangingPermissionForDataDelivery(
|
boolean permissionGranted = Binder.withCleanCallingIdentity(
|
||||||
mAttributionSource, "uwb ranging result")) {
|
() -> mUwbInjector.checkUwbRangingPermissionForDataDelivery(
|
||||||
|
mAttributionSource, "uwb ranging result"));
|
||||||
|
if (!permissionGranted) {
|
||||||
Log.e(TAG, "Not delivering ranging result because of permission denial"
|
Log.e(TAG, "Not delivering ranging result because of permission denial"
|
||||||
+ mSessionHandle);
|
+ mSessionHandle);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user