Loading core/java/android/service/voice/AlwaysOnHotwordDetector.java +6 −0 Original line number Diff line number Diff line Loading @@ -67,6 +67,7 @@ import com.android.internal.annotations.GuardedBy; import com.android.internal.app.IHotwordRecognitionStatusCallback; import com.android.internal.app.IVoiceInteractionManagerService; import com.android.internal.app.IVoiceInteractionSoundTriggerSession; import com.android.internal.infra.AndroidFuture; import java.io.PrintWriter; import java.lang.annotation.Retention; Loading Loading @@ -1702,6 +1703,11 @@ public class AlwaysOnHotwordDetector extends AbstractDetector { Slog.i(TAG, "onProcessRestarted"); mHandler.sendEmptyMessage(MSG_PROCESS_RESTARTED); } @Override public void onOpenFile(String filename, AndroidFuture future) throws RemoteException { throw new UnsupportedOperationException("Hotword cannot access files from the disk."); } } void onDetectorRemoteException() { Loading core/java/android/service/voice/HotwordDetectionService.java +6 −0 Original line number Diff line number Diff line Loading @@ -227,6 +227,12 @@ public abstract class HotwordDetectionService extends Service public void stopDetection() { HotwordDetectionService.this.onStopDetection(); } @Override public void registerRemoteStorageService(IDetectorSessionStorageService detectorSessionStorageService) { throw new UnsupportedOperationException("Hotword cannot access files from the disk."); } }; @Override Loading core/java/android/service/voice/IDetectorSessionStorageService.aidl 0 → 100644 +30 −0 Original line number Diff line number Diff line /* * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.service.voice; import com.android.internal.infra.AndroidFuture; /** * @hide */ oneway interface IDetectorSessionStorageService { /** * Called when a file open request is sent. Only files with the given names under the internal * app storage, i.e., {@link Context#getFilesDir()} can be opened. */ void openFile(in String filename, in AndroidFuture future); } core/java/android/service/voice/ISandboxedDetectionService.aidl +7 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.os.IRemoteCallback; import android.os.ParcelFileDescriptor; import android.os.PersistableBundle; import android.os.SharedMemory; import android.service.voice.IDetectorSessionStorageService; import android.service.voice.IDetectorSessionVisualQueryDetectionCallback; import android.service.voice.IDspHotwordDetectionCallback; import android.view.contentcapture.IContentCaptureManager; Loading Loading @@ -71,4 +72,10 @@ oneway interface ISandboxedDetectionService { void ping(in IRemoteCallback callback); void stopDetection(); /** * Registers the interface stub to talk to the voice interaction service for initialization/ * detection unrelated functionalities. */ void registerRemoteStorageService(in IDetectorSessionStorageService detectorSessionStorageService); } core/java/android/service/voice/SoftwareHotwordDetector.java +6 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ import android.util.Slog; import com.android.internal.app.IHotwordRecognitionStatusCallback; import com.android.internal.app.IVoiceInteractionManagerService; import com.android.internal.infra.AndroidFuture; import java.io.PrintWriter; import java.util.concurrent.Executor; Loading Loading @@ -299,6 +300,11 @@ class SoftwareHotwordDetector extends AbstractDetector { Binder.withCleanCallingIdentity(() -> mExecutor.execute( () -> mCallback.onHotwordDetectionServiceRestarted())); } @Override public void onOpenFile(String filename, AndroidFuture future) throws RemoteException { throw new UnsupportedOperationException("Hotword cannot access files from the disk."); } } /** @hide */ Loading Loading
core/java/android/service/voice/AlwaysOnHotwordDetector.java +6 −0 Original line number Diff line number Diff line Loading @@ -67,6 +67,7 @@ import com.android.internal.annotations.GuardedBy; import com.android.internal.app.IHotwordRecognitionStatusCallback; import com.android.internal.app.IVoiceInteractionManagerService; import com.android.internal.app.IVoiceInteractionSoundTriggerSession; import com.android.internal.infra.AndroidFuture; import java.io.PrintWriter; import java.lang.annotation.Retention; Loading Loading @@ -1702,6 +1703,11 @@ public class AlwaysOnHotwordDetector extends AbstractDetector { Slog.i(TAG, "onProcessRestarted"); mHandler.sendEmptyMessage(MSG_PROCESS_RESTARTED); } @Override public void onOpenFile(String filename, AndroidFuture future) throws RemoteException { throw new UnsupportedOperationException("Hotword cannot access files from the disk."); } } void onDetectorRemoteException() { Loading
core/java/android/service/voice/HotwordDetectionService.java +6 −0 Original line number Diff line number Diff line Loading @@ -227,6 +227,12 @@ public abstract class HotwordDetectionService extends Service public void stopDetection() { HotwordDetectionService.this.onStopDetection(); } @Override public void registerRemoteStorageService(IDetectorSessionStorageService detectorSessionStorageService) { throw new UnsupportedOperationException("Hotword cannot access files from the disk."); } }; @Override Loading
core/java/android/service/voice/IDetectorSessionStorageService.aidl 0 → 100644 +30 −0 Original line number Diff line number Diff line /* * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.service.voice; import com.android.internal.infra.AndroidFuture; /** * @hide */ oneway interface IDetectorSessionStorageService { /** * Called when a file open request is sent. Only files with the given names under the internal * app storage, i.e., {@link Context#getFilesDir()} can be opened. */ void openFile(in String filename, in AndroidFuture future); }
core/java/android/service/voice/ISandboxedDetectionService.aidl +7 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.os.IRemoteCallback; import android.os.ParcelFileDescriptor; import android.os.PersistableBundle; import android.os.SharedMemory; import android.service.voice.IDetectorSessionStorageService; import android.service.voice.IDetectorSessionVisualQueryDetectionCallback; import android.service.voice.IDspHotwordDetectionCallback; import android.view.contentcapture.IContentCaptureManager; Loading Loading @@ -71,4 +72,10 @@ oneway interface ISandboxedDetectionService { void ping(in IRemoteCallback callback); void stopDetection(); /** * Registers the interface stub to talk to the voice interaction service for initialization/ * detection unrelated functionalities. */ void registerRemoteStorageService(in IDetectorSessionStorageService detectorSessionStorageService); }
core/java/android/service/voice/SoftwareHotwordDetector.java +6 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ import android.util.Slog; import com.android.internal.app.IHotwordRecognitionStatusCallback; import com.android.internal.app.IVoiceInteractionManagerService; import com.android.internal.infra.AndroidFuture; import java.io.PrintWriter; import java.util.concurrent.Executor; Loading Loading @@ -299,6 +300,11 @@ class SoftwareHotwordDetector extends AbstractDetector { Binder.withCleanCallingIdentity(() -> mExecutor.execute( () -> mCallback.onHotwordDetectionServiceRestarted())); } @Override public void onOpenFile(String filename, AndroidFuture future) throws RemoteException { throw new UnsupportedOperationException("Hotword cannot access files from the disk."); } } /** @hide */ Loading