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

fix: app not locked after timeout when screen turned off [WPB-5682] [WPB-5832] #2521

Merged

Conversation

AndroidBob
Copy link
Collaborator

@AndroidBob AndroidBob commented Dec 13, 2023

BugWPB-5682 doesn't lock the app when "keep connection to websocket" is on

Cherry pick from the original PR:


⚠️ Conflicts during cherry-pick:
kalium


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

When the device's screen is being turned off, the app is not locked when the app lock is on.

Causes (Optional)

We use to emit locked state after given timeout, but when the device is turned off, it goes into doze mode and it disrupts the so that it can take way longer than it should:
image

Solutions

In addition also keep the timestamp and compare it when putting app back into foreground.

Dependencies (Optional)

If there are some other pull requests related to this one (e.g. new releases of frameworks), specify them here.

Needs releases with:

  • GitHub link to other pull request

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

How to Test

Turn app lock on, put the app into background and turn off the screen (phone should not be plugged in and charging), turn it on and open the app after the app lock timeout.


PR Post Submission Checklist for internal contributors (Optional)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. .

@AndroidBob AndroidBob added the cherry-pick PR is cherry-picking changes from another banch label Dec 13, 2023
Copy link
Contributor

@AndroidBob looks like you are rolling back kalium to a previous commitish.

This means that the PR's target branch (develop) is using a newer version of Kalium, and the changes in this PR will rollback Kalium to an older version.

develop This PR
d37b5cba05f4c77cbf556a3b6ad1261efc9e0562 1e78df60282a78e6cc2b4061f3d14d702c3bd9d5

Is this intentional?

Copy link

codecov bot commented Dec 13, 2023

Codecov Report

Merging #2521 (d1bb43b) into develop (c5b8aa5) will increase coverage by 0.14%.
Report is 2 commits behind head on develop.
The diff coverage is 74.54%.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #2521      +/-   ##
=============================================
+ Coverage      41.19%   41.33%   +0.14%     
- Complexity      1112     1116       +4     
=============================================
  Files            355      357       +2     
  Lines          12926    12978      +52     
  Branches        1690     1698       +8     
=============================================
+ Hits            5325     5365      +40     
- Misses          7096     7105       +9     
- Partials         505      508       +3     
Files Coverage Δ
...ld/dialog/deactivated/LegalHoldDeactivatedState.kt 100.00% <100.00%> (ø)
...ire/android/ui/home/appLock/LockCodeTimeManager.kt 81.39% <78.57%> (+3.27%) ⬆️
...rc/main/kotlin/com/wire/android/ui/WireActivity.kt 0.00% <0.00%> (ø)
...ialog/deactivated/LegalHoldDeactivatedViewModel.kt 80.00% <80.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c5b8aa5...d1bb43b. Read the comment docs.

Copy link
Contributor

@AndroidBob looks like you are rolling back kalium to a previous commitish.

This means that the PR's target branch (develop) is using a newer version of Kalium, and the changes in this PR will rollback Kalium to an older version.

develop This PR
d37b5cba05f4c77cbf556a3b6ad1261efc9e0562 1e78df60282a78e6cc2b4061f3d14d702c3bd9d5

Is this intentional?

Copy link
Contributor

github-actions bot commented Dec 13, 2023

Test Results

732 tests  ±0   732 ✔️ ±0   10m 1s ⏱️ + 2m 11s
101 suites ±0       0 💤 ±0 
101 files   ±0       0 ±0 

Results for commit d1bb43b. ± Comparison against base commit d11140e.

♻️ This comment has been updated with latest results.

Copy link
Contributor

APKs built during tests are available here. Scroll down to Artifacts!

@AndroidBob
Copy link
Collaborator Author

Build 2269 succeeded.

The build produced the following APK's:

@saleniuk saleniuk requested review from a team, yamilmedina, alexandreferris, mchenani, ohassine and saleniuk and removed request for a team December 13, 2023 12:13
Copy link
Contributor

@AndroidBob looks like you are rolling back kalium to a previous commitish.

This means that the PR's target branch (develop) is using a newer version of Kalium, and the changes in this PR will rollback Kalium to an older version.

develop This PR
d37b5cba05f4c77cbf556a3b6ad1261efc9e0562 1e78df60282a78e6cc2b4061f3d14d702c3bd9d5

Is this intentional?

Copy link
Contributor

APKs built during tests are available here. Scroll down to Artifacts!

…-when-screen-turned-off-cherry-pick

# Conflicts:
#	kalium
…urned-off-cherry-pick' into fix/app-not-locked-when-screen-turned-off-cherry-pick
Copy link
Contributor

APKs built during tests are available here. Scroll down to Artifacts!

@AndroidBob
Copy link
Collaborator Author

Build 2280 succeeded.

The build produced the following APK's:

@saleniuk saleniuk added this pull request to the merge queue Dec 13, 2023
Merged via the queue into develop with commit a6490b1 Dec 13, 2023
11 checks passed
@saleniuk saleniuk deleted the fix/app-not-locked-when-screen-turned-off-cherry-pick branch December 13, 2023 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick PR is cherry-picking changes from another banch size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants