* Rename enum Mode to IconType, and added some types
* to map IconType to drawable-image-level
* add unit test
function `resolve` now returns IconType. IconType is abstraction and
independent from Drawable. It defines possible values of resolving
SiteIdentity.
We use a map to get correspond Drawable image level, then no need to
worry about Drawable-changing and algorithm.
Although unit test haven't cover all possible cases. But it passed
original implementation of `ToolbarDisplayLayout.updateSiteIdentity`.
It means `SecurityModelUtil.resolve` will not have obviously
regression....theoretically.
MozReview-Commit-ID: 3E0JMeBlg8D
In some cases, user might see flash in first launch of CustomTabs.
This issue could be fixed once we have GeckoView based implementation.
Before it comes, we just hide content for a while as a workaround.
This workaround is in SingleTabActivity since we also want to benefit
WebApps.
MozReview-Commit-ID: HenLSOqROA2
It's possible that a sync fails very early, for example while talking to the token server. In that case,
we wouldn't have uid/deviceID available in the sync telemetry bundle.
MozReview-Commit-ID: 7OB1Er37qo8
Replace usages of GeckoAppShell.getContext() with
getApplicationContext() if possible, or the current Activity if the
usage expects an Activity context.
MozReview-Commit-ID: 9GOWszgEsQu
Make PromptService and Prompt.jsm not depend as much on BrowserApp and
the main Fennec window, so it can be used from a GeckoView-based custom
tabs Activity. This approach is used because it involves a lot less work
than trying to implement a PromptDelegate for Fennec.
MozReview-Commit-ID: AEH0HgAOx2S
Strangely enough, this patch seems to appease findbugs.
While dodgy indeed, I think this casting is acceptable in this case since we control
both sides of the equation (sender & receiver of telemetry), but can't easily do away
with casting.
MozReview-Commit-ID: FBTkRqKPtxt
This patch includes some "pre" work, which should have been a separate patch (my apologies!):
- telemetry ping is (needlessly) coupled with information about where it should
be uploaded. It wasn't a problem before, since core pings are "upload right away",
and are never bundled together during an upload. However, for sync ping, we need to
bundle a bunch of "syncs" and "events" (down the road) into one single "sync ping", and as such
we need a separate representation for a "ping that is not meant to be uploaded directly".
- instead of dealing with the coupling directly, a simpler approach is taken:
- a "ping" is split into two types of pings: local and outgoing
- outgoing ping is what the old "ping" was - a data bundle that is ready to be uploaded
- local ping is not meant to be uploaded directly, but is intended to be a part of an
outgoing ping, along with other local pings
- the main difference between local and outgoing pings is the URL: local pings don't have
it while outgoing pings do have it.
As background telemetry is received via LocalBroadcastManager, it is processed as follows:
- telemetry data is processed into "local pings" which are stored on disk
- as enough telemetry is gathered, or we hit one of "let's upload now" conditions, the
persisted local pings are gathered into an "outgoing ping" via a SyncPingBundleBuilder,
which is persisted on disk.
- upload of the bundled "sync ping" is attempted
- as individual "local pings" are processed into outgoing "Sync ping" bundles, they are removed
from disk
Hooks for the upcoming event telemetry data are in place to make that follow-up work easier.
MozReview-Commit-ID: 6uXi6pjXiSv
This means we'll at least see a sensible exception, instead of an NPE when
no anchor is set. That makes it easier to debug cases where no anchor was
set (see e.g. the main commit from this bug).
MozReview-Commit-ID: CzsZaHvnZ6y
Adds support for opening FxA deep links, a la firefox://fxa-signin
Whitelisted set of query parameters::
- signin - expected to be the "magic token"
- entrypoint - for internal tracking purposes
- utm_* - all query parameters with utm_ prefix are allowed
Deep links are opened as: about:accounts?signin=<token>&entrypoint=<entrypoint>&utm_one=<utm1>....
MozReview-Commit-ID: LfGi1ChPvUr
At the moment, we forward these from GeckoActivity, which means that they won't work if no GeckoActivity-based activity is active (can happen within our settings for example).
As of API14, we can now register an app-wide ComponentCallbacks(2) class, allowing us to easily receive low memory notifications no matter which activity is currently alive.
MozReview-Commit-ID: 5GjSjsTKxAD
We're already doing this in the tab strip, but this presumably didn't cover the initialisation via TabStripView.refreshTabs().
MozReview-Commit-ID: Abdk1mD5HyZ