Commit Graph
336 Commits
Author SHA1 Message Date
Eugen Sawin 05227ed0f9 Bug 1509266 - [2.0] Update onContextMenu delegate implementations. r=snorp
Differential Revision: https://phabricator.services.mozilla.com/D12968
2018-11-27 20:30:47 +00:00
James Willcox 2f121855cc Bug 1509146 - Remove default implementations in GeckoView interfaces r=nalexander
JaCoCo chokes on default implementations in interfaces, so remove those
for now.

Differential Revision: https://phabricator.services.mozilla.com/D12607
2018-11-23 19:42:26 +00:00
Jan Henning 7910c8377e Bug 1500023 - Only process previous session file once per app startup. r=nalexander
Even if the GeckoApp activity is destroyed, the user's tabs remain open as long
as the app process itself isn't killed.
Therefore, for users who aren't automatically restoring their previous session's
tabs on startup, there's no point in renaming the current session store file so
it appears under "Recently closed" instead of being automatically restored,
unless we're really doing a cold startup (and hence mIsRestoringActivity is
false).
This also better matches what we do when we *are* automatically restoring tabs:
We only do it when !mIsRestoringActivity, too.

Differential Revision: https://phabricator.services.mozilla.com/D11800
2018-11-22 17:10:49 +00:00
Eugen Sawin 8d70659833 Bug 1499418 - [3.2] Refactor and move Fennec's telemetry classes to geckoview/. r=jchen 2018-11-13 17:39:27 +01:00
Jan Henning b02d8544d7 Bug 1506699 - Make dumping a profile to disk easier when using MOZ_PROFILER_SHUTDOWN. r=snorp
We're already have some special handling in the Android UI when detecting
MOZ_PROFILER_STARTUP, so we might as well handle MOZ_PROFILER_SHUTDOWN, too.

This means two things:
1. In order to actually quit the app, the "Quit" button needs to be enabled.
2. We need to wait until we're sure that the profile has been dumped to disk
   before finishing the activity (and thereby possibly killing our process).

Differential Revision: https://phabricator.services.mozilla.com/D11696
2018-11-13 06:55:03 +00:00
Jan Henning e7eac4c3ef Bug 1485151 - Part 2 - Switch our whitelisting of StrictMode violations to try-with-resources. r=jchen
In my opinion this is an altogether nicer way of setting and resetting temporary
StrictMode exceptions. The only fly in the ointment is that this causes a
warning about a technically unused variable that subsequently needs suppressing.

Differential Revision: https://phabricator.services.mozilla.com/D4889
2018-09-04 22:28:22 +02:00
Gurzau Raul a104f2fafe Backed out 2 changesets (bug 1485151) on developer's request
Backed out changeset 2e667a7854b6 (bug 1485151)
Backed out changeset bae80c903001 (bug 1485151)
2018-09-04 23:38:35 +03:00
Jan Henning 65cfe2b403 Bug 1485151 - Part 2 - Switch our whitelisting of StrictMode violations to try-with-resources. r=jchen
In my opinion this is an altogether nicer way of setting and resetting temporary
StrictMode exceptions. The only fly in the ointment is that this causes a
warning about a technically unused variable that subsequently needs suppressing.

Differential Revision: https://phabricator.services.mozilla.com/D4889
2018-08-22 21:53:54 +02:00
Michael Comella aa71123c2f Bug 1373964 - On profile migrate, delete <dir>/res/fonts. r=vladbaicu
The previous implementation attempted to delete files from /res/fonts (i.e.
root). I don't believe this was intended either:
https://bugzilla.mozilla.org/show_bug.cgi?id=878674#c0 indicates the fonts
directory should be inside the data dir of the application. The crash occurs
when the /res/fonts directory exists (only some devices) but the user doesn't
have read access. If the user has write access, our code may actually delete
these system files: uh oh!

My fix is to change the deletion from /res/fonts to <dir>/res/fonts. I verified
this fix worked by creating a clean profile, adding dummy files to the
res/fonts dir, and making sure only the correct ones were deleted (in zsh):

export DIR=/data/data/org.mozilla.fennec_mcomella; \
    adb shell pm clear org.mozilla.fennec_mcomella && \
    adb shell mkdir -p $DIR/res/fonts && \
    for i in touch.ttf lol.rdf; do adb shell touch $DIR/res/fonts/$i; done && \
    adb shell ls $DIR/res/fonts

