Fix inconsistent permission checks for getSensorPropertiesInternal

There is an inconsistency between FaceManager and FaceService for the
permission required for getSensorPropertiesInternal. FaceManager checks
for USE_BIOMETRIC_INTERNAL while FaceService checks for
MANAGE_BIOMETRIC. Based on the definitions of those two permissions,
change to enforce USE_BIOMETRIC_INTERNAL.

Bug: 264719388

Test: m -j && atest com.android.server.biometrics
Change-Id: I86f7902b3dfc99aef094643e1b2fe88299c2aff4
This commit is contained in:
Haining Chen
2023-01-10 12:47:42 -08:00
parent f76de3d634
commit 2f4aaa4707
2 changed files with 2 additions and 2 deletions

View File

@@ -43,7 +43,7 @@ interface IFaceService {
byte[] dumpSensorServiceStateProto(int sensorId, boolean clearSchedulerBuffer);
// Retrieve static sensor properties for all face sensors
@EnforcePermission("MANAGE_BIOMETRIC")
@EnforcePermission("USE_BIOMETRIC_INTERNAL")
List<FaceSensorPropertiesInternal> getSensorPropertiesInternal(String opPackageName);
// Retrieve static sensor properties for the specified sensor

View File

@@ -125,7 +125,7 @@ public class FaceService extends SystemService {
return proto.getBytes();
}
@android.annotation.EnforcePermission(android.Manifest.permission.MANAGE_BIOMETRIC)
@android.annotation.EnforcePermission(android.Manifest.permission.USE_BIOMETRIC_INTERNAL)
@Override // Binder call
public List<FaceSensorPropertiesInternal> getSensorPropertiesInternal(
String opPackageName) {