commit 28a8d2b812afefb1277a584cc51dc3119667b60f parent 0f456fd2ed8a81611516060875e6248bc2db07cb Author: t-p-white <towhite@mozilla.com> Date: Tue, 16 Dec 2025 13:27:20 +0000 Bug 2006296 - Improve the AppState documentation to provide clearer guidance for developers. Based on the original app store intention captured in https://github.com/mozilla-mobile/fenix/issues/20704 r=android-reviewers,marcin DONTBUILD Differential Revision: https://phabricator.services.mozilla.com/D276630 Diffstat:
| M | mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/appstate/AppState.kt | | | 8 | +++++++- |
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/appstate/AppState.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/appstate/AppState.kt @@ -31,7 +31,13 @@ import org.mozilla.fenix.reviewprompt.ReviewPromptState.Unknown import org.mozilla.fenix.wallpapers.WallpaperState /** - * Value type that represents the state of the tabs tray. + * Global application specific state that needs to live as long as the app (or longer than a Fragment). + * + * Before using the [AppState] to hold a feature’s state, consider the following constraints: + * - Persistence to disk is not required. + * - The state is needed for the lifetime of the app or on frequently used screens. + * - Losing this state is acceptable if the operating system reclaims memory and the app restarts. + * - Recreating the state does not involve expensive operations (for example, network or disk I/O). * * @property isForeground Whether or not the app is in the foreground. * @property inactiveTabsExpanded A flag to know if the Inactive Tabs section of the Tabs Tray