MozReview-Commit-ID: 8atpcjYjGu0
2018-08-14 18:43:42 -07:00
Jan Henning e728b16485 Bug 1476106 - Part 5 - Subscribe PromptService to OrientationChangeListener, too. r=snorp
Now that GeckoScreenOrientation generally offers notifications of screen
orientation changes, the PromptService no longer needs to do its own orientation
tracking and require to be fed orientation changes from each activity using it.

MozReview-Commit-ID: K7KbDsQip7b
2018-08-02 21:17:07 +02:00
Jan Henning e6691c643a Bug 1476106 - Part 3 - Move GeckoScreenOrientation updates into GeckoView. r=snorp
By moving the calls to GeckoScreenOrientation.update() into GeckoView, any app
using a GeckoView will automatically update the screen orientation in Gecko,
too, without any further action being required by the embedding app.

The synchronisation around GeckoScreenOrientation.update()/(un)lock() is
required for the following scenario:
If (un)locking of the screen orientation as requested by Gecko caused the
actual screen orientation of the app to change, there are two ways in which this
will cause our internal screen orientation to be updated:
1. Either the call to delegate.setRequestedOrientationForCurrentActivity
   (happening on the Gecko thread if the original request to (un)lock came from
   Gecko) returns first and update() is subsequently first called from the Gecko
   thread, too, meaning the onOrientationChange notification to Gecko can occur
   synchronously as well. In that case, as soon as (un)lock returns to Gecko,
   querying our internal screen orientation will return the correct value.
2. Or else the GeckoView.onConfigurationChanged() call resulting from the screen
   rotation manages to call GeckoScreenOrientation.update() first and does so
   from the Android UI thread. This means that the onOrientationChange
   notification will be redispatched asynchronously to the Gecko thread, while
   the Gecko thread's call to GeckoScreenOrientation.update() will return early
   without doing any work, as the screen orientation had already been previously
   updated by the UI thread.
   As a result,there will be a period of time between the Gecko thread returning
   from GeckoScreenOrientation.(un)lock() and the onOrientationChange
   notification finally executing where querying the internal screen
   orientation will not yet return the new orientation. This can cause problems
   for Gecko (test) code that expects to (un)lock the orientation and then be
   able to immediately query the new, changed orientation after the call to
   (un)lock returns.

Without additional measures in place, there are no guarantees at what point
the GeckoView will receive the onConfigurationChanged() call in relation to the
request to change the activity's orientation making its way back to (un)lock().
Therefore, we add synchronisation such that no other thread will be able to up-
date the screen orientation in GeckoScreenOrientation while another thread is
still busy (un)locking the screen orientation.

MozReview-Commit-ID: 5s5NEJcuS0p
2018-08-12 13:31:59 +02:00
Jan Henning c26f2878b5 Bug 1476106 - Part 1 - Make it possible to notify Java listeners from GeckoScreenOrientation, too. r=snorp
Once responsibility for notifying GeckoScreenOrientation of potentially changed
screen orientations moves from GeckoApp into GeckoView, the former will no
longer be able to benefit from the return value of calling GeckoScreen-
Orientation.update(), indicating whether the orientation actually changed or in
fact remained the same.

GeckoApp however requires that information in order to reset/refresh parts of
the UI when the orientation changes, and since GeckoScreenOrientation is already
doing all the work of tracking screen orientation changes, we don't want to have
to partially duplicate those efforts again in GeckoApp.

Instead, we introduce a mechanism for GeckoScreenOrientation to notify
interested parties on the Android app side as well.

The GeckoScreenOrientation.update() call in GeckoApp.onResume() is removed
completely (as opposed to merely removing the refreshChrome() bit) at this stage
already because it is unnecessary. If any screen rotation happened while the
activity was in background, it will receive an onConfigurationChanged() call
anyway before being resumed again.

MozReview-Commit-ID: Ila1evcj8Ud
2018-08-02 21:10:33 +02:00
Jan Henning b194b1e1b1 Bug 1476106 - Part 0 - Cleanup imports. r=JanH
MozReview-Commit-ID: UHUdrWSIks
2018-08-02 20:51:17 +02:00
Petru Lingurar 2445ac9dcd Bug 1474888 - Fix Prompt.java's AlertDialog; r=jchen
PromptService will be informed when the screen is rotated and in turn it will
ask every Prompt shown to reset it's current layout.
For this, every Prompt will
- save it's current input value in PromptInput's mValue or similar field
already used for storing the default PromptInput value.
- create a new widget to be used in the new AlertDialog, with a new appropriate
layout for portrait / landscape. This is when the mValue field will be used
to initialize the new widget with the previous input.

