1
0
Fork 0
fenix/app/src/main/java/org/mozilla/fenix/components
Grisha Kruglov eb14532c3c Closes #7450: Lazy storage initialization
Make sure that we actually lazily initialize our storage layers.

With this patch applied, storage layers (history, logins, bookmarks) will be initialized when first
accessed. We will no longer block GeckoEngine init, for example, on waiting for the logins storage
to initialize (which needs to access the costly securePrefStorage).
Similarly, BackgroundServices init will no longer require initialized instances of the storage
components - references to their "lazy wrappers" will suffice.

In practice, this change changes when our storage layers are initialized in the following ways.
Currently, we will initialize everything on startup. This includes loading our megazord, as well.

With this change, init path depends on if the user is signed-into FxA or not.

If user is not an FxA user:
- on startup, none of the storage layers are initialized
- history storage will be initialized once, whenever:
  - first non-customTab page is loaded (access to the HistoryDelegate)
  - first interaction with the awesomebar
  - history UI is accessed
- bookmarks storage will be initialized once, whenever:
  - something is bookmarked, or we need to figure out if something's bookmarked
  - bookmarks UI is accessed
- logins storage will be initialized once, whenever:
  - first page is loaded with a login/password fields that can be autofilled
  - (or some other interaction by GV with the autofill/loginStorage delegates)
  - logins UI is accessed
- all of these storages will be initialized if the user logs into FxA and starts syncing data
  - except, if a storage is not chosen to be synced, it will not be initialized

If user is an FxA user:
- on startup, none of the storage layers are initialized
- sometime shortly after startup is complete, when a sync worker runs in the background, all storage
layers that are enabled to sync will be initialized.

This change also means that we delay loading the megazord until first access (as described above).
2020-03-19 15:46:50 -07:00
..
history For #4137 - Adds pagination to the history view 2019-07-31 14:35:33 -07:00
metrics For #7847: Improve startup performance of the Fenix wrapper around Glean 2020-03-04 16:21:45 -08:00
searchengine fix #8135 - remove getColorFromAttr 2020-03-02 15:48:33 -07:00
toolbar For #9200: Remove star icon from empty state icon in toolbar 2020-03-18 10:23:50 -07:00
AccountAbnormalities.kt fix #8135 - remove getColorFromAttr 2020-03-02 15:48:33 -07:00
Analytics.kt Closes #9104: Pass release channel information to Socorro service (#9130) 2020-03-12 12:00:14 -04:00
BackgroundServices.kt Closes #7450: Lazy storage initialization 2020-03-19 15:46:50 -07:00
Components.kt Closes #7450: Lazy storage initialization 2020-03-19 15:46:50 -07:00
Core.kt Closes #7450: Lazy storage initialization 2020-03-19 15:46:50 -07:00
FenixSnackbar.kt For #8773: Fixes issue with snackbar placement on ContextMenu (#8942) 2020-03-12 09:54:13 -07:00
FindInPageIntegration.kt For #6992 Always hide toolbar when showing find in page bar (#7567) 2020-01-09 13:26:33 -08:00
FirebasePushService.kt fix #8135 - remove getColorFromAttr 2020-03-02 15:48:33 -07:00
FxaServer.kt Prepare for a-c a-s upgrade 2020-03-17 11:49:54 -04:00
InflationAwareFeature.kt fix #8135 - remove getColorFromAttr 2020-03-02 15:48:33 -07:00
IntentProcessorType.kt fix #8135 - remove getColorFromAttr 2020-03-02 15:48:33 -07:00
IntentProcessors.kt FennecWebAppIntentProcessor: Handle manifest file not existing. 2020-02-28 13:27:53 -08:00
NotificationManager.kt No issue: Use SendTabFeature and FxaPushSupportFeature 2020-01-03 10:20:53 -05:00
PendingSessionDeletionManager.kt For #5843 - Ensure tabs pending deletion are removed 2020-02-25 16:53:52 -08:00
PerformanceComponent.kt For #8034: Create a post-visual completeness executor 2020-02-28 09:15:06 -08:00
PermissionStorage.kt No issue: Normalize license header comment (#3909) 2019-07-12 11:38:15 -07:00
PrivateShortcutCreateManager.kt For #7730 - always show "Add private browsing shortcut" in sett… (#7943) 2020-01-27 08:44:28 -08:00
Push.kt Log push crashes to CrashReporter 2020-03-03 12:46:37 -05:00
Search.kt Adds custom search engines (#6551) 2019-11-19 16:30:56 -08:00
Services.kt For #5182: Loading experiments on startup is slow, remove Fretboard (#7510) 2020-01-13 12:38:32 -06:00
StoreProvider.kt No issue: Removes deprecated usage of ViewModelProviders 2019-08-07 19:21:41 -04:00
TabCollectionStorage.kt For #8016 - Prevent duplicate domains from displaying inthe collection description on the home screen 2020-02-10 10:50:07 -08:00
TopSiteStorage.kt For #8126 - Adds default top sites 2020-02-14 14:39:58 -08:00
TrackingProtectionPolicyFactory.kt For #8540: Fix ETP options not being correctly applied (#8688) 2020-02-26 12:25:40 -08:00
UseCases.kt Use ManifestUpdateFeature 2019-11-07 14:50:24 -08:00