services.core.unboosted - call PermissionEnforcer helper on methods annotated with @EnforcePermission

Migrates all existing java methods annotated with @EnforcePermission
such that they call the super.<methodName>_enforcePermission
method provided by PermissionEnforcer.

This required by the @EnforcePermission annotation, but is currently a
no-op, and will be switched on with ag/20325484.

This CL migrates incremental additions made since the original LSC
ag/20189550.

Bug: 234083358
Test: TH
Change-Id: Ia8b9c10c7af41ac6dff699e6b78f012d50389e6c
This commit is contained in:
mattgilbride
2022-11-07 14:24:15 +00:00
committed by Matt Gilbride
parent 4e72b9846e
commit 19b835abf9
3 changed files with 6 additions and 0 deletions

View File

@@ -780,6 +780,8 @@ public class BiometricService extends SystemService {
@Override // Binder call
public void resetLockout(
int userId, byte[] hardwareAuthToken) {
super.resetLockout_enforcePermission();
Slog.d(TAG, "resetLockout(userId=" + userId
+ ", hat=" + (hardwareAuthToken == null ? "null " : "present") + ")");
mBiometricContext.getAuthSessionCoordinator()

View File

@@ -942,6 +942,8 @@ public class FingerprintService extends SystemService {
@android.annotation.EnforcePermission(android.Manifest.permission.USE_BIOMETRIC_INTERNAL)
@Override
public void setUdfpsOverlay(@NonNull IUdfpsOverlay controller) {
super.setUdfpsOverlay_enforcePermission();
for (ServiceProvider provider : mRegistry.getProviders()) {
provider.setUdfpsOverlay(controller);
}

View File

@@ -2676,6 +2676,8 @@ public class InputManagerService extends IInputManager.Stub
@EnforcePermission(Manifest.permission.BLUETOOTH)
@Override
public String getInputDeviceBluetoothAddress(int deviceId) {
super.getInputDeviceBluetoothAddress_enforcePermission();
return mNative.getBluetoothAddress(deviceId);
}