Flush IME changes when committing or canceling the composition, before
sending a notification, so that the Gecko and Java sides are on the same
page.
Also, use the GeckoEditableListener constants when calling notifyIME so
we don't rely on the Gecko platform constants having the same values as
our Java constants.
The finder component has a quirk that the first time it searches for a
string it may find text that's normally not included in the search
result (e.g. the placeholder text in an input element). I think rather
than fixing the quirk, which seems risky, it's better to work around it
by performing a fake dummy search when first showing the find bar. On
desktop, we also (I think unintentionally) perform a dummy search when
the find bar first appears.
This is a quick sanity check: a clean profile should return all the suggested
sites directly.
We should probably add further tests making sure that history items appear
in front of the suggested sites, that pinned sites work correctly,
and that suggested sites don't appear outside of the grid.
MozReview-Commit-ID: Ai8gTkv9E9w
This means we now have only one open cursor for the topsites query, instead of 2 real cursors (and one
MatrixCursor). We still need a MergeCursor and MatrixCursor to supply blank tiles, this will
disappear as soon as the user has sufficient history items to fill the suggested sites grid.
MozReview-Commit-ID: LnJaSMIDM2O
Note that this version only returns topsites, pinned sites, and suggested sites.
Blank tiles aren't supplied, and need to be added separately.
MozReview-Commit-ID: 5Vc5pXTewHi
We'll need access to the SuggestedSites in BrowserProvider when assembling the
topsites query there, hence we need to allow access via BrowserDB.
MozReview-Commit-ID: BkZghDhQGxr
This allows us to more easily append multiple sets of args.
TODO: is it worth naming this appendSelectionArgs? We should keep the
2-param version appendSelectionArgs since it's more efficient for that
case (and the vast majority of uses are with 2-params) - it's probably
simpler for development to have both versions have the same name, and
as far as I can tell the compiler will prefer the non varargs version
when possible.
MozReview-Commit-ID: LcI6zNwpIxh
Setting GRADLE_USER_HOME in this way ensures all Gradle invocations in
automation have the right flags, rather than just the ones we
remember.
MozReview-Commit-ID: IL53nZVsFuV
Set the prompted pref along with the enabled prefs so that we don't have
to detect setting the enabled pref elsewhere in order to set the
prompted pref.
DONTBUILD NPOTB
Android Studio (and IntelliJ) does not correctly handle &entity;
definitions in Android strings.xml files. Strings with entities (in
Fennec, all of them) are rendered in the IDE as blank. This patch
expands the entities when copying for use by Gradle, improving the IDE
integration.
MozReview-Commit-ID: 2T6CzoKc7v8
DONTBUILD NPOTB
Using the real Android manifest tripped up Robolectric, so I've taken
the easy way out and added a dummy TestGeckoApplication; see comment
in the code.
MozReview-Commit-ID: 4fCY504UgPu
This commit adds the GzipNonChunkedCompressingEntity which is necessary because
the telemetry servers don't support chunked uploading, which the built in
GzipCompressingEntity does.
I tested this on my local device and logs for successful uploads were sent for
both the testing gzip server as well as the official telemetry server. My data
correctly appears on the former and I did not check the latter.
MozReview-Commit-ID: 4bCNiRYyqFD
Added testGetDir to sanity check how the profile is set up for the test and
left it in as a bonus.
Additionally, changed access levels on the ensureParentDirs method because it
only needed to be `protected` for testing.
MozReview-Commit-ID: CDVQjyf3yP2
Additionally, we log some of the Exceptions thrown while retrieving the client
ID to make it clearer what is happening. The underlying GeckoProfile methods
ensure the profile path is not printed so we don't have to worry about leaking
that.
MozReview-Commit-ID: 3o0rvXDRZzM
Fennec enables sCaretsExtendedVisibility which uses
Appearance::NormalNotShown instead of Appearance::None to keep actionbar
shown during scrolling. This breaks selection mode update when the
positions of the carets are not changed after scrolling.
To fix this, we need to implement appearance recovering for selection
mode scrolling like we did for cursor mode in bug 1212732, and make
UpdateCaretsForSelectionMode() respects UpdateCaretsHint.
MozReview-Commit-ID: LkfUIGKHL0h
When using physical keyboards, we get key events on the UI thread. To
improve performance, and to support key listeners better, we should
switch the IC thread to the UI thread in that case.
Right now, processKey uses a IC-thread proxy in order to handle key
events on the UI thread. This patch makes it post the key event to the
IC thread and avoid the proxy entirely.
Be warned. Do not attemp to change the .js "test" source code in ./js
They are meant to check
- the outdated 0666 octal constant is still parsed correctly,
- the outdated 0666 octal constant raises syntax error flag
in strict mode, etc.
So leave them alone.
Opt-in by adding --enable-gradle-mobile-android-builds.
Gradle dependencies (including the Android-Gradle plugin) are assumed
to be present. Local developers will fetch them from the jcentral
repository.
Android-specific Maven dependencies are shipped as "extras" with the
Android SDK, and should be found automatically by the Android-Gradle
plugin.
MozReview-Commit-ID: 966XgddWgEu
When doCreateShortcut was first created, it also handled webapp intents. This required additional
work, meaning doCreateShortcut had to be run on the background thread. We now only
create an Android Intent, with no additional work, hence we can run directly on the UI thread.
MozReview-Commit-ID: BFrAuNfDiFj
Fennec enables sCaretsExtendedVisibility which uses
Appearance::NormalNotShown instead of Appearance::None to keep actionbar
shown during scrolling. This breaks selection mode update when the
positions of the carets are not changed after scrolling.
To fix this, we need to implement appearance recovering for selection
mode scrolling like we did for cursor mode in bug 1212732, and make
UpdateCaretsForSelectionMode() respects UpdateCaretsHint.
MozReview-Commit-ID: LkfUIGKHL0h
Opt-in by adding --enable-gradle-mobile-android-builds.
Gradle dependencies (including the Android-Gradle plugin) are assumed
to be present. Local developers will fetch them from the jcentral
repository.
Android-specific Maven dependencies are shipped as "extras" with the
Android SDK, and should be found automatically by the Android-Gradle
plugin.
MozReview-Commit-ID: 966XgddWgEu
This fixes a crash, since Bug 1242213 removed the .App
<activity-alias> that browser_intent_class references.
I debated just updating the strings, and decided that it was best to
remove a pattern that is used only once in our codebase, even though
it moves more functionality to code.
MozReview-Commit-ID: 4Wgw0oITgue
When Java is changing the composition, we should ignore the Gecko
selection. However, when Gecko is committing its composition, we should
not be ignoring the corresponding Gecko selection change. In other
words, we should only ignore selection changes when we know the change
is from Java.
See
https://android-developers.blogspot.com/2013/08/some-securerandom-thoughts.html
for a thorough discussion.
It's very expensive (at least 200ms on modern devices) to do this in
Application.onCreate, so we'll do this just before generating DSA keys.
In exchange, we accept some risk that we'll introduce the same issue
again. As we lint more aggressively in automation, this risk will
decrease.
Google licenses the fixes file very permissively. I have added some
serialization IDs to prevent certain compile warnings.
This patch adds 2 workarounds for the fact that getProfileCreationDate
returns -1 when it can't find a creation date. Returning -1 turned
out to be not particularly robust but I did it this way to avoid
adding too many additional versions of methods in order to have
optional parameters such as profileCreationDate. The workarounds
are added as TODOs w/ bug #'s in the code and mentioned in the
comments of bug 1246816 itself.
A future implementation should probably add a Builder to pass a
single Object as the argument to TelemetryPingGenerator.createCorePing
to prevent the argument list from growing unreasonably large and
to properly operate on optional parameters. I didn't do this in
this patch in order to simplify the uplifted code.
Retrieving the profile creation date from the filesystem is not strictly
necessary to upload this data and returns -1 until it is implemented. If the
decision is r+'d here, it will be implemented in bug 1246816.
On a CLOSED TREE because this is Android only.
When we switched to fine-grained Google Play Services bundling (Bug
1115004), we stopped shipping com.google.android.gms.analytics. That
silently breaks Adjust, which queries the Google Ad ID using
reflection: now the package isn't present! This patch restores the
Play Services libraries that Adjust relies on. (Sadly, this bloats
our APK tremendously.)
There is some hijinkery, however: the Play Services libraries
reference a library (org.apache.http) that is deprecated in Android
23! However, the library is still present on Android 23 devices,
which buys Google time to replace the offending code. This compiles
just fine, breaks the Proguard global optimization pass. To give
Proguard the information, we add the library as a Proguard "library
JAR". This is equivalent to the Google-provided Gradle `useLibrary`
directive.