GoogleTTS offline language download fails with "Settings key: <repair_mode_active> is not readable"
When trying to download a language in GoogleTTS via Settings -> System -> Languages -> Voice Input (Speech Recognition & Synthesis) -> Add a language, the download fails silently and nothing gets downloaded. Looking at adb logs, it seems to be caused by the app unable to read a settings key.
ZipLPPopulator: java.lang.SecurityException: Settings key: <repair_mode_active> is not readable. From S+, settings keys annotated with @hide are restricted to system_server and system apps only, unless they are annotated with @Readable.
This was tested on a fresh install of GrapheneOS, version 2024012600 on a pixel 6a. The only apps installed was google play services (through the apps installer) and google tts (sourced through aurora store)
adb log snippet:
02-06 07:55:50.654 958 5019 I WifiHAL : Creating message to get link statistics; iface = 47
02-06 07:55:50.774 958 5019 I WifiHAL : In GetLinkStatsCommand::handleResponse
02-06 07:55:50.781 958 5019 E IPCThreadState: binder thread pool (1 threads) starved for 128 ms
02-06 07:55:50.853 2725 2743 I deeptouch: I0000 00:00:1707245750.852971 2743 tf_lite_classifier.cc:409] Event stream classified as kNone
02-06 07:55:50.895 6626 6626 D BoundBrokerSvc: onUnbind: Intent { act=com.google.android.gms.clearcut.bootcount.service.START dat=chimera-action:/... cmp=com.google.android.gms/.chimera.PersistentBoundBrokerService }
02-06 07:55:50.932 6460 6460 I NDLangDialogFragPeer: #onClick
02-06 07:55:50.932 6460 6460 I NDLangDialogFragPeer: #onClick starting LP download
02-06 07:55:50.932 6460 6460 I LPRequestClient: #getAllPacks
02-06 07:55:50.932 6460 6460 I DefaultLPManager: #getAvailablePackages
02-06 07:55:50.933 6460 6460 I fal : #getDownloadableLanguagePacks
02-06 07:55:50.933 6460 6460 W SystemLPSourceImpl: #getAvailablePackages: Note there is not reason to call this method, as getInstalledPackages() returns the same LanguagePacks for this impl.
02-06 07:55:50.933 6460 6460 I DefaultLPManager: #getRequestedPackages
02-06 07:55:50.933 6460 6460 I ZipLPPopulator: #addNewFileGroups
02-06 07:55:50.933 6460 6460 I fal : #getDownloadableLanguagePacks
02-06 07:55:50.934 6460 6460 W SystemLPSourceImpl: #getRequestedPackages: There is not reason to call this method, as the result is always empty.
02-06 07:55:50.934 6460 6460 I DefaultLPManager: #getInstalledPackages
02-06 07:55:50.934 6460 6460 I fal : #getInstalledPackages
02-06 07:55:50.934 6460 6522 I LPRequestState: [ZipfileRequests] #resolveDesiredLanguagePacks
02-06 07:55:50.934 6460 6522 I fal : #getPendingPackages
02-06 07:55:50.935 6460 6460 W WindowOnBackDispatcher: sendCancelIfRunning: isInProgress=falsecallback=android.view.ViewRootImpl$$ExternalSyntheticLambda17@b0ccc21
02-06 07:55:50.935 6460 6510 I LPRequestClient: Starting new LanguagePack download [en-US 3006]
--------- beginning of system
02-06 07:55:50.935 1532 2636 D CoreBackPreview: Window{34684fe u0 com.google.android.tts/com.google.android.apps.speech.tts.googletts.settings.asr.AddLanguagesActivity}: Setting back callback null
02-06 07:55:50.935 6460 6510 I LPRequestState: [ManagerRequests] #addRequest
02-06 07:55:50.936 6460 6520 D OpenGLRenderer: endAllActiveAnimators on 0xb400d1cce4b88000 (RippleDrawable) with handle 0xb400d09d85691d50
02-06 07:55:50.937 1532 2636 W InputManager-JNI: Input channel object '34684fe com.google.android.tts/com.google.android.apps.speech.tts.googletts.settings.asr.AddLanguagesActivity (client)' was disposed without first being removed with the input manager!
02-06 07:55:50.943 6460 6460 W WindowOnBackDispatcher: OnBackInvokedCallback is not enabled for the application.
02-06 07:55:50.943 6460 6460 W WindowOnBackDispatcher: Set 'android:enableOnBackInvokedCallback="true"' in the application manifest.
02-06 07:55:50.946 6460 6536 I DefaultLPManager: #installPackageWithForegroundService
02-06 07:55:50.946 6460 6510 I LPRequestClient: #getAllPacks
02-06 07:55:50.946 6460 6537 I LPRequestClient: #getAllPacks
02-06 07:55:50.946 6460 6510 I DefaultLPManager: #getAvailablePackages
02-06 07:55:50.946 6460 6537 I DefaultLPManager: #getAvailablePackages
02-06 07:55:50.946 6460 6510 I fal : #getDownloadableLanguagePacks
02-06 07:55:50.946 6460 6510 W SystemLPSourceImpl: #getAvailablePackages: Note there is not reason to call this method, as getInstalledPackages() returns the same LanguagePacks for this impl.
02-06 07:55:50.946 6460 6537 I fal : #getDownloadableLanguagePacks
02-06 07:55:50.946 6460 6510 I DefaultLPManager: #getRequestedPackages
02-06 07:55:50.947 6460 6536 I LPRequestState: [ZipfileRequests] #addRequest
02-06 07:55:50.947 6460 6510 I ZipLPPopulator: #addNewFileGroups
02-06 07:55:50.947 6460 6510 I fal : #getDownloadableLanguagePacks
02-06 07:55:50.947 6460 6510 W SystemLPSourceImpl: #getRequestedPackages: There is not reason to call this method, as the result is always empty.
02-06 07:55:50.947 6460 6510 I DefaultLPManager: #getInstalledPackages
02-06 07:55:50.947 6460 6510 I fal : #getInstalledPackages
02-06 07:55:50.947 6460 6537 W SystemLPSourceImpl: #getAvailablePackages: Note there is not reason to call this method, as getInstalledPackages() returns the same LanguagePacks for this impl.
02-06 07:55:50.948 6460 6537 I DefaultLPManager: #getRequestedPackages
02-06 07:55:50.948 6460 6536 I LPRequestState: [ZipfileRequests] #resolveDesiredLanguagePacks
02-06 07:55:50.948 6460 6537 I ZipLPPopulator: #addNewFileGroups
02-06 07:55:50.948 6460 6537 I fal : #getDownloadableLanguagePacks
02-06 07:55:50.948 6460 6536 I fal : #getPendingPackages
02-06 07:55:50.948 6460 6537 W SystemLPSourceImpl: #getRequestedPackages: There is not reason to call this method, as the result is always empty.
02-06 07:55:50.948 6460 6537 I DefaultLPManager: #getInstalledPackages
02-06 07:55:50.948 6460 6537 I fal : #getInstalledPackages
02-06 07:55:50.949 6460 6536 I LPRequestState: [ZipfileRequests] #resolveDesiredLanguagePacks
02-06 07:55:50.949 6460 6536 I fal : #getPendingPackages
02-06 07:55:50.949 1532 1844 V WindowManager: Unknown focus tokens, dropping reportFocusChanged
02-06 07:55:50.951 6460 6510 I ZipLPPopulator: #addNewFileGroups
02-06 07:55:50.951 6460 6510 I fal : #getDownloadableLanguagePacks
02-06 07:55:50.951 6460 6529 I LPRequestState: [ZipfileRequests] #resolveDesiredLanguagePacks
02-06 07:55:50.952 6460 6537 I LanguagePackCBTrigger: No #onInstallRequest callbacks registered. Request logged for en-US_v3006
02-06 07:55:50.952 6460 6529 E ZipLPPopulator: Failed to add file group for 'langpack-domain_en-US_3006_zipfile' from location: https://dl.google.com/android/voice/soda/en-US/v3006/soda-en-US-v3006.zip
02-06 07:55:50.952 6460 6529 E ZipLPPopulator: java.lang.SecurityException: Settings key: <repair_mode_active> is not readable. From S+, settings keys annotated with @hide are restricted to system_server and system apps only, unless they are annotated with @Readable.
02-06 07:55:50.952 6460 6529 E ZipLPPopulator: at android.provider.Settings$NameValueCache.getStringForUser(Settings.java:3331)
02-06 07:55:50.952 6460 6529 E ZipLPPopulator: at android.provider.Settings$Global.getStringForUser(Settings.java:17015)
02-06 07:55:50.952 6460 6529 E ZipLPPopulator: at android.provider.Settings$Global.getString(Settings.java:16998)
02-06 07:55:50.952 6460 6529 E ZipLPPopulator: at android.provider.Settings$Global.getInt(Settings.java:17215)
02-06 07:55:50.952 6460 6529 E ZipLPPopulator: at eys.apply(PG:93)
02-06 07:55:50.952 6460 6529 E ZipLPPopulator: at ghf.apply(PG:3)
02-06 07:55:50.952 6460 6529 E ZipLPPopulator: at hdj.d(PG:2)
02-06 07:55:50.952 6460 6529 E ZipLPPopulator: at hdk.run(PG:9)
02-06 07:55:50.952 6460 6529 E ZipLPPopulator: at ctq.run(PG:1)
02-06 07:55:50.952 6460 6529 E ZipLPPopulator: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
02-06 07:55:50.952 6460 6529 E ZipLPPopulator: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
02-06 07:55:50.952 6460 6529 E ZipLPPopulator: at bql.run(PG:93)
02-06 07:55:50.952 6460 6529 E ZipLPPopulator: at java.lang.Thread.run(Thread.java:1012)
02-06 07:55:50.952 6460 6529 E ZipLPPopulator: at ctx.run(PG:5)
02-06 07:55:50.955 6460 6529 E LPRequestClient: LanguagePack [en-US 3006] download threw error.
02-06 07:55:50.955 6460 6529 E LPRequestClient: cxo: Nothing to download for file group: langpack-domain_en-US_3006_zipfile
02-06 07:55:50.955 6460 6529 E LPRequestClient: at bnw.c(PG:3)
02-06 07:55:50.955 6460 6529 E LPRequestClient: at cyz.a(PG:13)
02-06 07:55:50.955 6460 6529 E LPRequestClient: at hdv.a(PG:16)
02-06 07:55:50.955 6460 6529 E LPRequestClient: at hdi.d(PG:2)
02-06 07:55:50.955 6460 6529 E LPRequestClient: at hdk.run(PG:9)
02-06 07:55:50.955 6460 6529 E LPRequestClient: at hfs.run(PG:4)
02-06 07:55:50.955 6460 6529 E LPRequestClient: at ctq.run(PG:1)
02-06 07:55:50.955 6460 6529 E LPRequestClient: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
02-06 07:55:50.955 6460 6529 E LPRequestClient: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
02-06 07:55:50.955 6460 6529 E LPRequestClient: at bql.run(PG:93)
02-06 07:55:50.955 6460 6529 E LPRequestClient: at java.lang.Thread.run(Thread.java:1012)
02-06 07:55:50.955 6460 6529 E LPRequestClient: at ctx.run(PG:5)
02-06 07:55:50.968 1532 2636 I ImeTracker: com.google.android.tts:23482310: onRequestHide at ORIGIN_SERVER_HIDE_INPUT reason HIDE_SAME_WINDOW_FOCUSED_WITHOUT_EDITOR
02-06 07:55:50.968 1532 2636 I ImeTracker: com.google.android.tts:23482310: onCancelled at PHASE_SERVER_SHOULD_HIDE```
I did some tests with some older versions (built locally since there's no archive on the official site), and it was working as on 2023110700 but not on 2023120700, so it's probably broken by the first quarterly Android 14 update.
edit: doing a code search seems to confirm the above. The repair_mode_active setting was not in 2023110700 but was in 2023120700. It seems to have been added by this: https://android-review.googlesource.com/c/platform/frameworks/base/+/2781891
Appears to be something the sandboxed Google Play compatibility layer could handle.