MozReview-Commit-ID: L6eHyGNDt3d
2018-07-26 09:37:26 +03:00
Vlad Baicu 09f0c43db1 Bug 1474961 - Change StumblerService to a foreground service when targeting Android Oreo. r=jchen
Also made broadcasts involving Stumbler explicit.

MozReview-Commit-ID: 7CK2Cr2JqX0
2018-07-11 20:02:24 +03:00
Petru Lingurar 5580ddb70b Bug 1386192 - Test Leanplum Custom Message for Onboarding; r=cnevinchen+582291
Created LeanPlumVariables to allow LeanPlum overwriting the values used for
populating the OnBoarding screens. By simply adding the @Variable annotation
to it's fields, on the first run of the app, they will appear in "LeanPlum
dashboard - Variables" and will allow overwriting for future runs.

The OnBoarding process will now try to use LeanPlum values if possible.
Because connecting to LeanPlum and downloading the Variables might take
a few seconds we use a delay of up to 3 seconds until starting to show
the Onboarding screens.
The default values will still be used if:
- if the LP experiment is not available
- if no internet connection
- if more than 3 seconds have passed and LP didn't finish it's download

Added two new events that could be tracked to Leanplum
MmaDelegate.ONBOARDING_DEFAULT_VALUES and MmaDelegate.ONBOARDING_REMOTE_VALUES
to inform if showing the Onboarding with server values was possible or not.

Because of the 3 seconds delay until showing the Onboarding panels leaking the
could be possible. Used WeakReferences for both the Activity in
OnboardingHelper and the OnboardingHelper in MmaLeanplumImp to avoid it.

MozReview-Commit-ID: H30e9Ng7jrM
2018-07-04 12:56:20 +03:00
James Willcox 8841d5866c Bug 1465480 - Add ContentDelegate.onCrash() r=jchen,droeh
This will give applications the opportunity to recover from a content
process crash.

MozReview-Commit-ID: IAfVNy3ndS4
2018-06-08 15:34:08 -05:00
James Willcox 0f2b94166e Bug 1433968 - Use GeckoRuntime to launch Gecko in Fennec r=jchen
MozReview-Commit-ID: AUrvsFWDuhY
2018-05-10 16:42:23 -05:00
Tiberius Oros 8b87c0b363 Backed out 6 changesets (bug 1433968) for Android failures on GeckoRuntimeSettings on a CLOSED TREE
Backed out changeset bba1deb626b5 (bug 1433968)
Backed out changeset 7a8616427aea (bug 1433968)
Backed out changeset c94c48d76350 (bug 1433968)
Backed out changeset 64cccb490a2a (bug 1433968)
Backed out changeset 62f865eed952 (bug 1433968)
Backed out changeset 5ed1e3af37ba (bug 1433968)
2018-05-10 18:11:55 +03:00
James Willcox 707d9b7e5a Bug 1433968 - Use GeckoRuntime to launch Gecko in Fennec r=jchen
MozReview-Commit-ID: AUrvsFWDuhY
2018-05-10 08:34:07 -05:00
Eitan Isaacson 392de1f884 Bug 1449364 - Create SessionAccessibility for GeckoSession. r=jchen r=yzen 2018-04-12 13:46:47 -07:00
Margareta Eliza Balazs dacc6fec21 Backed out 2 changesets (bug 1449364, bug 1453278) for rc4 and 42 perma failures in layout/base/tests/test_bug332655-2.html and testInputConnection on a CLOSED TREE
Backed out changeset 7149139c60d9 (bug 1449364)
Backed out changeset bcfee006ebaa (bug 1453278)
2018-04-12 15:30:20 +03:00
Eitan Isaacson 2302d1e7dd Bug 1449364 - Create SessionAccessibility for GeckoSession. r=jchen r=yzen 2018-04-11 15:21:00 +03:00
Nevin Chen f2735c608e Bug 1399388 - Only when new page is exactly 'about:home' will be treated as default home page. r=sdaswani 2018-04-03 18:45:48 +03:00
Eugen Sawin 904b7ed712 Bug 1445420 - [2.5] Add default runtime fallback for Fennec and unattached views. r=snorp,jchen 2018-04-09 20:39:59 +02:00
Jan Henning 05ab192225 Bug 1179698 - Part 1 - Put input focus on the URL bar when opening a new tab via keyboard. r=jchen
MozReview-Commit-ID: 2iZkO8FDB3R
2018-03-29 20:55:11 +02:00
James Willcox cfebba2118 Bug 1437701 - Add GeckoSession.ContentDelegate.onExternalResponse() r=esawin,droeh
This can be used to allow the app to handle downloads.

