| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.speech; |
| 18 |
|
| 19 |
import android.Manifest; |
| 20 |
import android.annotation.NonNull; |
| 21 |
import android.annotation.Nullable; |
| 22 |
import android.annotation.SdkConstant; |
| 23 |
import android.annotation.SdkConstant.SdkConstantType; |
| 24 |
import android.annotation.SuppressLint; |
| 25 |
import android.app.AppOpsManager; |
| 26 |
import android.app.Service; |
| 27 |
import android.content.AttributionSource; |
| 28 |
import android.content.Context; |
| 29 |
import android.content.ContextParams; |
| 30 |
import android.content.Intent; |
| 31 |
import android.content.PermissionChecker; |
| 32 |
import android.os.Binder; |
| 33 |
import android.os.Bundle; |
| 34 |
import android.os.Handler; |
| 35 |
import android.os.IBinder; |
| 36 |
import android.os.Looper; |
| 37 |
import android.os.Message; |
| 38 |
import android.os.RemoteException; |
| 39 |
import android.util.Log; |
| 40 |
import android.util.Pair; |
| 41 |
|
| 42 |
import com.android.internal.util.function.pooled.PooledLambda; |
| 43 |
|
| 44 |
import java.lang.ref.WeakReference; |
| 45 |
import java.util.Objects; |
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
public abstract class RecognitionService extends Service { |
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
@SdkConstant(SdkConstantType.SERVICE_ACTION) |
| 57 |
public static final String SERVICE_INTERFACE = "android.speech.RecognitionService"; |
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
public static final String SERVICE_META_DATA = "android.speech"; |
| 67 |
|
| 68 |
|
| 69 |
private static final String TAG = "RecognitionService"; |
| 70 |
|
| 71 |
|
| 72 |
private static final boolean DBG = false; |
| 73 |
|
| 74 |
|
| 75 |
private RecognitionServiceBinder mBinder = new RecognitionServiceBinder(this); |
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
private Callback mCurrentCallback = null; |
| 83 |
|
| 84 |
private boolean mStartedDataDelivery; |
| 85 |
|
| 86 |
private static final int MSG_START_LISTENING = 1; |
| 87 |
|
| 88 |
private static final int MSG_STOP_LISTENING = 2; |
| 89 |
|
| 90 |
private static final int MSG_CANCEL = 3; |
| 91 |
|
| 92 |
private static final int MSG_RESET = 4; |
| 93 |
|
| 94 |
private static final int MSG_CHECK_RECOGNITION_SUPPORT = 5; |
| 95 |
|
| 96 |
private static final int MSG_TRIGGER_MODEL_DOWNLOAD = 6; |
| 97 |
|
| 98 |
private final Handler mHandler = new Handler() { |
| 99 |
@Override |
| 100 |
public void handleMessage(Message msg) { |
| 101 |
switch (msg.what) { |
| 102 |
case MSG_START_LISTENING: |
| 103 |
StartListeningArgs args = (StartListeningArgs) msg.obj; |
| 104 |
dispatchStartListening(args.mIntent, args.mListener, args.mAttributionSource); |
| 105 |
break; |
| 106 |
case MSG_STOP_LISTENING: |
| 107 |
dispatchStopListening((IRecognitionListener) msg.obj); |
| 108 |
break; |
| 109 |
case MSG_CANCEL: |
| 110 |
dispatchCancel((IRecognitionListener) msg.obj); |
| 111 |
break; |
| 112 |
case MSG_RESET: |
| 113 |
dispatchClearCallback(); |
| 114 |
break; |
| 115 |
case MSG_CHECK_RECOGNITION_SUPPORT: |
| 116 |
Pair<Intent, IRecognitionSupportCallback> intentAndListener = |
| 117 |
(Pair<Intent, IRecognitionSupportCallback>) msg.obj; |
| 118 |
dispatchCheckRecognitionSupport( |
| 119 |
intentAndListener.first, intentAndListener.second); |
| 120 |
break; |
| 121 |
case MSG_TRIGGER_MODEL_DOWNLOAD: |
| 122 |
dispatchTriggerModelDownload((Intent) msg.obj); |
| 123 |
break; |
| 124 |
} |
| 125 |
} |
| 126 |
}; |
| 127 |
|
| 128 |
private void dispatchStartListening(Intent intent, final IRecognitionListener listener, |
| 129 |
@NonNull AttributionSource attributionSource) { |
| 130 |
try { |
| 131 |
if (mCurrentCallback == null) { |
| 132 |
boolean preflightPermissionCheckPassed = |
| 133 |
intent.hasExtra(RecognizerIntent.EXTRA_AUDIO_SOURCE) |
| 134 |
|| checkPermissionForPreflightNotHardDenied(attributionSource); |
| 135 |
if (preflightPermissionCheckPassed) { |
| 136 |
if (DBG) { |
| 137 |
Log.d(TAG, "created new mCurrentCallback, listener = " |
| 138 |
+ listener.asBinder()); |
| 139 |
} |
| 140 |
mCurrentCallback = new Callback(listener, attributionSource); |
| 141 |
RecognitionService.this.onStartListening(intent, mCurrentCallback); |
| 142 |
} |
| 143 |
|
| 144 |
if (!preflightPermissionCheckPassed || !checkPermissionAndStartDataDelivery()) { |
| 145 |
listener.onError(SpeechRecognizer.ERROR_INSUFFICIENT_PERMISSIONS); |
| 146 |
if (preflightPermissionCheckPassed) { |
| 147 |
|
| 148 |
RecognitionService.this.onCancel(mCurrentCallback); |
| 149 |
dispatchClearCallback(); |
| 150 |
} |
| 151 |
Log.i(TAG, "caller doesn't have permission:" |
| 152 |
+ Manifest.permission.RECORD_AUDIO); |
| 153 |
} |
| 154 |
} else { |
| 155 |
listener.onError(SpeechRecognizer.ERROR_RECOGNIZER_BUSY); |
| 156 |
Log.i(TAG, "concurrent startListening received - ignoring this call"); |
| 157 |
} |
| 158 |
} catch (RemoteException e) { |
| 159 |
Log.d(TAG, "onError call from startListening failed"); |
| 160 |
} |
| 161 |
} |
| 162 |
|
| 163 |
private void dispatchStopListening(IRecognitionListener listener) { |
| 164 |
try { |
| 165 |
if (mCurrentCallback == null) { |
| 166 |
listener.onError(SpeechRecognizer.ERROR_CLIENT); |
| 167 |
Log.w(TAG, "stopListening called with no preceding startListening - ignoring"); |
| 168 |
} else if (mCurrentCallback.mListener.asBinder() != listener.asBinder()) { |
| 169 |
listener.onError(SpeechRecognizer.ERROR_RECOGNIZER_BUSY); |
| 170 |
Log.w(TAG, "stopListening called by other caller than startListening - ignoring"); |
| 171 |
} else { |
| 172 |
RecognitionService.this.onStopListening(mCurrentCallback); |
| 173 |
} |
| 174 |
} catch (RemoteException e) { |
| 175 |
Log.d(TAG, "onError call from stopListening failed"); |
| 176 |
} |
| 177 |
} |
| 178 |
|
| 179 |
private void dispatchCancel(IRecognitionListener listener) { |
| 180 |
if (mCurrentCallback == null) { |
| 181 |
if (DBG) Log.d(TAG, "cancel called with no preceding startListening - ignoring"); |
| 182 |
} else if (mCurrentCallback.mListener.asBinder() != listener.asBinder()) { |
| 183 |
Log.w(TAG, "cancel called by client who did not call startListening - ignoring"); |
| 184 |
} else { |
| 185 |
RecognitionService.this.onCancel(mCurrentCallback); |
| 186 |
dispatchClearCallback(); |
| 187 |
if (DBG) Log.d(TAG, "canceling - setting mCurrentCallback to null"); |
| 188 |
} |
| 189 |
} |
| 190 |
|
| 191 |
private void dispatchClearCallback() { |
| 192 |
finishDataDelivery(); |
| 193 |
mCurrentCallback = null; |
| 194 |
mStartedDataDelivery = false; |
| 195 |
} |
| 196 |
|
| 197 |
private void dispatchCheckRecognitionSupport( |
| 198 |
Intent intent, IRecognitionSupportCallback callback) { |
| 199 |
RecognitionService.this.onCheckRecognitionSupport(intent, new SupportCallback(callback)); |
| 200 |
} |
| 201 |
|
| 202 |
private void dispatchTriggerModelDownload(Intent intent) { |
| 203 |
RecognitionService.this.onTriggerModelDownload(intent); |
| 204 |
} |
| 205 |
|
| 206 |
private class StartListeningArgs { |
| 207 |
public final Intent mIntent; |
| 208 |
|
| 209 |
public final IRecognitionListener mListener; |
| 210 |
public final @NonNull AttributionSource mAttributionSource; |
| 211 |
|
| 212 |
public StartListeningArgs(Intent intent, IRecognitionListener listener, |
| 213 |
@NonNull AttributionSource attributionSource) { |
| 214 |
this.mIntent = intent; |
| 215 |
this.mListener = listener; |
| 216 |
this.mAttributionSource = attributionSource; |
| 217 |
} |
| 218 |
} |
| 219 |
|
| 220 |
|
| 221 |
|
| 222 |
|
| 223 |
|
| 224 |
|
| 225 |
|
| 226 |
|
| 227 |
|
| 228 |
|
| 229 |
|
| 230 |
|
| 231 |
|
| 232 |
|
| 233 |
|
| 234 |
|
| 235 |
|
| 236 |
|
| 237 |
|
| 238 |
|
| 239 |
|
| 240 |
|
| 241 |
|
| 242 |
|
| 243 |
|
| 244 |
|
| 245 |
|
| 246 |
|
| 247 |
|
| 248 |
|
| 249 |
|
| 250 |
|
| 251 |
protected abstract void onStartListening(Intent recognizerIntent, Callback listener); |
| 252 |
|
| 253 |
|
| 254 |
|
| 255 |
|
| 256 |
protected abstract void onCancel(Callback listener); |
| 257 |
|
| 258 |
|
| 259 |
|
| 260 |
|
| 261 |
|
| 262 |
|
| 263 |
protected abstract void onStopListening(Callback listener); |
| 264 |
|
| 265 |
|
| 266 |
|
| 267 |
|
| 268 |
|
| 269 |
|
| 270 |
|
| 271 |
|
| 272 |
|
| 273 |
|
| 274 |
|
| 275 |
public void onCheckRecognitionSupport( |
| 276 |
@NonNull Intent recognizerIntent, |
| 277 |
@NonNull SupportCallback supportCallback) { |
| 278 |
if (DBG) { |
| 279 |
Log.i(TAG, String.format("#onSupports [%s]", recognizerIntent)); |
| 280 |
} |
| 281 |
supportCallback.onError(SpeechRecognizer.ERROR_CANNOT_CHECK_SUPPORT); |
| 282 |
} |
| 283 |
|
| 284 |
|
| 285 |
|
| 286 |
|
| 287 |
public void onTriggerModelDownload(@NonNull Intent recognizerIntent) { |
| 288 |
if (DBG) { |
| 289 |
Log.i(TAG, String.format("#downloadModel [%s]", recognizerIntent)); |
| 290 |
} |
| 291 |
} |
| 292 |
|
| 293 |
@Override |
| 294 |
@SuppressLint("MissingNullability") |
| 295 |
public Context createContext(@NonNull ContextParams contextParams) { |
| 296 |
if (contextParams.getNextAttributionSource() != null) { |
| 297 |
if (mHandler.getLooper().equals(Looper.myLooper())) { |
| 298 |
handleAttributionContextCreation(contextParams.getNextAttributionSource()); |
| 299 |
} else { |
| 300 |
mHandler.sendMessage( |
| 301 |
PooledLambda.obtainMessage(this::handleAttributionContextCreation, |
| 302 |
contextParams.getNextAttributionSource())); |
| 303 |
} |
| 304 |
} |
| 305 |
return super.createContext(contextParams); |
| 306 |
} |
| 307 |
|
| 308 |
private void handleAttributionContextCreation(@NonNull AttributionSource attributionSource) { |
| 309 |
if (mCurrentCallback != null |
| 310 |
&& mCurrentCallback.mCallingAttributionSource.equals(attributionSource)) { |
| 311 |
mCurrentCallback.mAttributionContextCreated = true; |
| 312 |
} |
| 313 |
} |
| 314 |
|
| 315 |
@Override |
| 316 |
public final IBinder onBind(final Intent intent) { |
| 317 |
if (DBG) Log.d(TAG, "onBind, intent=" + intent); |
| 318 |
return mBinder; |
| 319 |
} |
| 320 |
|
| 321 |
@Override |
| 322 |
public void onDestroy() { |
| 323 |
if (DBG) Log.d(TAG, "onDestroy"); |
| 324 |
finishDataDelivery(); |
| 325 |
mCurrentCallback = null; |
| 326 |
mBinder.clearReference(); |
| 327 |
super.onDestroy(); |
| 328 |
} |
| 329 |
|
| 330 |
|
| 331 |
|
| 332 |
|
| 333 |
|
| 334 |
|
| 335 |
|
| 336 |
public class Callback { |
| 337 |
private final IRecognitionListener mListener; |
| 338 |
private final @NonNull AttributionSource mCallingAttributionSource; |
| 339 |
private @Nullable Context mAttributionContext; |
| 340 |
private boolean mAttributionContextCreated; |
| 341 |
|
| 342 |
private Callback(IRecognitionListener listener, |
| 343 |
@NonNull AttributionSource attributionSource) { |
| 344 |
mListener = listener; |
| 345 |
mCallingAttributionSource = attributionSource; |
| 346 |
} |
| 347 |
|
| 348 |
|
| 349 |
|
| 350 |
|
| 351 |
public void beginningOfSpeech() throws RemoteException { |
| 352 |
mListener.onBeginningOfSpeech(); |
| 353 |
} |
| 354 |
|
| 355 |
|
| 356 |
|
| 357 |
|
| 358 |
|
| 359 |
|
| 360 |
|
| 361 |
|
| 362 |
public void bufferReceived(byte[] buffer) throws RemoteException { |
| 363 |
mListener.onBufferReceived(buffer); |
| 364 |
} |
| 365 |
|
| 366 |
|
| 367 |
|
| 368 |
|
| 369 |
public void endOfSpeech() throws RemoteException { |
| 370 |
mListener.onEndOfSpeech(); |
| 371 |
} |
| 372 |
|
| 373 |
|
| 374 |
|
| 375 |
|
| 376 |
|
| 377 |
|
| 378 |
public void error(@SpeechRecognizer.RecognitionError int error) throws RemoteException { |
| 379 |
Message.obtain(mHandler, MSG_RESET).sendToTarget(); |
| 380 |
mListener.onError(error); |
| 381 |
} |
| 382 |
|
| 383 |
|
| 384 |
|
| 385 |
|
| 386 |
|
| 387 |
|
| 388 |
|
| 389 |
|
| 390 |
|
| 391 |
|
| 392 |
|
| 393 |
|
| 394 |
public void partialResults(Bundle partialResults) throws RemoteException { |
| 395 |
mListener.onPartialResults(partialResults); |
| 396 |
} |
| 397 |
|
| 398 |
|
| 399 |
|
| 400 |
|
| 401 |
|
| 402 |
|
| 403 |
|
| 404 |
public void readyForSpeech(Bundle params) throws RemoteException { |
| 405 |
mListener.onReadyForSpeech(params); |
| 406 |
} |
| 407 |
|
| 408 |
|
| 409 |
|
| 410 |
|
| 411 |
|
| 412 |
|
| 413 |
|
| 414 |
|
| 415 |
public void results(Bundle results) throws RemoteException { |
| 416 |
Message.obtain(mHandler, MSG_RESET).sendToTarget(); |
| 417 |
mListener.onResults(results); |
| 418 |
} |
| 419 |
|
| 420 |
|
| 421 |
|
| 422 |
|
| 423 |
|
| 424 |
|
| 425 |
|
| 426 |
public void rmsChanged(float rmsdB) throws RemoteException { |
| 427 |
mListener.onRmsChanged(rmsdB); |
| 428 |
} |
| 429 |
|
| 430 |
|
| 431 |
|
| 432 |
|
| 433 |
|
| 434 |
|
| 435 |
|
| 436 |
|
| 437 |
@SuppressLint({"CallbackMethodName", "RethrowRemoteException"}) |
| 438 |
public void segmentResults(@NonNull Bundle results) throws RemoteException { |
| 439 |
mListener.onSegmentResults(results); |
| 440 |
} |
| 441 |
|
| 442 |
|
| 443 |
|
| 444 |
|
| 445 |
@SuppressLint({"CallbackMethodName", "RethrowRemoteException"}) |
| 446 |
public void endOfSegmentedSession() throws RemoteException { |
| 447 |
Message.obtain(mHandler, MSG_RESET).sendToTarget(); |
| 448 |
mListener.onEndOfSegmentedSession(); |
| 449 |
} |
| 450 |
|
| 451 |
|
| 452 |
|
| 453 |
|
| 454 |
|
| 455 |
public int getCallingUid() { |
| 456 |
return mCallingAttributionSource.getUid(); |
| 457 |
} |
| 458 |
|
| 459 |
|
| 460 |
|
| 461 |
|
| 462 |
|
| 463 |
|
| 464 |
|
| 465 |
|
| 466 |
|
| 467 |
|
| 468 |
|
| 469 |
|
| 470 |
|
| 471 |
@SuppressLint("CallbackMethodName") |
| 472 |
public @NonNull AttributionSource getCallingAttributionSource() { |
| 473 |
return mCallingAttributionSource; |
| 474 |
} |
| 475 |
|
| 476 |
@NonNull Context getAttributionContextForCaller() { |
| 477 |
if (mAttributionContext == null) { |
| 478 |
mAttributionContext = createContext(new ContextParams.Builder() |
| 479 |
.setNextAttributionSource(mCallingAttributionSource) |
| 480 |
.build()); |
| 481 |
} |
| 482 |
return mAttributionContext; |
| 483 |
} |
| 484 |
} |
| 485 |
|
| 486 |
|
| 487 |
|
| 488 |
|
| 489 |
|
| 490 |
|
| 491 |
|
| 492 |
public static class SupportCallback { |
| 493 |
|
| 494 |
private final IRecognitionSupportCallback mCallback; |
| 495 |
|
| 496 |
private SupportCallback(IRecognitionSupportCallback callback) { |
| 497 |
this.mCallback = callback; |
| 498 |
} |
| 499 |
|
| 500 |
|
| 501 |
public void onSupportResult(@NonNull RecognitionSupport recognitionSupport) { |
| 502 |
try { |
| 503 |
mCallback.onSupportResult(recognitionSupport); |
| 504 |
} catch (RemoteException e) { |
| 505 |
throw e.rethrowFromSystemServer(); |
| 506 |
} |
| 507 |
} |
| 508 |
|
| 509 |
|
| 510 |
|
| 511 |
|
| 512 |
|
| 513 |
|
| 514 |
|
| 515 |
public void onError(@SpeechRecognizer.RecognitionError int errorCode) { |
| 516 |
try { |
| 517 |
mCallback.onError(errorCode); |
| 518 |
} catch (RemoteException e) { |
| 519 |
throw e.rethrowFromSystemServer(); |
| 520 |
} |
| 521 |
} |
| 522 |
} |
| 523 |
|
| 524 |
|
| 525 |
private static final class RecognitionServiceBinder extends IRecognitionService.Stub { |
| 526 |
private final WeakReference<RecognitionService> mServiceRef; |
| 527 |
|
| 528 |
public RecognitionServiceBinder(RecognitionService service) { |
| 529 |
mServiceRef = new WeakReference<>(service); |
| 530 |
} |
| 531 |
|
| 532 |
@Override |
| 533 |
public void startListening(Intent recognizerIntent, IRecognitionListener listener, |
| 534 |
@NonNull AttributionSource attributionSource) { |
| 535 |
Objects.requireNonNull(attributionSource); |
| 536 |
attributionSource.enforceCallingUid(); |
| 537 |
if (DBG) Log.d(TAG, "startListening called by:" + listener.asBinder()); |
| 538 |
final RecognitionService service = mServiceRef.get(); |
| 539 |
if (service != null) { |
| 540 |
service.mHandler.sendMessage(Message.obtain(service.mHandler, |
| 541 |
MSG_START_LISTENING, service.new StartListeningArgs( |
| 542 |
recognizerIntent, listener, attributionSource))); |
| 543 |
} |
| 544 |
} |
| 545 |
|
| 546 |
@Override |
| 547 |
public void stopListening(IRecognitionListener listener) { |
| 548 |
if (DBG) Log.d(TAG, "stopListening called by:" + listener.asBinder()); |
| 549 |
final RecognitionService service = mServiceRef.get(); |
| 550 |
if (service != null) { |
| 551 |
service.mHandler.sendMessage( |
| 552 |
Message.obtain(service.mHandler, MSG_STOP_LISTENING, listener)); |
| 553 |
} |
| 554 |
} |
| 555 |
|
| 556 |
@Override |
| 557 |
public void cancel(IRecognitionListener listener, boolean isShutdown) { |
| 558 |
if (DBG) Log.d(TAG, "cancel called by:" + listener.asBinder()); |
| 559 |
final RecognitionService service = mServiceRef.get(); |
| 560 |
if (service != null) { |
| 561 |
service.mHandler.sendMessage( |
| 562 |
Message.obtain(service.mHandler, MSG_CANCEL, listener)); |
| 563 |
} |
| 564 |
} |
| 565 |
|
| 566 |
@Override |
| 567 |
public void checkRecognitionSupport( |
| 568 |
Intent recognizerIntent, IRecognitionSupportCallback callback) { |
| 569 |
final RecognitionService service = mServiceRef.get(); |
| 570 |
if (service != null) { |
| 571 |
service.mHandler.sendMessage( |
| 572 |
Message.obtain(service.mHandler, MSG_CHECK_RECOGNITION_SUPPORT, |
| 573 |
Pair.create(recognizerIntent, callback))); |
| 574 |
} |
| 575 |
} |
| 576 |
|
| 577 |
@Override |
| 578 |
public void triggerModelDownload(Intent recognizerIntent) { |
| 579 |
final RecognitionService service = mServiceRef.get(); |
| 580 |
if (service != null) { |
| 581 |
service.mHandler.sendMessage( |
| 582 |
Message.obtain( |
| 583 |
service.mHandler, MSG_TRIGGER_MODEL_DOWNLOAD, recognizerIntent)); |
| 584 |
} |
| 585 |
} |
| 586 |
|
| 587 |
public void clearReference() { |
| 588 |
mServiceRef.clear(); |
| 589 |
} |
| 590 |
} |
| 591 |
|
| 592 |
private boolean checkPermissionAndStartDataDelivery() { |
| 593 |
if (mCurrentCallback.mAttributionContextCreated) { |
| 594 |
return true; |
| 595 |
} |
| 596 |
if (PermissionChecker.checkPermissionAndStartDataDelivery( |
| 597 |
RecognitionService.this, Manifest.permission.RECORD_AUDIO, |
| 598 |
mCurrentCallback.getAttributionContextForCaller().getAttributionSource(), |
| 599 |
null) == PermissionChecker.PERMISSION_GRANTED) { |
| 600 |
mStartedDataDelivery = true; |
| 601 |
} |
| 602 |
return mStartedDataDelivery; |
| 603 |
} |
| 604 |
|
| 605 |
private boolean checkPermissionForPreflightNotHardDenied(AttributionSource attributionSource) { |
| 606 |
int result = PermissionChecker.checkPermissionForPreflight(RecognitionService.this, |
| 607 |
Manifest.permission.RECORD_AUDIO, attributionSource); |
| 608 |
return result == PermissionChecker.PERMISSION_GRANTED |
| 609 |
|| result == PermissionChecker.PERMISSION_SOFT_DENIED; |
| 610 |
} |
| 611 |
|
| 612 |
void finishDataDelivery() { |
| 613 |
if (mStartedDataDelivery) { |
| 614 |
mStartedDataDelivery = false; |
| 615 |
final String op = AppOpsManager.permissionToOp(Manifest.permission.RECORD_AUDIO); |
| 616 |
PermissionChecker.finishDataDelivery(RecognitionService.this, op, |
| 617 |
mCurrentCallback.getAttributionContextForCaller().getAttributionSource()); |
| 618 |
} |
| 619 |
} |
| 620 |
} |