Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 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 android.service.voice; |
| 18 | |
| 19 | import android.annotation.SdkConstant; |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 20 | import android.app.Service; |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 21 | import android.content.ComponentName; |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 22 | import android.content.Context; |
| 23 | import android.content.Intent; |
Sandeep | d701820 | 2014-07-10 15:15:39 -0700 | [diff] [blame] | 24 | import android.hardware.soundtrigger.KeyphraseEnrollmentInfo; |
Dianne Hackborn | 18f0d35 | 2014-04-25 17:06:18 -0700 | [diff] [blame] | 25 | import android.os.Bundle; |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 26 | import android.os.Handler; |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 27 | import android.os.IBinder; |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 28 | import android.os.Message; |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 29 | import android.os.RemoteException; |
| 30 | import android.os.ServiceManager; |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 31 | import android.provider.Settings; |
Sandeep Siddhartha | 6daae96 | 2014-07-21 10:31:34 -0700 | [diff] [blame] | 32 | |
Sandeep Siddhartha | 2296895 | 2014-06-10 12:32:53 -0700 | [diff] [blame] | 33 | import com.android.internal.annotations.VisibleForTesting; |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 34 | import com.android.internal.app.IVoiceInteractionManagerService; |
| 35 | |
Sandeep Siddhartha | 6df952e | 2014-08-08 15:28:46 -0700 | [diff] [blame] | 36 | import java.io.FileDescriptor; |
| 37 | import java.io.PrintWriter; |
Sandeep Siddhartha | dcf3068 | 2014-08-22 16:36:34 -0700 | [diff] [blame] | 38 | import java.util.Locale; |
Sandeep Siddhartha | 6df952e | 2014-08-08 15:28:46 -0700 | [diff] [blame] | 39 | |
Dianne Hackborn | c03c916 | 2014-05-02 10:45:59 -0700 | [diff] [blame] | 40 | /** |
| 41 | * Top-level service of the current global voice interactor, which is providing |
Dianne Hackborn | 4e106ce | 2015-01-14 15:15:34 -0800 | [diff] [blame] | 42 | * support for hotwording, the back-end of a {@link android.app.VoiceInteractor}, etc. |
Dianne Hackborn | c03c916 | 2014-05-02 10:45:59 -0700 | [diff] [blame] | 43 | * The current VoiceInteractionService that has been selected by the user is kept |
| 44 | * always running by the system, to allow it to do things like listen for hotwords |
Dianne Hackborn | 4e106ce | 2015-01-14 15:15:34 -0800 | [diff] [blame] | 45 | * in the background to instigate voice interactions. |
Dianne Hackborn | c03c916 | 2014-05-02 10:45:59 -0700 | [diff] [blame] | 46 | * |
| 47 | * <p>Because this service is always running, it should be kept as lightweight as |
| 48 | * possible. Heavy-weight operations (including showing UI) should be implemented |
Dianne Hackborn | 4e106ce | 2015-01-14 15:15:34 -0800 | [diff] [blame] | 49 | * in the associated {@link android.service.voice.VoiceInteractionSessionService} when |
| 50 | * an actual voice interaction is taking place, and that service should run in a |
| 51 | * separate process from this one. |
Dianne Hackborn | c03c916 | 2014-05-02 10:45:59 -0700 | [diff] [blame] | 52 | */ |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 53 | public class VoiceInteractionService extends Service { |
| 54 | /** |
| 55 | * The {@link Intent} that must be declared as handled by the service. |
| 56 | * To be supported, the service must also require the |
| 57 | * {@link android.Manifest.permission#BIND_VOICE_INTERACTION} permission so |
| 58 | * that other applications can not abuse it. |
| 59 | */ |
| 60 | @SdkConstant(SdkConstant.SdkConstantType.SERVICE_ACTION) |
| 61 | public static final String SERVICE_INTERFACE = |
| 62 | "android.service.voice.VoiceInteractionService"; |
| 63 | |
| 64 | /** |
| 65 | * Name under which a VoiceInteractionService component publishes information about itself. |
| 66 | * This meta-data should reference an XML resource containing a |
| 67 | * <code><{@link |
| 68 | * android.R.styleable#VoiceInteractionService voice-interaction-service}></code> tag. |
| 69 | */ |
| 70 | public static final String SERVICE_META_DATA = "android.voice_interaction"; |
| 71 | |
| 72 | IVoiceInteractionService mInterface = new IVoiceInteractionService.Stub() { |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 73 | @Override public void ready() { |
| 74 | mHandler.sendEmptyMessage(MSG_READY); |
| 75 | } |
Sandeep Siddhartha | 6daae96 | 2014-07-21 10:31:34 -0700 | [diff] [blame] | 76 | @Override public void shutdown() { |
| 77 | mHandler.sendEmptyMessage(MSG_SHUTDOWN); |
| 78 | } |
| 79 | @Override public void soundModelsChanged() { |
| 80 | mHandler.sendEmptyMessage(MSG_SOUND_MODELS_CHANGED); |
| 81 | } |
Selim Cinek | e70d653 | 2015-04-24 16:46:13 -0700 | [diff] [blame] | 82 | @Override |
| 83 | public void launchVoiceAssistFromKeyguard() throws RemoteException { |
| 84 | mHandler.sendEmptyMessage(MSG_LAUNCH_VOICE_ASSIST_FROM_KEYGUARD); |
| 85 | } |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 86 | }; |
| 87 | |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 88 | MyHandler mHandler; |
| 89 | |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 90 | IVoiceInteractionManagerService mSystemService; |
| 91 | |
Sandeep Siddhartha | 6daae96 | 2014-07-21 10:31:34 -0700 | [diff] [blame] | 92 | private final Object mLock = new Object(); |
| 93 | |
Sandeep Siddhartha | e912ac0 | 2014-06-03 16:29:37 -0700 | [diff] [blame] | 94 | private KeyphraseEnrollmentInfo mKeyphraseEnrollmentInfo; |
| 95 | |
Sandeep Siddhartha | 6daae96 | 2014-07-21 10:31:34 -0700 | [diff] [blame] | 96 | private AlwaysOnHotwordDetector mHotwordDetector; |
| 97 | |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 98 | static final int MSG_READY = 1; |
Sandeep Siddhartha | 6daae96 | 2014-07-21 10:31:34 -0700 | [diff] [blame] | 99 | static final int MSG_SHUTDOWN = 2; |
| 100 | static final int MSG_SOUND_MODELS_CHANGED = 3; |
Selim Cinek | e70d653 | 2015-04-24 16:46:13 -0700 | [diff] [blame] | 101 | static final int MSG_LAUNCH_VOICE_ASSIST_FROM_KEYGUARD = 4; |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 102 | |
| 103 | class MyHandler extends Handler { |
| 104 | @Override |
| 105 | public void handleMessage(Message msg) { |
| 106 | switch (msg.what) { |
| 107 | case MSG_READY: |
| 108 | onReady(); |
| 109 | break; |
Sandeep Siddhartha | 6daae96 | 2014-07-21 10:31:34 -0700 | [diff] [blame] | 110 | case MSG_SHUTDOWN: |
| 111 | onShutdownInternal(); |
| 112 | break; |
| 113 | case MSG_SOUND_MODELS_CHANGED: |
| 114 | onSoundModelsChangedInternal(); |
| 115 | break; |
Selim Cinek | e70d653 | 2015-04-24 16:46:13 -0700 | [diff] [blame] | 116 | case MSG_LAUNCH_VOICE_ASSIST_FROM_KEYGUARD: |
| 117 | onLaunchVoiceAssistFromKeyguard(); |
| 118 | break; |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 119 | default: |
| 120 | super.handleMessage(msg); |
| 121 | } |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | /** |
Selim Cinek | e70d653 | 2015-04-24 16:46:13 -0700 | [diff] [blame] | 126 | * Called when a user has activated an affordance to launch voice assist from the Keyguard. |
| 127 | * |
| 128 | * <p>This method will only be called if the VoiceInteractionService has set |
| 129 | * {@link android.R.attr#supportsLaunchVoiceAssistFromKeyguard} and the Keyguard is showing.</p> |
| 130 | * |
| 131 | * <p>A valid implementation must start a new activity that should use {@link |
| 132 | * android.view.WindowManager.LayoutParams#FLAG_SHOW_WHEN_LOCKED} to display |
| 133 | * on top of the lock screen.</p> |
| 134 | */ |
| 135 | public void onLaunchVoiceAssistFromKeyguard() { |
| 136 | } |
| 137 | |
| 138 | /** |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 139 | * Check whether the given service component is the currently active |
| 140 | * VoiceInteractionService. |
| 141 | */ |
| 142 | public static boolean isActiveService(Context context, ComponentName service) { |
| 143 | String cur = Settings.Secure.getString(context.getContentResolver(), |
| 144 | Settings.Secure.VOICE_INTERACTION_SERVICE); |
| 145 | if (cur == null || cur.isEmpty()) { |
| 146 | return false; |
| 147 | } |
| 148 | ComponentName curComp = ComponentName.unflattenFromString(cur); |
| 149 | if (curComp == null) { |
| 150 | return false; |
| 151 | } |
Barnaby James | e2c020a4 | 2014-08-11 15:13:42 -0700 | [diff] [blame] | 152 | return curComp.equals(service); |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 153 | } |
| 154 | |
| 155 | /** |
Dianne Hackborn | 1de1186 | 2015-07-15 14:20:51 -0700 | [diff] [blame] | 156 | * Set contextual options you would always like to have disabled when a session |
| 157 | * is shown. The flags may be any combination of |
| 158 | * {@link VoiceInteractionSession#SHOW_WITH_ASSIST VoiceInteractionSession.SHOW_WITH_ASSIST} and |
| 159 | * {@link VoiceInteractionSession#SHOW_WITH_SCREENSHOT |
| 160 | * VoiceInteractionSession.SHOW_WITH_SCREENSHOT}. |
| 161 | */ |
| 162 | public void setDisabledShowContext(int flags) { |
| 163 | try { |
| 164 | mSystemService.setDisabledShowContext(flags); |
| 165 | } catch (RemoteException e) { |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | /** |
| 170 | * Return the value set by {@link #setDisabledShowContext}. |
| 171 | */ |
| 172 | public int getDisabledShowContext() { |
| 173 | try { |
| 174 | return mSystemService.getDisabledShowContext(); |
| 175 | } catch (RemoteException e) { |
| 176 | return 0; |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | /** |
Dianne Hackborn | ffeecb1 | 2015-02-25 11:08:11 -0800 | [diff] [blame] | 181 | * Request that the associated {@link android.service.voice.VoiceInteractionSession} be |
| 182 | * shown to the user, starting it if necessary. |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 183 | * @param args Arbitrary arguments that will be propagated to the session. |
Dianne Hackborn | 2ee5c36 | 2015-05-29 17:58:53 -0700 | [diff] [blame] | 184 | * @param flags Indicates additional optional behavior that should be performed. May |
Dianne Hackborn | 1de1186 | 2015-07-15 14:20:51 -0700 | [diff] [blame] | 185 | * be any combination of |
| 186 | * {@link VoiceInteractionSession#SHOW_WITH_ASSIST VoiceInteractionSession.SHOW_WITH_ASSIST} and |
| 187 | * {@link VoiceInteractionSession#SHOW_WITH_SCREENSHOT |
| 188 | * VoiceInteractionSession.SHOW_WITH_SCREENSHOT} |
Dianne Hackborn | 2ee5c36 | 2015-05-29 17:58:53 -0700 | [diff] [blame] | 189 | * to request that the system generate and deliver assist data on the current foreground |
| 190 | * app as part of showing the session UI. |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 191 | */ |
Dianne Hackborn | ffeecb1 | 2015-02-25 11:08:11 -0800 | [diff] [blame] | 192 | public void showSession(Bundle args, int flags) { |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 193 | if (mSystemService == null) { |
| 194 | throw new IllegalStateException("Not available until onReady() is called"); |
| 195 | } |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 196 | try { |
Dianne Hackborn | ffeecb1 | 2015-02-25 11:08:11 -0800 | [diff] [blame] | 197 | mSystemService.showSession(mInterface, args, flags); |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 198 | } catch (RemoteException e) { |
| 199 | } |
| 200 | } |
| 201 | |
| 202 | @Override |
| 203 | public void onCreate() { |
| 204 | super.onCreate(); |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 205 | mHandler = new MyHandler(); |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 206 | } |
| 207 | |
| 208 | @Override |
| 209 | public IBinder onBind(Intent intent) { |
| 210 | if (SERVICE_INTERFACE.equals(intent.getAction())) { |
| 211 | return mInterface.asBinder(); |
| 212 | } |
| 213 | return null; |
| 214 | } |
Sandeep Siddhartha | e912ac0 | 2014-06-03 16:29:37 -0700 | [diff] [blame] | 215 | |
| 216 | /** |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 217 | * Called during service initialization to tell you when the system is ready |
Sandeep Siddhartha | 6daae96 | 2014-07-21 10:31:34 -0700 | [diff] [blame] | 218 | * to receive interaction from it. You should generally do initialization here |
Dianne Hackborn | ffeecb1 | 2015-02-25 11:08:11 -0800 | [diff] [blame] | 219 | * rather than in {@link #onCreate}. Methods such as {@link #showSession} and |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 220 | * {@link #createAlwaysOnHotwordDetector} |
Sandeep Siddhartha | 6daae96 | 2014-07-21 10:31:34 -0700 | [diff] [blame] | 221 | * will not be operational until this point. |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 222 | */ |
| 223 | public void onReady() { |
| 224 | mSystemService = IVoiceInteractionManagerService.Stub.asInterface( |
| 225 | ServiceManager.getService(Context.VOICE_INTERACTION_MANAGER_SERVICE)); |
| 226 | mKeyphraseEnrollmentInfo = new KeyphraseEnrollmentInfo(getPackageManager()); |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 227 | } |
| 228 | |
Sandeep Siddhartha | 6daae96 | 2014-07-21 10:31:34 -0700 | [diff] [blame] | 229 | private void onShutdownInternal() { |
| 230 | onShutdown(); |
| 231 | // Stop any active recognitions when shutting down. |
| 232 | // This ensures that if implementations forget to stop any active recognition, |
| 233 | // It's still guaranteed to have been stopped. |
| 234 | // This helps with cases where the voice interaction implementation is changed |
| 235 | // by the user. |
| 236 | safelyShutdownHotwordDetector(); |
| 237 | } |
| 238 | |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 239 | /** |
Sandeep Siddhartha | 6daae96 | 2014-07-21 10:31:34 -0700 | [diff] [blame] | 240 | * Called during service de-initialization to tell you when the system is shutting the |
| 241 | * service down. |
Sandeep Siddhartha | 5e33fb0 | 2014-08-01 18:09:07 -0700 | [diff] [blame] | 242 | * At this point this service may no longer be the active {@link VoiceInteractionService}. |
Sandeep Siddhartha | 6daae96 | 2014-07-21 10:31:34 -0700 | [diff] [blame] | 243 | */ |
| 244 | public void onShutdown() { |
| 245 | } |
| 246 | |
| 247 | private void onSoundModelsChangedInternal() { |
| 248 | synchronized (this) { |
| 249 | if (mHotwordDetector != null) { |
| 250 | // TODO: Stop recognition if a sound model that was being recognized gets deleted. |
| 251 | mHotwordDetector.onSoundModelsChanged(); |
| 252 | } |
| 253 | } |
Sandeep Siddhartha | 6daae96 | 2014-07-21 10:31:34 -0700 | [diff] [blame] | 254 | } |
| 255 | |
| 256 | /** |
| 257 | * Creates an {@link AlwaysOnHotwordDetector} for the given keyphrase and locale. |
| 258 | * This instance must be retained and used by the client. |
| 259 | * Calling this a second time invalidates the previously created hotword detector |
| 260 | * which can no longer be used to manage recognition. |
| 261 | * |
Sandeep | d701820 | 2014-07-10 15:15:39 -0700 | [diff] [blame] | 262 | * @param keyphrase The keyphrase that's being used, for example "Hello Android". |
| 263 | * @param locale The locale for which the enrollment needs to be performed. |
Sandeep | d701820 | 2014-07-10 15:15:39 -0700 | [diff] [blame] | 264 | * @param callback The callback to notify of detection events. |
Chris Thornton | bf8288c | 2017-05-08 12:38:18 -0700 | [diff] [blame] | 265 | * @return An always-on hotword detector for the given keyphrase and locale. Is null if the |
| 266 | * keyphrase and locale is not supported. |
Sandeep Siddhartha | e912ac0 | 2014-06-03 16:29:37 -0700 | [diff] [blame] | 267 | */ |
Sandeep Siddhartha | 6daae96 | 2014-07-21 10:31:34 -0700 | [diff] [blame] | 268 | public final AlwaysOnHotwordDetector createAlwaysOnHotwordDetector( |
Sandeep Siddhartha | dcf3068 | 2014-08-22 16:36:34 -0700 | [diff] [blame] | 269 | String keyphrase, Locale locale, AlwaysOnHotwordDetector.Callback callback) { |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 270 | if (mSystemService == null) { |
| 271 | throw new IllegalStateException("Not available until onReady() is called"); |
| 272 | } |
Sandeep Siddhartha | 6daae96 | 2014-07-21 10:31:34 -0700 | [diff] [blame] | 273 | synchronized (mLock) { |
| 274 | // Allow only one concurrent recognition via the APIs. |
| 275 | safelyShutdownHotwordDetector(); |
Chris Thornton | bf8288c | 2017-05-08 12:38:18 -0700 | [diff] [blame] | 276 | if (isKeyphraseAndLocaleSupportedForHotword(keyphrase, locale)) { |
| 277 | mHotwordDetector = new AlwaysOnHotwordDetector(keyphrase, locale, callback, |
| 278 | mKeyphraseEnrollmentInfo, mInterface, mSystemService); |
| 279 | } |
Sandeep Siddhartha | 6daae96 | 2014-07-21 10:31:34 -0700 | [diff] [blame] | 280 | } |
| 281 | return mHotwordDetector; |
Sandeep Siddhartha | e912ac0 | 2014-06-03 16:29:37 -0700 | [diff] [blame] | 282 | } |
Sandeep Siddhartha | 2296895 | 2014-06-10 12:32:53 -0700 | [diff] [blame] | 283 | |
| 284 | /** |
| 285 | * @return Details of keyphrases available for enrollment. |
| 286 | * @hide |
| 287 | */ |
| 288 | @VisibleForTesting |
| 289 | protected final KeyphraseEnrollmentInfo getKeyphraseEnrollmentInfo() { |
| 290 | return mKeyphraseEnrollmentInfo; |
| 291 | } |
Sandeep Siddhartha | 6daae96 | 2014-07-21 10:31:34 -0700 | [diff] [blame] | 292 | |
Chris Thornton | bf8288c | 2017-05-08 12:38:18 -0700 | [diff] [blame] | 293 | /** |
| 294 | * Checks if a given keyphrase and locale are supported to create an |
| 295 | * {@link AlwaysOnHotwordDetector}. |
| 296 | * |
| 297 | * @return true if the keyphrase and locale combination is supported, false otherwise. |
| 298 | * @hide |
| 299 | */ |
| 300 | public final boolean isKeyphraseAndLocaleSupportedForHotword(String keyphrase, Locale locale) { |
| 301 | if (mKeyphraseEnrollmentInfo == null) { |
| 302 | return false; |
| 303 | } |
| 304 | return mKeyphraseEnrollmentInfo.getKeyphraseMetadata(keyphrase, locale) != null; |
| 305 | } |
| 306 | |
Sandeep Siddhartha | 6daae96 | 2014-07-21 10:31:34 -0700 | [diff] [blame] | 307 | private void safelyShutdownHotwordDetector() { |
| 308 | try { |
| 309 | synchronized (mLock) { |
| 310 | if (mHotwordDetector != null) { |
| 311 | mHotwordDetector.stopRecognition(); |
| 312 | mHotwordDetector.invalidate(); |
| 313 | mHotwordDetector = null; |
| 314 | } |
| 315 | } |
| 316 | } catch (Exception ex) { |
| 317 | // Ignore. |
| 318 | } |
| 319 | } |
Sandeep Siddhartha | 6df952e | 2014-08-08 15:28:46 -0700 | [diff] [blame] | 320 | |
| 321 | @Override |
| 322 | protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) { |
| 323 | pw.println("VOICE INTERACTION"); |
| 324 | synchronized (mLock) { |
| 325 | pw.println(" AlwaysOnHotwordDetector"); |
| 326 | if (mHotwordDetector == null) { |
| 327 | pw.println(" NULL"); |
| 328 | } else { |
| 329 | mHotwordDetector.dump(" ", pw); |
| 330 | } |
| 331 | } |
| 332 | } |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 333 | } |