MozReview-Commit-ID: DlCNcP3quoO
2018-03-30 11:31:04 -05:00
Eugen Sawin fbeabc628e Bug 1445240 - [1.0] Add element type to onContextMenu callback for image and media elements. r=snorp 2018-03-13 20:25:05 +01:00
James Willcox 0d34b6015c Bug 1443659 - Rename GeckoSession.openWindow and closeWindow r=esawin,droeh
MozReview-Commit-ID: 1zhNRw2OJ7y
2018-03-08 08:56:34 -06:00
Noemi Erli b50b77936a Backed out 3 changesets (bug 1443660, bug 1443659, bug 1443658) for android-checkstyle bustage on a CLOSED TREE
Backed out changeset c8275e1f531e (bug 1443659)
Backed out changeset bbb5759485fe (bug 1443660)
Backed out changeset 69b649d8c1d1 (bug 1443658)
2018-03-08 02:53:31 +02:00
James Willcox 3a6f83de45 Bug 1443659 - Rename GeckoSession.openWindow and closeWindow r=esawin,droeh
MozReview-Commit-ID: 1zhNRw2OJ7y
2018-03-07 17:44:44 -06:00
Jim Chen 6d247cef2c Bug 1442255 - 4. Use extras bundle to initialize Gecko in Fennec; r=esawin
Use extras bundle (e.g. from an Intent) to initialize Gecko in GeckoApp
and GeckoService.

MozReview-Commit-ID: AmLZ8Uir8f4
2018-03-06 13:52:50 -05:00
Gurzau Raul 8e6714051b Backed out 7 changesets (bug 1442255) for failing c1 tests on mochitest/test_browserElement_inproc_PurgeHistory.html
Backed out changeset 208c4c42f641 (bug 1442255)
Backed out changeset 6a794e14fceb (bug 1442255)
Backed out changeset 62d1c57c37b4 (bug 1442255)
Backed out changeset 5d0f72867f53 (bug 1442255)
Backed out changeset c3305648ad30 (bug 1442255)
Backed out changeset 08f906f3a0c8 (bug 1442255)
Backed out changeset d7a43e59a1b4 (bug 1442255)
2018-03-06 17:08:57 +02:00
Jim Chen 7680140a1e Bug 1442255 - 4. Use extras bundle to initialize Gecko in Fennec; r=esawin
Use extras bundle (e.g. from an Intent) to initialize Gecko in GeckoApp
and GeckoService.

MozReview-Commit-ID: AmLZ8Uir8f4
2018-03-06 00:04:56 -05:00
Sebastian Hengst 2ef8464bbe merge mozilla-central to mozilla-inbound 2018-03-01 20:32:20 +02:00
Tiberius Oros 0e49912cc8 Merge inbound to mozilla-central. a=merge 2018-03-01 19:29:00 +02:00
Cosmin Sabou 1ba0cb7655 Backed out changeset 2b86e947b043 (bug 1432487) for Android build bustages on several files that were renamed. CLOSED TREE 2018-03-01 00:29:12 +02:00
Dylan Roeh b66e3d995c Bug 1432487 - Rename all *Listeners to *Delegates and corresponding minor changes. r=snorp,jchen 2018-02-28 16:36:36 -05:00
Dylan Roeh b841fe60df Bug 1435500 - Close the existing GeckoSession if it exists during GeckoApp.onCreate() r=jchen 2018-02-28 15:56:39 -05:00
Dylan Roeh 2617ae421a Bug 1432487 - Rename all *Listeners to *Delegates and corresponding minor changes. r=snorp,jchen 2018-03-01 08:49:52 -05:00
Jan Henning 302491698a Bug 1437382 - Part 4 - Make sure that flushing private tabs data reaches GeckoApp in time. r=jchen
There are two parts to this:
1. While the file writing itself by the session store can be done either
   synchronously or asynchronously, the session store's _writeFile function as
   a whole always behaves asynchronously. In addition, just writing the file
   (which will be done synchronously when flushing tabs) takes time which we
   don't have, as we should send the private tabs data as fast as possible to
   Java in order to avoid hanging the UI or missing a possible timeout.
