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

Upgrade to Android 12 and check for breaking changes #205

Closed
mrsarm opened this issue Aug 9, 2021 · 8 comments · Fixed by #262
Closed

Upgrade to Android 12 and check for breaking changes #205

mrsarm opened this issue Aug 9, 2021 · 8 comments · Fixed by #262
Assignees
Labels
Priority: 3 - Low Can be bumped from the release SMS Type: Bug Fix something that isn't working as intended Type: Technical issue Improve something that users won't notice
Milestone

Comments

@mrsarm
Copy link
Contributor

mrsarm commented Aug 9, 2021

In the upcoming Android 12 there is an API that changes the way can be used, and we use that feature in the code that handle the SMS capabilities.

Starting Android 11 the new linter from the Android Gradle Plugin warns about it (check this) so we needed to add an annotation in the source code to ignore the issue, but later we will need to remove the annotation and makes the necessary changes.

Warning when we remove the annotation:

Screenshot from 2021-08-09 16-55-38

@mrsarm mrsarm added Type: Technical issue Improve something that users won't notice SMS labels Aug 9, 2021
@mrsarm mrsarm added this to the 0.10.0 milestone Aug 9, 2021
@mrsarm mrsarm added the Type: Bug Fix something that isn't working as intended label Aug 9, 2021
@mrsarm
Copy link
Contributor Author

mrsarm commented Aug 24, 2021

@mrsarm mrsarm modified the milestones: 0.10.0, 0.11.0 Sep 14, 2021
@mrsarm mrsarm modified the milestones: 0.11.0, 1.0.0 Nov 25, 2021
@latin-panda latin-panda changed the title Changes in upcomming Android 12 may break the SMS capabilities Upgrade to Android 12 and check for breaking changes Mar 10, 2022
@latin-panda
Copy link
Contributor

  • We need to properly upgrade the app to Android 12 (compileSdkVersion 31). The Google's target requirement hasn't been announced yet, but looking at the trend, it's probably going to be around 1st August 2022.

  • We need to check for breaking changes like the one described by Mariano.

cc: @jonathanvq

@craig-landry craig-landry added the Priority: 2 - Medium Normal priority label Mar 11, 2022
@craig-landry
Copy link
Contributor

Temporarily making this "medium" priority as it pertains to the 1.0 release until we agree on if it must be included now or not.

@jkuester
Copy link
Contributor

jkuester commented May 3, 2022

This is ready for at on https://github.com/medic/cht-android/tree/205-Android_12. You can see the PR for more details, but here is a breakdown of what I think needs to be tested:

  1. Runs and drives on Android 12.
    1. Normal things work (can create/review/edit reports, etc)
  2. SMS permissions:
    1. SMS: This requires more setup on the instance and then you have to create a report for your specific form. Details
    2. Expected behavior: when submitting a form that triggers and SMS message the following standard permission behavior should be followed:
      1. Display the prominent disclosure:
        1. image
      2. If the user selects "Allow" on the prominent disclosure and then "Allow" on the permissions prompt, the report should submit without error and an SMS should be sent from the phone to the configured gateway number.
      3. If the user selects "Deny" on the prominent disclosure, then the report should submit without error, but an SMS will not be sent.
      4. If the user selects "Allow on the prominent disclosure and then "Don't allow" on the permissions prompt, the report should submit without error, but an SMS should not be sent. Then, the next time the user tries to submit the form, they should be presented with the same prominent disclosure and prompted to grant the permission again.
        1. If the user is running >= Android 6 and they click "Don't Allow" on the permission at least twice (not just "Deny"ing the prominent disclosure) then the next time the app prompts for the SMS permission with the prominent disclosure, when the user clicks "Allow" they should be taken to the Android system settings where they can manually set the permission. (On Android 5 they should just see the permissions prompt again).
  3. Vibration alerts still work as expected:
    1. Can use the countdown-timer form which should vibrate when the timer runs out.
    2. If possible, test on Android:
      1. 12
      2. 11
      3. >= 24
  4. App URL verification bug fix:
    1. @latin-panda included some recreation steps for the issue out on the PR description really just need to make sure we cannot recreate this issue anymore.

@tatilepizs
Copy link

tatilepizs commented May 4, 2022

Test using Android 11

User: CHW
Config: Standard
Environment: Local with Docker helper script
cht-core version: master
Platform: Mobile App. APK generated with branch 205-Android_12
Phone: Ulefone Note 6
Android Version: 11
Android System WebView Version: 100.0.4896.127

______________________________________________________________

SMS Permissions

Test Scenario:

SMS setup using pregnancy report. Following these steps:
1. In settings.js doc, set a phone number in the settings object for the name gateway_number

Screenshots

image

2. In the form document (pregnancy report for this test) set "xml2sms": true

Screenshots

image

Test Cases.

1. User selects "Allow" on the prominent disclosure and then "Allow" on the permissions prompt, the report should submit without error and an SMS should be sent from the phone to the configured gateway number.

Screenshots

image
image
image
image
image

2. Selects "Deny" on the prominent disclosure, then the report should submit without error, but an SMS will not be sent.

Screenshots

image
image
image

3. Selects "Allow on the prominent disclosure and then "Don't allow" on the permissions prompt, the report should submit without error, but an SMS should not be sent. Then, the next time the user tries to submit the form, they should be presented with the same prominent disclosure and prompted to grant the permission again.

Screenshots

image
image
image
image
image
image
image
image
image
image

______________________________________________________________

Vibration Alerts - countdown-timer

  • Sound on, screen on, waiting for 60 seconds to pass: beep and vibrate
  • Sound off, screen on, waiting for 60 seconds to pass: vibrate
  • Ring on, screen off after starting timer, waiting for 60 seconds to pass: no beep and no vibrate until I unlock the phone

______________________________________________________________

App URL verification bug fix

Following these steps the app showed the connection error page as it should.

Screenshot

image

@jkuester
Copy link
Contributor

jkuester commented May 4, 2022

@mrjones-plip
Copy link
Collaborator

Test results for countdown timer on android 12 on a Pixel 3a with this APK from prior comment.

  • Sound on, screen on, waiting for 60 seconds to pass: beep and vibrate
  • Sound off, screen on, waiting for 60 seconds to pass: vibrate
  • Ring on, screen off after starting timer, waiting for 60 seconds to pass: no beep and vibrate until I unlock the phone

@mrjones-plip
Copy link
Collaborator

mrjones-plip commented May 4, 2022

Test results for SMS flow on android 12 on a Pixel 3a with #205 (comment) from prior comment were on android 12 on a Pixel 3a with APK from prior comment. I have my test environment ready and can do more test or provide screenshots, but since it was verbatim the same, I figured less is more!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: 3 - Low Can be bumped from the release SMS Type: Bug Fix something that isn't working as intended Type: Technical issue Improve something that users won't notice
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants