Merge "Call enforceCallingPermission instead of annotation EnforcePermission"

This commit is contained in:
TreeHugger Robot
2022-09-19 11:05:16 +00:00
committed by Android (Google) Code Review
2 changed files with 4 additions and 4 deletions

View File

@@ -270,7 +270,6 @@ interface IVoiceInteractionManagerService {
*/
void shutdownHotwordDetectionService();
@EnforcePermission(allOf={"RECORD_AUDIO", "CAPTURE_AUDIO_HOTWORD"})
void startListeningFromMic(
in AudioFormat audioFormat,
in IMicrophoneHotwordDetectionVoiceInteractionCallback callback);
@@ -286,7 +285,6 @@ interface IVoiceInteractionManagerService {
/**
* Test API to simulate to trigger hardware recognition event for test.
*/
@EnforcePermission(allOf={"RECORD_AUDIO", "CAPTURE_AUDIO_HOTWORD"})
void triggerHardwareRecognitionEventForTest(
in SoundTrigger.KeyphraseRecognitionEvent event,
in IHotwordRecognitionStatusCallback callback);

View File

@@ -1284,12 +1284,13 @@ public class VoiceInteractionManagerService extends SystemService {
}
}
@android.annotation.EnforcePermission(allOf={android.Manifest.permission.RECORD_AUDIO, android.Manifest.permission.CAPTURE_AUDIO_HOTWORD})
@Override
public void startListeningFromMic(
AudioFormat audioFormat,
IMicrophoneHotwordDetectionVoiceInteractionCallback callback)
throws RemoteException {
enforceCallingPermission(Manifest.permission.RECORD_AUDIO);
enforceCallingPermission(Manifest.permission.CAPTURE_AUDIO_HOTWORD);
synchronized (this) {
enforceIsCurrentVoiceInteractionService();
@@ -1349,12 +1350,13 @@ public class VoiceInteractionManagerService extends SystemService {
}
}
@android.annotation.EnforcePermission(allOf={android.Manifest.permission.RECORD_AUDIO, android.Manifest.permission.CAPTURE_AUDIO_HOTWORD})
@Override
public void triggerHardwareRecognitionEventForTest(
SoundTrigger.KeyphraseRecognitionEvent event,
IHotwordRecognitionStatusCallback callback)
throws RemoteException {
enforceCallingPermission(Manifest.permission.RECORD_AUDIO);
enforceCallingPermission(Manifest.permission.CAPTURE_AUDIO_HOTWORD);
synchronized (this) {
enforceIsCurrentVoiceInteractionService();