2. Sending the data to Java needs to happen synchronously as well, so we need
   to listen for "PrivateBrowsing:Data" on the Gecko thread now. This in turn
   means that some sychronisation is now required between the UI thread handling
   onSaveInstanceState and the Gecko thread that is actually receiving the data.

To avoid hanging the UI and causing ANRs, we only wait a limited amount of time
for Gecko to respond with fresh private tabs data, though.
As this still leaves a certain possibility of outdated private browsing data
being saved and possibly restored after an OOM-kill, we're also going to speed
up the processing of TabClosed events by the session store in the following
parts.

MozReview-Commit-ID: EkNFre5RhQW
2018-02-11 17:54:58 +01:00
Jan Henning 812e538e19 Bug 1437382 - Part 3 - Flush session store tab data separately from application-background. r=jchen
We need to block onSaveInstanceState until we're sure that our private browsing
data is up to date, however we can't block on the whole of our application-
background handling (GeckoThread.onPause), as that will take too much time.

In addition, we need to update the stored tab data not just when the application
goes into the background, but every time we're leaving GeckoApp and onSave-
InstanceState is called, e.g. when visiting our settings activity.

MozReview-Commit-ID: DgtUvatD6h3
2018-02-22 19:55:13 +01:00
Jan Henning 47eb792367 Bug 1437382 - Part 0 - Cleanup imports (and unused variables). r=jchen
MozReview-Commit-ID: HdscZ9Ky159
2018-02-22 19:48:07 +01:00
James Willcox 2ed433a309 Bug 1439747 - Add GeckoSession.ContentListener.onCloseRequest() r=jchen,droeh
MozReview-Commit-ID: CPUVfe1LKDW
2018-02-22 09:18:33 -06:00
Eugen Sawin 0478424983 Bug 1432235 - [1.2] Move GeckoView API classes to org.mozilla.geckoview. r=snorp,jchen 2018-02-22 00:46:26 +01:00
Grigory Kruglov cf3a32e48c Bug 1429735 - Pre: cleanup some unused helper methods r=nalexander
MozReview-Commit-ID: vpnFdFYf4V
2018-01-23 16:05:11 -05:00
Jim Chen 197a96e299 Bug 1391268 - 4. Display message when APK is corrupt; r=snorp
Display a message on startup when the APK is corrupt. Right now the
"wrong SDK" message is displayed. I think we can potentially reuse that
message for Beta, but we need a different message for Nightly.

MozReview-Commit-ID: 9NEw252Ytkc
2018-02-14 16:56:54 -05:00
Jan Henning a7f339f6b8 Bug 832990 - Part 0 - Improve comment wording. r=Grisha
Since custom tabs and PWAs were moved to GeckoView, we're down to one
GeckoApp-based activity again.

MozReview-Commit-ID: 1zO6JTDptpp
2018-01-25 20:46:27 +01:00
Dylan Roeh a6c3d6d348 Bug 1419463 - Add onFocusRequest to ContentListener API. r=snorp
This listens for "DOMWindowFocus" and calls onFocusRequest in the GeckoSession ContentListener whenever it is received, and implements onFocusRequest for custom tabs and PWAs.
2018-01-29 10:38:46 -06:00
Jan Henning f34d287cdf Bug 1423566 - Hide tabs tray when receiving an Assist App intent. r=nechen
We're still somewhat undecided on how to exactly handle external intents
arriving while the tabs tray is open, however in the case of Assist App intents
- opening a new tab in editing mode while the tabs tray remains open causes some
  weird behaviour (the keyboard appears in front of the tabs tray and no matter
  which tab is selected on the tabs tray, you first enter editing mode and then
  always end up in the tab opened by the Assist App intent)
- the goal of our Assist App intent handling is to allow the user to enter a
  search query or an address into the URL bar

hence we should hide the tabs tray (if open) when handling such an intent.

MozReview-Commit-ID: GpwrscdNjZP
2018-01-05 17:33:06 +01:00