blob: 7d5abd2cca14184843620f82250022286569715a [file] [log] [blame]
Dianne Hackborn91097de2014-04-04 18:02:06 -07001/*
2 * Copyright (C) 2014 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.internal.app;
18
19import android.content.Intent;
Dianne Hackborn18f0d352014-04-25 17:06:18 -070020import android.os.Bundle;
Dianne Hackborn91097de2014-04-04 18:02:06 -070021
22import com.android.internal.app.IVoiceInteractor;
Sandeep Siddhartha05589722014-07-17 16:21:54 -070023import android.hardware.soundtrigger.IRecognitionStatusCallback;
24import android.hardware.soundtrigger.SoundTrigger;
Dianne Hackborn91097de2014-04-04 18:02:06 -070025import android.service.voice.IVoiceInteractionService;
26import android.service.voice.IVoiceInteractionSession;
27
28interface IVoiceInteractionManagerService {
Dianne Hackbornc03c9162014-05-02 10:45:59 -070029 void startSession(IVoiceInteractionService service, in Bundle sessionArgs);
30 boolean deliverNewSession(IBinder token, IVoiceInteractionSession session,
Dianne Hackborn18f0d352014-04-25 17:06:18 -070031 IVoiceInteractor interactor);
Dianne Hackbornc03c9162014-05-02 10:45:59 -070032 int startVoiceActivity(IBinder token, in Intent intent, String resolvedType);
33 void finish(IBinder token);
Sandeepd7018202014-07-10 15:15:39 -070034
35 /**
36 * Lists the registered Sound models for keyphrase detection.
37 * May be null if no matching sound models exist.
38 *
39 * @param service The current voice interaction service.
40 */
Sandeep Siddhartha05589722014-07-17 16:21:54 -070041 List<SoundTrigger.KeyphraseSoundModel> listRegisteredKeyphraseSoundModels(
42 in IVoiceInteractionService service);
Sandeepd7018202014-07-10 15:15:39 -070043 /**
44 * Updates the given keyphrase sound model. Adds the model if it doesn't exist currently.
45 */
Sandeep Siddhartha05589722014-07-17 16:21:54 -070046 int updateKeyphraseSoundModel(in SoundTrigger.KeyphraseSoundModel model);
47
48 /**
49 * Gets the properties of the DSP hardware on this device, null if not present.
50 */
51 SoundTrigger.ModuleProperties getDspModuleProperties(in IVoiceInteractionService service);
52 /**
53 * Starts a recognition for the given keyphrase.
54 */
55 int startRecognition(in IVoiceInteractionService service, int keyphraseId,
56 in SoundTrigger.KeyphraseSoundModel soundModel, in IRecognitionStatusCallback callback,
57 in SoundTrigger.RecognitionConfig recognitionConfig);
58 /**
59 * Stops a recognition for the given keyphrase.
60 */
61 int stopRecognition(in IVoiceInteractionService service, int keyphraseId,
62 in IRecognitionStatusCallback callback);
Dianne Hackborn91097de2014-04-04 18:02:06 -070063}