5864: Fixed `ContextMenuFeature` and `DownloadsFeature` not working for non-selected normal tab r=pocmo a=JasonHK - Added `BrowserState.findTabOrCustomTabOrSelectedTab` extension method. - Fixed `ContextMenuFeature` not working for non-selected normal tab. - Fixed `DownloadsFeature` not working for non-selected normal tab 5997: Closes https://github.com/mozilla-mobile/android-components/issues/5792: Potential deadlock between unsubscribe and dispatch r=pocmo a=csadilek As with our previous deadlock fix, we do **not** want to change the lock on the `Subscription`, as it guarantees we never dispatch to paused or stopped observers. However, the inner lock on `subscriptions` is only there for visibility purposes. We can achieve the same, namely making sure retrievals reflect the results of the most recently completed update, by using a concurrent HashSet: A set projection of https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ConcurrentHashMap.html This removes the potential of a deadlock and I don't see any change in semantics: The `removeSubscription` case is guarded by the `Subscription` lock and can't overlap with dispatching to the same subscription. The `addSubscription` case is guarded by the lock on the `Store` which is also required for `dipsatching`, so add and dispatch can't overlap either. @pocmo wdyt? 6008: Bug 1615248 - add missing nightly entry in .cron.yml r=pocmo a=MihaiTabara Follow-up from https://github.com/mozilla-mobile/android-components/pull/5967, I forgot to add its `cron.yml` corresponding entry for nightly releases. Co-authored-by: Jason Kwok <JasonHK@users.noreply.github.com> Co-authored-by: Christian Sadilek <christian.sadilek@gmail.com> Co-authored-by: Mihai Tabara <mtabara@mozilla.com>
Android Components > Browser > State
🔴 Note: This is an experimental component still under development. APIs may change at any time. It's not recommended to directly use this component in products yet.
The browser-state component is responsible for maintaining the centralized state of a browser engine.
The immutable BrowserState can be accessed and observed via the BrowserStore. Apps and other components can dispatch Actions on the store in order to trigger the creation of a new BrowserState.
Patterns and concepts this component uses are heavily inspired by Redux. Therefore the Redux documentation is an excellent resource for learning about some of those concepts.
Usage
Setting up the dependency
Use Gradle to download the library from maven.mozilla.org (Setup repository):
implementation "org.mozilla.components:browser-state:{latest-version}
License
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/