diff options
| author | Ahaan Ugale <augale@google.com> | 2021-07-12 17:50:57 +0000 |
|---|---|---|
| committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-07-12 17:50:57 +0000 |
| commit | 4a299daf0c87f9fb93ffbd97d128cf376a472ccc (patch) | |
| tree | dba7d9b2927409b574b33a80bde3afa3d22acf2c /core/java | |
| parent | 5a82abc8b9b5288433d2af8083e89bd643f0ccce (diff) | |
| parent | e360fc69a74a75c6c9517d8eda55a0441b594e3c (diff) | |
Merge "Check/note ops when delivering HotwordDetectedResult" into sc-dev am: e360fc69a7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15241921
Change-Id: If57ad52446076e4548529e14913b1e710d70e947
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/service/voice/AbstractHotwordDetector.java | 6 | ||||
| -rw-r--r-- | core/java/com/android/internal/app/IVoiceInteractionManagerService.aidl | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/core/java/android/service/voice/AbstractHotwordDetector.java b/core/java/android/service/voice/AbstractHotwordDetector.java index 54ccf309a58e..dbe108974684 100644 --- a/core/java/android/service/voice/AbstractHotwordDetector.java +++ b/core/java/android/service/voice/AbstractHotwordDetector.java @@ -20,7 +20,9 @@ import static com.android.internal.util.function.pooled.PooledLambda.obtainMessa import android.annotation.NonNull; import android.annotation.Nullable; +import android.app.ActivityThread; import android.media.AudioFormat; +import android.media.permission.Identity; import android.os.Handler; import android.os.Looper; import android.os.ParcelFileDescriptor; @@ -111,8 +113,10 @@ abstract class AbstractHotwordDetector implements HotwordDetector { if (DEBUG) { Slog.d(TAG, "updateStateLocked()"); } + Identity identity = new Identity(); + identity.packageName = ActivityThread.currentOpPackageName(); try { - mManagerService.updateState(options, sharedMemory, callback); + mManagerService.updateState(identity, options, sharedMemory, callback); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } diff --git a/core/java/com/android/internal/app/IVoiceInteractionManagerService.aidl b/core/java/com/android/internal/app/IVoiceInteractionManagerService.aidl index dddc08a88062..c8a4425409e8 100644 --- a/core/java/com/android/internal/app/IVoiceInteractionManagerService.aidl +++ b/core/java/com/android/internal/app/IVoiceInteractionManagerService.aidl @@ -231,6 +231,9 @@ interface IVoiceInteractionManagerService { /** * Set configuration and pass read-only data to hotword detection service. + * Caller must provide an identity, used for permission tracking purposes. + * The uid/pid elements of the identity will be ignored by the server and replaced with the ones + * provided by binder. * * @param options Application configuration data to provide to the * {@link HotwordDetectionService}. PersistableBundle does not allow any remotable objects or @@ -241,6 +244,7 @@ interface IVoiceInteractionManagerService { * @param callback Use this to report {@link HotwordDetectionService} status. */ void updateState( + in Identity originatorIdentity, in PersistableBundle options, in SharedMemory sharedMemory, in IHotwordRecognitionStatusCallback callback); |
