Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle android 11 "always" permission properly + Humanize android notification messages #192

Merged
merged 7 commits into from
Jun 5, 2021

Conversation

shankari
Copy link
Contributor

@shankari shankari commented Jun 5, 2021

  • Make messages shorter
  • Make them more human-understandable
  • Popup app settings on android 11
    • to avoid issue with having to open settings anyway
    • and to deal with the fact that the app dialog will not pop up if the user select anything other than always the first time

This fixes e-mission/e-mission-docs#608

shankari added 7 commits June 4, 2021 23:01
Particularly, the "In state %s" message is now changed to localizable strings
such as "Ready to start trip".

@PatGendre, you might want to localize these as well to remove the remaining
english text in your app :)
…tion permission

This makes it easier to set the permissions instead of having people select
"when in use" first and then have to go to the app settings later to fix it.
This fixes e-mission/e-mission-docs#608
at least for now
The most common messages displayed by the foreground service are the
"In state XXX" message. But the state is too jargon-y - e.g.
"In state local.state.waiting_for_trip_start".

It could also not be easily internationalized.

Based on feedback from the Smart Commute program, we changed this to more
meaningful messages. I'd been putting this off because it is a bit tricky to
do.

We have the state as a string. But the i18n solution maps from an id to the
humanized string. So how do I convert a string to an ID?
It turned out to not be that hard.

https://stackoverflow.com/a/29902630/4040267
https://stackoverflow.com/a/19093447/4040267
Remove all references to "email" since we now "upload" logs
+ shorten some strings
Follow on to e24462e
Was ignored initially because I removed all imports to avoid the package renames
So that we can re-check and ensure that the user used the appropriate settings

Testing done:
- on android 29, ensured that the original in-line prompt was displayed
- on android 30,
  - launch the settings, user doesn't change anything, come back to app, error
    about location permission, click
  - launch the settings again, user switches to "when in use", come back to
    app, error about background permission, click
  - launch the settings again, user switches to "always", come back to app, no
    additional errors, now in waiting_for_trip_start

This is a follow on to e-mission@e24462e
Since the app settings screen does not have an output
@shankari
Copy link
Contributor Author

shankari commented Jun 5, 2021

Re-testing done on:

  • android 11
  • android 10
  • iOS 11

@shankari shankari merged commit 8c3e473 into e-mission:master Jun 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Permissions for the e-mission-phone app on Android 11 does not incite to allow background location
1 participant