OSDN Git Service

DO NOT MERGE. Grant MMS Uri permissions as the calling UID.
[android-x86/frameworks-base.git] / core / java / com / android / internal / app / IVoiceInteractionManagerService.aidl
1 /*
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
17 package com.android.internal.app;
18
19 import android.content.ComponentName;
20 import android.content.Intent;
21 import android.os.Bundle;
22
23 import com.android.internal.app.IVoiceInteractionSessionShowCallback;
24 import com.android.internal.app.IVoiceInteractor;
25 import com.android.internal.app.IVoiceInteractionSessionListener;
26 import android.hardware.soundtrigger.IRecognitionStatusCallback;
27 import android.hardware.soundtrigger.SoundTrigger;
28 import android.service.voice.IVoiceInteractionService;
29 import android.service.voice.IVoiceInteractionSession;
30
31 interface IVoiceInteractionManagerService {
32     void showSession(IVoiceInteractionService service, in Bundle sessionArgs, int flags);
33     boolean deliverNewSession(IBinder token, IVoiceInteractionSession session,
34             IVoiceInteractor interactor);
35     boolean showSessionFromSession(IBinder token, in Bundle sessionArgs, int flags);
36     boolean hideSessionFromSession(IBinder token);
37     int startVoiceActivity(IBinder token, in Intent intent, String resolvedType);
38     void setKeepAwake(IBinder token, boolean keepAwake);
39     void closeSystemDialogs(IBinder token);
40     void finish(IBinder token);
41     void setDisabledShowContext(int flags);
42     int getDisabledShowContext();
43     int getUserDisabledShowContext();
44
45     /**
46      * Gets the registered Sound model for keyphrase detection for the current user.
47      * May be null if no matching sound model exists.
48      *
49      * @param keyphraseId The unique identifier for the keyphrase.
50      * @param bcp47Locale The BCP47 language tag  for the keyphrase's locale.
51      */
52     SoundTrigger.KeyphraseSoundModel getKeyphraseSoundModel(int keyphraseId, in String bcp47Locale);
53     /**
54      * Add/Update the given keyphrase sound model.
55      */
56     int updateKeyphraseSoundModel(in SoundTrigger.KeyphraseSoundModel model);
57     /**
58      * Deletes the given keyphrase sound model for the current user.
59      *
60      * @param keyphraseId The unique identifier for the keyphrase.
61      * @param bcp47Locale The BCP47 language tag  for the keyphrase's locale.
62      */
63     int deleteKeyphraseSoundModel(int keyphraseId, in String bcp47Locale);
64
65     /**
66      * Gets the properties of the DSP hardware on this device, null if not present.
67      */
68     SoundTrigger.ModuleProperties getDspModuleProperties(in IVoiceInteractionService service);
69     /**
70      * Indicates if there's a keyphrase sound model available for the given keyphrase ID.
71      * This performs the check for the current user.
72      *
73      * @param service The current VoiceInteractionService.
74      * @param keyphraseId The unique identifier for the keyphrase.
75      * @param bcp47Locale The BCP47 language tag  for the keyphrase's locale.
76      */
77     boolean isEnrolledForKeyphrase(IVoiceInteractionService service, int keyphraseId,
78             String bcp47Locale);
79     /**
80      * Starts a recognition for the given keyphrase.
81      */
82     int startRecognition(in IVoiceInteractionService service, int keyphraseId,
83             in String bcp47Locale, in IRecognitionStatusCallback callback,
84             in SoundTrigger.RecognitionConfig recognitionConfig);
85     /**
86      * Stops a recognition for the given keyphrase.
87      */
88     int stopRecognition(in IVoiceInteractionService service, int keyphraseId,
89             in IRecognitionStatusCallback callback);
90
91     /**
92      * @return the component name for the currently active voice interaction service
93      */
94     ComponentName getActiveServiceComponentName();
95
96     /**
97      * Shows the session for the currently active service. Used to start a new session from system
98      * affordances.
99      *
100      * @param args the bundle to pass as arguments to the voice interaction session
101      * @param sourceFlags flags indicating the source of this show
102      * @param showCallback optional callback to be notified when the session was shown
103      * @param activityToken optional token of activity that needs to be on top
104      */
105     boolean showSessionForActiveService(in Bundle args, int sourceFlags,
106             IVoiceInteractionSessionShowCallback showCallback, IBinder activityToken);
107
108     /**
109      * Hides the session from the active service, if it is showing.
110      */
111     void hideCurrentSession();
112
113     /**
114      * Notifies the active service that a launch was requested from the Keyguard. This will only
115      * be called if {@link #activeServiceSupportsLaunchFromKeyguard()} returns true.
116      */
117     void launchVoiceAssistFromKeyguard();
118
119     /**
120      * Indicates whether there is a voice session running (but not necessarily showing).
121      */
122     boolean isSessionRunning();
123
124     /**
125      * Indicates whether the currently active voice interaction service is capable of handling the
126      * assist gesture.
127      */
128     boolean activeServiceSupportsAssist();
129
130     /**
131      * Indicates whether the currently active voice interaction service is capable of being launched
132      * from the lockscreen.
133      */
134     boolean activeServiceSupportsLaunchFromKeyguard();
135
136     /**
137      * Called when the lockscreen got shown.
138      */
139     void onLockscreenShown();
140
141     /**
142      * Register a voice interaction listener.
143      */
144     void registerVoiceInteractionSessionListener(IVoiceInteractionSessionListener listener);
145 }