Status Update
Comments
ma...@gmail.com <ma...@gmail.com> #2
If you are using location, you should be using the permissions API to ensure that you have the permissions you need to track background location before any attempts to use APIs that require that permission.
SystemForegroundService
just provides a convenient entry point for the ListenableWorker
. If you require additional permissions, its the app's responsibility to ask for permissions and check that those permissions are granted.
vi...@google.com <vi...@google.com> #3
We are performing location checks before submitting the WorkManager job. However, the problem exists if the location permission is removed by the User after the job has been submitted. The OS is force killing the app (when the location permission is removed), and the OS is trying to restart the SystemForegroundService which then crashes our app immediately on launch. We are not interacting with the WorkManager in this scenario other than initialising it which is necessary on app start, e.g.
val workManagerConfig = Configuration.Builder()
.setWorkerFactory(entryPoints.getWorkerFactory())
.build()
// Initialize WorkManager with the custom configuration.
WorkManager.initialize(context, workManagerConfig)
return WorkManager.getInstance(context)
mi...@gmail.com <mi...@gmail.com> #4
I think it might be best for now if your foreground worker does not declare that it is a location foreground service and instead it is either a 'short' service or a 'special use' service such that WorkManager's SystemForegroundService
redeliver intent restarts your foreground worker and in it you can check for location permission and then start a real foreground location service.
Meanwhile we have to adapt WorkManager's SystemForegroundService
to Android 14 requirements to have a foreground service type along with its permission runtime check as otherwise many of the types have runtime permissions pre-requisites.
vi...@google.com <vi...@google.com> #5
Sorry, I just re-read the changes for Android 14, and for this to work elegantly, we will need to change the implementation of SystemForegroundService
to do the right thing.
Will try to land this in the next WorkManager release.
ma...@gmail.com <ma...@gmail.com> #6
uc...@google.com <uc...@google.com> #7
ma...@gmail.com <ma...@gmail.com> #8
vi...@google.com <vi...@google.com> #9
Hey - We are working on a fix that will prevent WorkManager from crashing when the foreground worker is restarted due to permission loss. Be aware though that WorkManager won't be able to set the app in a foreground state and it is expected for the worker to self check the required permissions and to probably return a Result.failure()
from the work override.
mi...@gmail.com <mi...@gmail.com> #10
Branch: androidx-main
commit 4616a739983e6316819dc515057677edf40a41c1
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Wed Jul 24 08:59:34 2024
Catch SecurityException in startForeground
In API 34, startForeground() will throw SecurityException if the service type prerequisites are not met. WorkManager won't be able to start the foreground service but the worker is likely to continue and ideally fail once it checks the permission needed to do the actual work. The worker will also be subject to JobScheduler limitations.
This change mitigates the crashing issue of a foreground worker running and the app losing the prerequisite permission, causing the app to restart and due to SystemForegroundService being sticky, it restarting too but failing at startForeground() due to missing permissions.
Bug: 333957914
Test: Manual
Change-Id: I96607f62fdd456290163ee6f2774f9d31c64e79e
M work/work-runtime/src/main/java/androidx/work/impl/foreground/SystemForegroundService.java
uc...@google.com <uc...@google.com> #11
Branch: androidx-main
commit c540fa0564df85fa4e3cfd2d98f532f4120e12d8
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Wed Jul 24 09:48:38 2024
Add foreground worker with location
Updates WorkManager integration app to validate Android 14 foreground service type requirements, including the addition for a foreground worker who uses location APIs.
Bug: 333957914
Test: n/a
Change-Id: I9ac76d029ab0f0e4d1256145bdc2e3cb20b27c36
M work/integration-tests/testapp/lint-baseline.xml
M work/integration-tests/testapp/src/main/AndroidManifest.xml
A work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/ForegroundLocationWorker.kt
M work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/ForegroundWorker.kt
M work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/MainActivity.kt
M work/integration-tests/testapp/src/main/res/layout/activity_main.xml
M work/integration-tests/testapp/src/main/res/values/donottranslate-strings.xml
ma...@gmail.com <ma...@gmail.com> #12
<[ https://android-review.googlesource.com/3190158 :// = > https://android-X-review.android-X-source. com/3190158 and I didn't get my addresses I need <[ Android-X-Developer.com ]> <[Android-X-GloblaleWaybandTelcomPrivateGovSecurityServices.com ] [ Android-X-GlobaleEcosystemEnterprise ]
:// I need everything of this to be Android-X Object script because they are trying to say it's their's and they can't even run it and I need it back ]>
tn...@google.com <tn...@google.com> #13
Fixed in 4.1 by Change-Id: I221e9d3c5f1d06d56a57e034e69823617580a7f0. Thanks for the report!
rt...@e-djuster.ca <rt...@e-djuster.ca> #14
tn...@google.com <tn...@google.com> #15
Yes indeed, thanks Robert!
to...@yahoo.com <to...@yahoo.com> #16
and this is partially back...
Android Studio Chipmunk | 2021.2.1 Canary 4 Build #AI-212.5284.40.2112.7863073, built on October 28, 2021 Runtime version: 11.0.12+7-b1504.28-7817840 amd64 VM: OpenJDK 64-Bit Server VM by Oracle Corporation Windows 10 10.0 GC: G1 Young Generation, G1 Old Generation Memory: 1280M Cores: 8 Registry: external.system.auto.import.disabled=true
In the text files themselves it's still ok; i.e. only 'red' when a translation is really missing.
However, in the editor view (the table view which shows all string vertically and all languages horizontally) all strings are showing up 'red' once again. i.e. if "en" has the string defined, but "en_GB" does not.... all should be fine... but Chipmunk c4 is showing those as 'red'
gm...@gmail.com <gm...@gmail.com> #17
warning: string 'archive_notify_new_messages_global_setting_title' has no default translation.
warning: string 'archive_notify_new_messages_info' has no default translation.
warning: string 'archive_notify_new_messages_title' has no default translation.
warning: string 'delete_media' has no default translation.
warning: string 'ephemeral_unblock_to_update_setting' has no default translation.
warning: string 'fingerprint_locked_title' has no default translation.
warning: string 'fingerprint_setup_dialog_negative_button' has no default translation.
warning: string 'fingerprint_setup_dialog_positive_button' has no default translation.
warning: string 'fingerprint_timeout_immediately' has no default translation.
warning: string 'gallery' has no default translation.
warning: string 'mediamods' has no default translation.
warning: string 'message_qr_found_title' has no default translation.
warning: string 'msg_autoreply_specialtimes' has no default translation.
warning: string 'msg_autoreply_spectoignore' has no default translation.
warning: string 'msg_autoreply_spectoreply' has no default translation.
warning: string 'network_usage_ask_reset_message' has no default translation.
warning: string 'not_expiring_message' has no default translation.
warning: string 'notification_settings_title_archived_chats' has no default translation.
warning: string 'others_device_login_chat_message' has no default translation.
warning: string 'others_device_logout_chat_message' has no default translation.
warning: string 'others_multiple_device_change_chat_message' has no default translation.
warning: string 'passv' has no default translation.
warning: string 'picture_in_picture_error' has no default translation.
warning: string 'read_later_chats_setting_title' has no default translation.
warning: string 'read_later_mute_details_header' has no default translation.
warning: string 'restart_phone' has no default translation.
warning: string 'room_attachment' has no default translation.
warning: string 'room_create' has no default translation.
warning: string 'room_installed_error' has no default translation.
warning: string 'rooms_continue_in_messenger' has no default translation.
warning: string 'rooms_create_link_in_messenger_continue' has no default translation.
warning: string 'rooms_create_link_in_messenger_nux' has no default translation.
warning: string 'rooms_non_e2e_warning' has no default translation.
warning: string 'rooms_nux_title' has no default translation.
warning: string 'sched_title_activity_edit' has no default translation.
warning: string 'search_section_results' has no default translation.
warning: string 'search_themes' has no default translation.
warning: string 'seen_status_color' has no default translation.
warning: string 'seen_status_color_sum' has no default translation.
warning: string 'self_device_login_chat_message' has no default translation.
warning: string 'self_device_login_group_chat_message' has no default translation.
warning: string 'self_device_login_list_chat_message' has no default translation.
warning: string 'self_device_logout_chat_message' has no default translation.
warning: string 'self_device_logout_group_chat_message' has no default translation.
warning: string 'self_device_logout_list_chat_message' has no default translation.
warning: string 'self_multiple_device_change_chat_message' has no default translation.
warning: string 'self_multiple_device_change_group_chat_message' has no default translation.
warning: string 'self_multiple_device_change_list_chat_message' has no default translation.
warning: string 'sending_to' has no default translation.
warning: string 'settings_notification_ignore_archived_chats' has no default translation.
warning: string 'settings_notification_ignore_archived_chats_detail' has no default translation.
warning: string 'settings_privacy_fingerprint_timeout' has no default translation.
warning: string 'storage_usage' has no default translation.
warning: string 'storage_usage_delete_complete_text' has no default translation.
warning: string 'storage_usage_free' has no default translation.
warning: string 'storage_usage_used' has no default translation.
warning: string 'tb_msg_more_info' has no default translation.
warning: string 'unseen_status_color' has no default translation.
warning: string 'unseen_status_color_sum' has no default translation.
warning: string 'voip_e2ee_message' has no default translation.
warning: string 'wallpaper_packge' has no default translation.
warning: string 'welcome_available_platforms_consumer' has no default translation.
warning: string 'welcome_available_platforms_india_consumer' has no default translation.
warning: string 'welcome_available_platforms_india_smb' has no default translation.
warning: string 'welcome_available_platforms_smb' has no default translation.
/data/user/0/
Description
I have strings.xml in values-en-rGB with a subset of regional values
Warnings appear saying "... is not translated in en"
Adding tools:locale="en" in default strings.xml should remove theses warnings
<resources xmlns:tools="
</resources>
This is not working