[PR #4574] [MERGED] [PM-13626] Remember last opened view for 5 minutes #5048

Closed
opened 2025-11-26 23:53:19 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/4574
Author: @aj-rosado
Created: 1/16/2025
Status: Merged
Merged: 1/28/2025
Merged by: @aj-rosado

Base: mainHead: PM-13626/remember-last-opened-view


📝 Commits (10+)

  • 8007888 Add AppResumeManager, SettingsDiskSource methods and unlock check for AppResume
  • 876df9a Add generator screen to AppResume
  • 0d1565a Added SendShortcut and Send to AppResumeManager
  • 885e4b5 Add App Resume logic to the Search
  • 7937c22 Verification Code app resume navigation
  • cf91608 Merge branch 'main' into PM-13626/remember-last-opened-view
  • fa0cdd9 saving last lock timestamp and improved AppResume logic
  • c934288 improved app resume clarity
  • b374725 Refactor SettingsDiskSource appResume methods to receive/return an AppResumeData object
  • 286ecd5 Add tests for AppResume functionality

📊 Changes

41 files changed (+1042 additions, -36 deletions)

View changed files

📝 app/src/main/java/com/x8bit/bitwarden/MainActivity.kt (+12 -0)
📝 app/src/main/java/com/x8bit/bitwarden/MainViewModel.kt (+16 -0)
📝 app/src/main/java/com/x8bit/bitwarden/data/auth/datasource/disk/AuthDiskSource.kt (+11 -0)
📝 app/src/main/java/com/x8bit/bitwarden/data/auth/datasource/disk/AuthDiskSourceImpl.kt (+16 -0)
📝 app/src/main/java/com/x8bit/bitwarden/data/platform/datasource/disk/SettingsDiskSource.kt (+11 -0)
📝 app/src/main/java/com/x8bit/bitwarden/data/platform/datasource/disk/SettingsDiskSourceImpl.kt (+13 -0)
app/src/main/java/com/x8bit/bitwarden/data/platform/manager/AppResumeManager.kt (+37 -0)
app/src/main/java/com/x8bit/bitwarden/data/platform/manager/AppResumeManagerImpl.kt (+74 -0)
📝 app/src/main/java/com/x8bit/bitwarden/data/platform/manager/di/PlatformManagerModule.kt (+21 -0)
app/src/main/java/com/x8bit/bitwarden/data/platform/manager/model/AppResumeScreenData.kt (+34 -0)
📝 app/src/main/java/com/x8bit/bitwarden/data/platform/manager/model/SpecialCircumstance.kt (+18 -0)
app/src/main/java/com/x8bit/bitwarden/data/platform/manager/util/AppResumeStateManager.kt (+80 -0)
📝 app/src/main/java/com/x8bit/bitwarden/data/vault/manager/VaultLockManager.kt (+0 -1)
📝 app/src/main/java/com/x8bit/bitwarden/data/vault/manager/VaultLockManagerImpl.kt (+4 -0)
📝 app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/vaultunlock/VaultUnlockViewModel.kt (+9 -0)
📝 app/src/main/java/com/x8bit/bitwarden/ui/platform/composition/LocalManagerProvider.kt (+7 -0)
📝 app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavViewModel.kt (+6 -1)
📝 app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/search/SearchScreen.kt (+14 -0)
📝 app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/search/SearchViewModel.kt (+8 -1)
📝 app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/vaultunlockednavbar/VaultUnlockedNavBarScreen.kt (+3 -1)

...and 21 more files

📄 Description

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-13626

📔 Objective

After lock, for the next 5 minutes, the user should be redirected to the previous screen if they were:

  • Send
  • Verification Code
  • Generator
  • Search

To achieve this, a new manager was added to control the behaviour and saving the last screen on SettingsDiskSource (should this be on a different disk source?). The navigation is provided by deeplink using the existing SpecialCircumstance.

The current screen is always saved onResume and cleared onStop (to ensure we don't navigate to previous screens)
Before clearing, checking if the user is not locked, does the trick to not clear in case of lock when the app was on background

A different task will add more screens

Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed
    issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/4574 **Author:** [@aj-rosado](https://github.com/aj-rosado) **Created:** 1/16/2025 **Status:** ✅ Merged **Merged:** 1/28/2025 **Merged by:** [@aj-rosado](https://github.com/aj-rosado) **Base:** `main` ← **Head:** `PM-13626/remember-last-opened-view` --- ### 📝 Commits (10+) - [`8007888`](https://github.com/bitwarden/android/commit/800788813193c9eec5694f680e36b6d545de43b8) Add AppResumeManager, SettingsDiskSource methods and unlock check for AppResume - [`876df9a`](https://github.com/bitwarden/android/commit/876df9a8c0690ed15459ac8d4ac107c23d66427c) Add generator screen to AppResume - [`0d1565a`](https://github.com/bitwarden/android/commit/0d1565af3b474aa15a7c53b99d52da08b8126bcd) Added SendShortcut and Send to AppResumeManager - [`885e4b5`](https://github.com/bitwarden/android/commit/885e4b54df992f6abf7ec6addc7e5c88ad95e4e1) Add App Resume logic to the Search - [`7937c22`](https://github.com/bitwarden/android/commit/7937c22518839923db520785a779146e951a6b86) Verification Code app resume navigation - [`cf91608`](https://github.com/bitwarden/android/commit/cf916085fd49e06808ab8dcb9dbb9663f708dd22) Merge branch 'main' into PM-13626/remember-last-opened-view - [`fa0cdd9`](https://github.com/bitwarden/android/commit/fa0cdd976c262a21535ca6e4d801ec055371834a) saving last lock timestamp and improved AppResume logic - [`c934288`](https://github.com/bitwarden/android/commit/c93428842567e4ccf5b147e19bc22be955eeaecd) improved app resume clarity - [`b374725`](https://github.com/bitwarden/android/commit/b3747259d9825262097acb229c9baa9ff3df79d5) Refactor SettingsDiskSource appResume methods to receive/return an AppResumeData object - [`286ecd5`](https://github.com/bitwarden/android/commit/286ecd5e1bf8417868675eeb409bcf4063ffb917) Add tests for AppResume functionality ### 📊 Changes **41 files changed** (+1042 additions, -36 deletions) <details> <summary>View changed files</summary> 📝 `app/src/main/java/com/x8bit/bitwarden/MainActivity.kt` (+12 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/MainViewModel.kt` (+16 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/data/auth/datasource/disk/AuthDiskSource.kt` (+11 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/data/auth/datasource/disk/AuthDiskSourceImpl.kt` (+16 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/data/platform/datasource/disk/SettingsDiskSource.kt` (+11 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/data/platform/datasource/disk/SettingsDiskSourceImpl.kt` (+13 -0) ➕ `app/src/main/java/com/x8bit/bitwarden/data/platform/manager/AppResumeManager.kt` (+37 -0) ➕ `app/src/main/java/com/x8bit/bitwarden/data/platform/manager/AppResumeManagerImpl.kt` (+74 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/data/platform/manager/di/PlatformManagerModule.kt` (+21 -0) ➕ `app/src/main/java/com/x8bit/bitwarden/data/platform/manager/model/AppResumeScreenData.kt` (+34 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/data/platform/manager/model/SpecialCircumstance.kt` (+18 -0) ➕ `app/src/main/java/com/x8bit/bitwarden/data/platform/manager/util/AppResumeStateManager.kt` (+80 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/data/vault/manager/VaultLockManager.kt` (+0 -1) 📝 `app/src/main/java/com/x8bit/bitwarden/data/vault/manager/VaultLockManagerImpl.kt` (+4 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/vaultunlock/VaultUnlockViewModel.kt` (+9 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/platform/composition/LocalManagerProvider.kt` (+7 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavViewModel.kt` (+6 -1) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/search/SearchScreen.kt` (+14 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/search/SearchViewModel.kt` (+8 -1) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/vaultunlockednavbar/VaultUnlockedNavBarScreen.kt` (+3 -1) _...and 21 more files_ </details> ### 📄 Description ## 🎟️ Tracking https://bitwarden.atlassian.net/browse/PM-13626 ## 📔 Objective After lock, for the next 5 minutes, the user should be redirected to the previous screen if they were: - Send - Verification Code - Generator - Search To achieve this, a new manager was added to control the behaviour and saving the last screen on `SettingsDiskSource` (should this be on a different disk source?). The navigation is provided by deeplink using the existing SpecialCircumstance. The current screen is always saved `onResume` and cleared `onStop` (to ensure we don't navigate to previous screens) Before clearing, checking if the user is not locked, does the trick to not clear in case of lock when the app was on background A different task will add more screens ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation or informed the documentation team ## 🦮 Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-26 23:53:19 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#5048