microg / microg/GmsCore

[com.waze] Waze appears to hang when using speech recognition without a working Google Assistant

Open
#1,958 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
14.6k
Forks
3.2k
Avg merge
12d 11h
Merged PRs (30d)
4

Description

Affected app
Name: Waze
Package id: com.waze

Describe the bug
The speech recognition feature Waze offers ("red microphone" in the main screen) causes the app to appear to hang, due to it no longer accepting input, although this can be remedied by pressing Back (which is non-obvious). In any case, speech recognition does not take place, and an exception is logged.

To Reproduce
Steps to reproduce the behavior:

  1. Open Waze and set it up if not yet done
  2. Click on the red microphone
  3. Either say something, or try to interact with the app
  4. Observe lack of any response, press Back to be able to interact again

Expected behavior
Waze should either interpret the user's speech, with a dialog showing that it's doing that, or it should display an error, if any required packages to enable that functionality aren't present.

System
Android Version: 13
Custom ROM: LineageOS 20 (Oneplus 8T) and CalyxOS 4.10.0 (Pixel 6a)

microG
microG Core version: 0.2.27.223616-39 (9803dc4)
microG Self-Check results: all ticked

Additional context
From my own observations based on logcat, and from this bug filed against CalyxOS (which includes my observations), Waze does a few possibly relevant things:

  • tries to access com.google.android.apps.speechservices, which is not actually the package name of the Speech Services by Google (which is com.google.android.tts)
  • attempts to invoke Google Assistant, or at least load its configuration, which causes an exception.

I have logged the exception and its surrounding, from the Pixel 6a, as follows:

06-15 20:08:21.158   913   938 D GnssAidl: Gnss::injectLocation
06-15 20:08:21.391  1760  1774 I native  : I0000 00:00:1686852501.391611    1774 tf_lite_classifier.cc:383] Event stream classified as kNone
06-15 20:08:21.393 12232 12369 W spdlog  : [20:08:21.393 (world_z7r1fg9g) (0x0000000) 12279 12232 warning] STAT(buffer#1) VOICE_SEARCH {LANGUAGE|AUTO_SELECTED=it-IT|true}{TIMESTAMP_MS=1686852501393}{TIMESTAMP=1686852501}
06-15 20:08:21.393 12232 12369 W spdlog  :  [java:0 ()]
06-15 20:08:21.394  1471 15243 I ActivityTaskManager: START u0 {cmp=com.waze/.google_assistant.SpeechRecognizerActivity (has extras)} from uid 10261
06-15 20:08:21.407 12232 12369 W spdlog  : [20:08:21.407 (world_z7r1fg9g) (0x0000000) 12279 12232 warning] STAT(buffer#1) START_STATE_DRAWER_CLICKED {WHILE_ROAMING|TOTAL_CARDS|ACTION=false|0|VOICE_SEARCH}{TIMESTAMP_MS=1686852501407}{TIMESTAMP=1686852501}
06-15 20:08:21.407 12232 12369 W spdlog  :  [java:0 ()]
06-15 20:08:21.412 12232 12232 W WAZE    : MapView onPause
06-15 20:08:21.412 12232 12232 D WAZE NTV RENDERER: onViewSurfaceDestroyed: [ Main Canvas ]. Event:  UISurfaceEvent. Type: CREATED. Frame id: 10 
06-15 20:08:21.412 12232 12279 D WAZE NTV RENDERER: Going to run destroy event. Created: true
06-15 20:08:21.412 12232 12369 W spdlog  : [20:08:21.412 (world_z7r1fg9g) (0x0000000) 12279 12232 warning] STAT(buffer#1) FRAME_RENDER_TIME_ABOVE_THRESHOLD {THRESHOLD=32}{TIME_AVG=2}{FRAMES_ABOVE_THRESHOLD=0}{TIME_MIN=0}{TIME_MAX=26}{TOTAL_FRAMES=278}{CANVAS_TAG=Main Canvas}{MEASURE_TIME_MSEC=23708}{TIMESTAMP_MS=1686852501412}{TIMESTAMP=1686852501}
06-15 20:08:21.412 12232 12369 W spdlog  :  [analytics_service.cc:29 (Send)]
06-15 20:08:21.416 12232 12279 D WAZE NTV RENDERER: Finished to run destroy event
06-15 20:08:21.416 12232 12232 D WAZE NTV RENDERER: Finished onViewSurfaceDestroyed
06-15 20:08:21.417  5173  5173 D MeasurementService: onBind: Intent { act=com.google.android.gms.measurement.START pkg=com.google.android.gms }
06-15 20:08:21.417  1471 11542 W ProcessStats: Tracking association SourceState{8e11260 system/1000 BTopFgs #44908} whose proc state 2 is better than process ProcessState{2df7afa ryey.easer/10174 pkg=ryey.easer} proc state 3 (144 skipped)
06-15 20:08:21.421  1471 11542 W ActivityTaskManager: Tried to set launchTime (0) < mLastActivityLaunchTime (29171345)
06-15 20:08:21.426 12232 12369 W spdlog  : [20:08:21.426 (world_z7r1fg9g) (0x0000000) 12279 12232 warning] Package not found: com.google.android.apps.speechservices [:0 ()]

# First clue something is wrong: the Speech Services application I have installed has package name com.google.android.tts and not com.google.android.apps.speechservices and I don't actually know which app that is, also considering https://play.google.com/store/apps/details?id=com.google.android.apps.speechservices is a 404.

06-15 20:08:21.432  1471 11542 D CoreBackPreview: Window{7b90666 u0 com.waze/com.waze.google_assistant.SpeechRecognizerActivity}: Setting back callback OnBackInvokedCallbackInfo{mCallback=android.window.IOnBackInvokedCallback$Stub$Proxy@5251254, mPriority=0}
06-15 20:08:21.432  5173 16773 D MeasurementService: bound by: GetServiceRequest{serviceId=MEASUREMENT, gmsVersion=12451000, packageName='com.waze', extras=Bundle[{}]}
06-15 20:08:21.443  1471  1600 I ActivityTaskManager: Displayed com.waze/.google_assistant.SpeechRecognizerActivity: +48ms

# It might rightly think it has displayed it, since pressing Back makes the screen refresh and the app respond to touch again; but nothing was ever displayed.

06-15 20:08:21.447  5173 16773 D SafeParcel: Unknown field id 26 in com.google.android.gms.measurement.internal.AppMetadata, skipping.
06-15 20:08:21.447  5173 16773 D SafeParcel: Unknown field id 27 in com.google.android.gms.measurement.internal.AppMetadata, skipping.
06-15 20:08:21.447  5173 16773 D MeasurementService: f1(com.google.android.gms.measurement.internal.EventParcel@a73864f) for AppMetadata[com.waze]
06-15 20:08:21.448  5173 16773 D SafeParcel: Unknown field id 26 in com.google.android.gms.measurement.internal.AppMetadata, skipping.
06-15 20:08:21.448  5173 16773 D SafeParcel: Unknown field id 27 in com.google.android.gms.measurement.internal.AppMetadata, skipping.
06-15 20:08:21.448  5173 16773 D MeasurementService: f1(com.google.android.gms.measurement.internal.EventParcel@63671dc) for AppMetadata[com.waze]
06-15 20:08:21.448  5173 16773 D MeasurementService: f10(0, null, null, com.waze)
06-15 20:08:21.451  5173 16773 D MeasurementService: f10(-3358585778605298366, null, SpeechRecognizerActivity, com.waze)
06-15 20:08:21.531 12232 12232 D AssistantIntegClient: #registerClientActivity()
06-15 20:08:21.531 12232 12232 D AIClientCbStub: #setActivityOptional(): isMorrisVoicePlateOpened = false
06-15 20:08:21.531 12232 12232 D SystemUiManager: #setActivityOptional(): set new activity window = com.android.internal.policy.PhoneWindow@94439fa
06-15 20:08:21.532 12232 12232 V AssistantIntegClient: #getConnectionState() - connectionState = 0
06-15 20:08:21.532 12232 12232 V AssistantIntegClient: #getConnectionState() - connectionState = 0
06-15 20:08:21.532 12232 12232 V AssistantIntegClient: #getAssistantConfig()
06-15 20:08:21.536 12232 12369 E spdlog  : [20:08:21.536 (world_z7r1fg9g) (0x0000000) 12279 12232 error] GoogleAssistantManager: failed to load assistant configuration: Failed to query AGSA value. This is most likely caused by a Google signature check failure. Please make sure both of the AGSA app and the client app are either release or dev builds.
06-15 20:08:21.536 12232 12369 E spdlog  : java.lang.IllegalStateException: Failed to query AGSA value. This is most likely caused by a Google signature check failure. Please make sure both of the AGSA app and the client app are either release or dev builds.

# This is talking about the Google Assistant, which is not installed as it has package name com.google.android.apps.googleassistant while the only "Google" app that is installed (begrudgingly) has package name com.google.android.googlequicksearchbox. Why does Waze need the Assistant just to do speech recognition of a placename, anyway?

06-15 20:08:21.536 12232 12369 E spdlog  : 	at com.google.android.libraries.assistant.appintegration.AssistantConfig.lambda$getCurrentAssistantConfig$0(WazeSource:11)
06-15 20:08:21.536 12232 12369 E spdlog  : 	at com.google.android.libraries.assistant.appintegration.AssistantConfig$$ExternalSyntheticLambda0.call(Unknown Source:2)
06-15 20:08:21.536 12232 12369 E spdlog  : 	at p6.k$c.call(WazeSource:2)
06-15 20:08:21.536 12232 12369 E spdlog  : 	at com.google.common.util.concurrent.y$a.e(Unknown Source:2)
06-15 20:08:21.536 12232 12369 E spdlog  : 	at com.google.common.util.concurrent.o.run(WazeSource:4)
06-15 20:08:21.536 12232 12369 E spdlog  : 	at com.google.common.util.concurrent.y.run(WazeSource:2)
06-15 20:08:21.536 12232 12369 E spdlog  : 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
06-15 20:08:21.536 12232 12369 E spdlog  : 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
06-15 20:08:21.536 12232 12369 E spdlog  : 	at java.lang.Thread.run(Thread.java:1012)
06-15 20:08:21.536 12232 12369 E spdlog  :  [:0 ()]
06-15 20:08:22.655  5173  5173 D LocationFuser: Received location from org.fitchfamily.android.gsmlocation/.GsmService with time 1686852502653 (last was 1686852500148)
06-15 20:08:22.658  1471 11542 I WifiService: startScan uid=10263

It's worth noting that on the Pixel 6a, I currently have all of the Speech Services by Google installed, as well as the Google Assistant app (com.google.android.apps.googleassistant) from Aurora Store, and the "Google" app (com.google.android.googlequicksearchbox) which it appears to depend on; however, all the Google Assistant does when launched is complaining that "The Google Assistant isn't available on this device".

While that might be the ultimate cause of the the Waze issue (I don't know how to make it available on the device, though; it ought to be available), there appears to be a strange sequence of packages that are required to make Waze happy, and without them, Waze doesn't fail gracefully, but instead appears to hang when using speech recognition.

I wonder if it might be possible to have a wrapper in microG for... whatever Waze is seeking to access, and eventually just direct it to the system's installed speech recognition services.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining the Waze-related speech recognition path around com.waze.google_assistant.SpeechRecognizerActivity and the logged Assistant integration and package lookup failures. Determine how speech recognition behaves when the required Assistant or speech-services packages are unavailable; done means the flow either works or presents an error without blocking Waze input.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile-dev
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.