Commit Graph
93 Commits
Author SHA1 Message Date
Alastor Wu 2ce1f472f3 Bug 1290029 - go back to the playing tab when double clicking the control interface. r=sebastian
MozReview-Commit-ID: JfXm7vBKqfW
2016-08-09 17:19:11 +08:00
Carsten "Tomcat" Book 23747ec523 merge mozilla-inbound to mozilla-central a=merge 2016-07-30 16:20:57 +02:00
James Willcox c3412b379c Bug 1286133 - Use Android VideoView to play HLS r=sebastian,jchen 2016-07-29 17:02:35 -05:00
Broderick Stadden 587ef6788c Bug 1279301 - Move notification classes to notification folder. r=jonalmeida
Moved notification classes to notification folder.  Refactored uses which added
imports to some Gecko classes as well as the Notification classes.  Added getter
to GeckoAppShell for access to static NotificationClient. Changed paths in
AndroidManifest.xml.in to reflect changes.

MozReview-Commit-ID: 2CUJa0YsV1V
2016-07-27 13:57:22 -10:00
Jim Chen 7866cd2707 Bug 1285572 - Add and use loadUri method in GeckoView; r=snorp
Add a loadUri method in GeckoView that replaces the functionality of the
current LOAD_URI event in GeckoEvent, and make GeckoApp and BrowserApp
use the new call.

The implementation for loadUri differs from the previous implementation
of LOAD_URI by directly calling nsIBrowserDOMWindow::OpenURI, instead of
going through the command-line handler. This more direct approach lets
us get rid of the Fennec command-line handler entirely.
2016-07-20 21:43:34 -04:00
Tom Klein 91df063b67 Bug 1264347 - Refactor SnackbarHelper to use builder pattern. r=sebastian
MozReview-Commit-ID: 9WZBhhJIdNq
2016-07-11 09:42:01 -05:00
Jan Henning 555e8cf030 Bug 1284017 - Add telemetry for damaged session store files. r=sebastian
Just watching for a SessionRestoreException during startup can introduce some false positives, because that exception is triggered in any case where we can't restore tabs, not just when the session file has been damaged, e.g.:
- on first startup
- on builds affected by bug 1228593, users who are (theoretically) restoring their tabs, but clearing their history on exist end up with a deleted sessionstore.js
- should we implement bug 1275662, we'd hit that exception in that case, too.

Therefore we only send the telemetry event if we hit that exception even though a sessionstore.js file is present. We also exclude the case where the file size of sessionstore.js is 14 bytes, because that is most likely corresponding to a file containing only {"windows":[]}, which means that the session store intentionally wanted to write a file containing no tabs.

Currently this is only the case for users who are clearing their history on exit and are also *not* restoring tabs, however if bug 1275662 should get implemented, we'd probably encounter those empty files for users who have their restore setting set to "Always restore", too.

Because of bug 1261008, we can also end up with no restored tabs (and a SessionRestoreException) if the session file contains only about:home tabs with no history, because we're skipping those and not restoring them. To detect that case and exclude it from telemetry, we have to include additional logic within the SessionParser instance used during startup and pass those results back to the calling site in GeckoApp.

MozReview-Commit-ID: 6pAhDU3d8QA
2016-07-05 22:40:01 +02:00
Grigory Kruglov 71a5bfccb2 Bug 1245795 - Split Stumbler BroadcastReceivers into Local, System and Safe r=nalexander
SafeReceiver is responsible for registering LocalReceiver with a LocalBroadcastManager.
SystemReceiver is responsible for handling BOOT_COMPLETE and EXTERNAL_APPLICATIONS_AVAILABLE intents.
LocalReceiver is responsible for handling passed in Stumbler preferences (enabled state, API key, user agent).

StumblerPreferences are now sent using LocalBroadcastManager, avoiding any possibility of leaking API key.

MozReview-Commit-ID: J8pRN6pbLOg
2016-07-07 19:40:11 -07:00
Phil Ringnalda 9f7a578e0a Merge f-t to m-c, a=merge 2016-07-09 08:53:47 -07:00
Jim Chen 35a0f090be Bug 1283882 - Move location listener to GeckoAppShell; r=snorp
Move LocationListener implementation from GeckoApp to GeckoAppShell
because the LocationListener consumer is in GeckoAppShell.
2016-07-08 11:39:09 -04:00
Jim Chen d7e9fe3e33 Bug 1283844 - Implement sensor event listener in GeckoAppShell; r=snorp
Implement SensorEventListener directly in GeckoAppShell instead of
indirectly through GeckoInterface and GeckoApp, because the
SensorEventListener consumer is in GeckoAppShell.
2016-07-08 11:39:09 -04:00
Sebastian Kaspari 0ac1498989 Bug 1261008 - Do not restore tabs pointing to about:home and with no history. r=janh,ahunt
If the browser is set to always restore the session (default) then we will never
start with an empty session. Even if the user closes all tabs we will re-create
a new tab pointing to about:home. So we will always at least restore this tab on
the next startup. As a consequence we will never open the 'homepage' on app start
because we will never have a non-empty session.

With this patch we won't restore tabs that point to about:home and do not contain
any other history. As a result we might restore an empty session and load the
homepage or about:home (depending on configuration) in a new tab.

In case we decide to not restore the currently selected tab, we just select the
first restored tab if there's any.

MozReview-Commit-ID: DuN03M60Gi8
2016-07-06 16:04:01 +02:00
Nick Alexander 357e508d4d Bug 1281890 - Allow setting chromeURI from Java. r=snorp
The intention is that GeckoView consumers will not use browser.xul,
but instead geckoview.xul; and that they'll provide content URLs from
their assets/ directories.  This lets them do things without modifying
the omnijar and in particular without setting Gecko's prefs *before*
Gecko startup.

MozReview-Commit-ID: 2QLQQ5RphFu
2016-06-23 12:05:17 -07:00
Jonathan Almeida (:jonalmeida) d1323d4947 Bug 1075476 - Removing download notification restarts Firefox r=sebastian
MozReview-Commit-ID: 35pn1nntcsV
2016-05-25 14:18:10 -07:00
Jan Henning 34a8289bcc Bug 1279273 - Use correct synchronization object for session data parsing. r=sebastian
If the main thread has to wait for the session data parsing to finish - which is more likely when you've got many tabs open, meaning a large sessionstore.js file - it does so on "this", i.e. GeckoApp.
The session data parsing itself is done from within a Runnable, so we need to qualify "this" there if we want it to refer to GeckoApp itself, so we can successfully release any waiting threads through notifyAll().

MozReview-Commit-ID: 3LhJsI5rNU3
2016-06-12 19:45:50 +02:00
Michael Comella fea480d056 Bug 1279045 - Remove broadcastHealthReport* and its call sites. r=ahunt
MozReview-Commit-ID: G5Pz9l5GAi3
2016-06-08 13:50:12 -07:00
Jan Henning 1c1e0b7625 Bug 1251362 - Part 19 - Remove code and resources for the old Recent Tabs panel. r=liuche
MozReview-Commit-ID: FQJ7j8YlV6E
2016-05-26 17:40:19 +02:00
Jan Henning 6b10505a17 Bug 1251362 - Part 15 - Redirect direct loads of the Recent Tabs panel about:home URL to the Recent Tabs folder of the Combined History panel. r=liuche
After detecting multiple successive crashes in a row, we temporarily switch off automatic session restoring and display the Recent Tabs panel instead. As that panel is going to be removed, we intercept loads of the Recent Tabs panel about:home?panel=... URL and redirect them to the Combined History panel. We also use the facilities provided by bug 1060544 to jump directly to the Recent Tabs folder in that case.

MozReview-Commit-ID: 7dQ7tW2dD1M
2016-05-26 23:04:53 +02:00
Michael Comella 32967ac99d Bug 1277214 - Move remaining SafeIntentUtils functions to IntentUtils. r=grisha
I feel this better follows the util class pattern: IntentUtils acts on Intents
as StringUtils would act on Strings.

MozReview-Commit-ID: 7n2B9q1KlSy
2016-06-01 15:32:41 -07:00
Michael Comella d9505084d4 Bug 1277214 - Move SafeIntent to its own class. r=grisha
This gets used often enough that it's annoying to do full class name imports.

MozReview-Commit-ID: 7Yhp1NCgwQw
2016-06-01 15:27:41 -07:00
Carsten "Tomcat" Book 3a9cae6c4f Merge mozilla-central to fx-team 2016-05-30 15:31:42 +02:00
Jan Henning 494b5706a1 Bug 905223 - Part 2 - Move session data parsing into a background thread. r=jchen
Parsing the session store JSON data to restore the last session's tabs is both
- computationally relatively expensive
- involving disk I/O

therefore, we shouldn't be doing it on the main thread.

To make sure the session data is actually ready, subsequent code running from a different thread that needs to access it (loading the startup tab, the Recent Tabs panel reading the "Tabs from last time") checks that session store data processing has actually finished and waits if necessary.

MozReview-Commit-ID: EYf1fdglIrA
2016-04-23 22:36:46 +02:00
Jan Henning 253608c323 Bug 905223 - Part 1 - Factor out external URL calculation. r=margaret
For session data parsing, we need to know whether we were invoked with an external URL or not. Since we want to move session data parsing forward to an earlier point in time, but also continue needing that external URL info during initialize() as well, we'll factor out those calculations into their own functions which can then be called from both places.

MozReview-Commit-ID: HFlT8uxC9yz
2016-04-23 20:08:58 +02:00
Jan Henning 436963861f Bug 905223 - Part 0 - Add target API annotations to get rid of errors in Android Studio. r=margaret
Android Studio doesn't recognise our version guards and is consequentially always showing two errors in GeckoApp, which makes it more difficult to spot when you've introduced an actual error.

MozReview-Commit-ID: LpNIwHOhEWE
2016-04-23 22:29:03 +02:00
Carsten "Tomcat" Book 95e60db9e1 Merge mozilla-central to fx-team 2016-05-24 15:15:55 +02:00
Jim Chen a08654a95c Bug 1270870 - Don't get profile in GeckoApp when launching; r=snorp
Let GeckoThread manage the active profile, and don't get the profile in
GeckoApp. This also avoids possible main-thread IO.
2016-05-24 01:11:16 -04:00
Cesar Valiente b56a793b34 Bug 1272506 - Change GeckoApp.ONE_DAY_MS to be initialized with the TimeUnit class. r=mcomella 2016-05-14 11:42:04 +02:00
Michael Comella de0e96a2f3 Bug 1261210 - Rename omg.mozglue.ContextUtils -> omg.mozglue.SafeIntentUtils. r=mcomella
MozReview-Commit-ID: 99kZNBPmqes
2016-05-18 15:48:07 -07:00
Jim Chen bbdd84d17d Bug 1272557 - Delay initializing PushService and DLC; r=snorp
Delay initialization of PushService and DLC in GeckoApplication to after
the Gecko:Ready message. That way, hopefully they give up some CPU time
to other initialization tasks.
2016-05-27 14:29:46 -04:00
Jan Henning f8804fa118 Bug 1266339 - Part 2 - Delete outdated sessionstore.bak files when restoring tabs automatically. r=margaret
sessionstore.bak, which powers the "tabs from last time" display, is only updated with the data of the previous session if the user chooses to "never restore" tabs, or if we've temporarily disabled session restoring because of too many successive crashes in a row. In all other cases, we restore tabs automatically so sessionstore.bak is never updated with fresh data, meaning its contents get stale pretty soon.

With this patch, we clean up old copies of sessionstore.bak when doing an automatic restore, so they don't linger indefinitely in the "tabs from last time" section of the recent tabs panel.

MozReview-Commit-ID: DrOx5TNwYMv
2016-04-21 20:43:47 +02:00
Michael Comella 0b0dc68ed2 Bug 1269407 - Return early from all lifecycle methods if not supported system. r=sebastian
This avoids a problem where a lifecycle method may assume a previous lifecycle
method initialized some values but we returned early (e.g. on a not supported
system) so these values were never initialized and the application may crash.

I tested this patch by forcing HardwareUtils.isSupportedSystem to return either
true or false (but both were in a supported device configuration).

MozReview-Commit-ID: 1WvOId8CLjP
2016-05-12 15:59:34 -07:00
Michael Comella 3b73d2373c Bug 1245493 - Don't animate when showing toolbar when FF is first unhidden. r=margaret
After this patch, I still occasionally see the toolbar positioned part
way down from the top of the screen. However, this state looks slightly
less janky without the animation I removed and I can't consistently
reproduce it anymore.  Given the DynamicToolbar.setVisible calls I make,
I'd guess this is likely to be a bug caused by BrowserApp.onTabChanged
(and thus DynamicToolbar.setVisible) not getting called instantly and
so the DynamicToolbar is initialized to a different location on screen.
I'd guess it's a bug in DynamicToolbar as to why it's positioned partially
off-screen.

There is a little bit of code duplication, but that is because the code
to load a url on a new intent is duplicated (i.e. once from GeckoApp.initialize
- the initial load - and once from GeckoApp.onNewIntent). This could
potentially be cleaned up if we moved the app loading code into onResume,
but that may not be possible since we need to wait for Gecko to start
up.

Additionally, this patch adds a lot of hard-to-follow global state, which is
also not good.

Preferred solution (bug 1269041): show the toolbar each time onStart is
called (i.e.  FF is unhidden).  This is good for the user - they'll be
more aware which page they're on - but it's janky with the current
implementation, where the page content does not scroll when the toolbar
is shown so previously visible content is hidden. Thus, I went with the
other approach.  fwiw, Chrome does this behavior, but scrolls the toolbar
offscreen shortly after it is shown.

This solution is blocked on bug 1245523.

MozReview-Commit-ID: 7JjCrIf4KTm
2016-03-28 18:50:52 -07:00
Jan Henning 515c5b6666 Bug 1263110 - Part 2 - Implement crash loop detection in Java. r=mfinkle r=sebastian
Bug 701092 originally implemented some functionality to detect successive crashes and then turn off session restore for the next start, however that functionality got lost when parts of the startup session restore code were moved to Java.

This patch re-implements this functionality within the Java UI. Unlike the previous implementation, we don't reset the crash counter in onPause(), because often enough onPause() will execute even after a crash. Instead, we check in onResume() whether our last foreground activity cycle crashed or not.

To avoid cross-process writes and reads to shared preferences, the crash reporter no longer sets the relevant flags in GeckoApp's shared prefs directly, but instead writes an empty CRASHED file to the Mozilla directory as a flag, which is then checked for by the main process during startup.

Alternative solutions considered were:
- Using Context.MODE_MULTI_PROCESS for accessing the shared prefs. Works, but forces the shared preferences to always be re-read from storage and is also deprecated from API 23 onwards.
- Using a ContentProvider for managing the cross-process shared prefs as suggested in Google's documentation. Seems somewhat over-engineered for this use case.
- Sending a broadcast from the crash reporter to signal the main process, so it can update the relevant shared prefs from the correct process. Doesn't work reliably immediately after crashing - sometimes the broadcast never arrives.
- Setting the crash flags directly in the crash handling functions in GeckoAppShell. Could work even when not building the crash reporter, however doesn't work easily for native crashes, because those are handled internally by Gecko without going through the Java crash handling code.

MozReview-Commit-ID: 6g7AmnJhoQk
2016-04-19 13:51:06 +02:00
Jim Chen ae150c3bdf Bug 1267419 - Move PushRecord.getLastVisit handler to PushService.java; r=nalexander
The Android-specific handler for PushRecord.getLastVisit used to be
implemented in GeckoApp, which is unavailable in headless mode. Moving
the handler to PushService makes background notifications work.
2016-04-26 15:34:17 -04:00
Andrzej Hunt e83ccc68d8 Bug 1263571 - Pre: onTabChanged data is always a String, declare it as such r=liuche
We're always using this as a String, we might as well make this explicit to avoid having to cast
anywhere. (We very rarely use the parameter, but some new code in the main part of Bug 1263571
would have to cast this to a String. We can avoid that if we just use the correct type.)

MozReview-Commit-ID: H8JdMzQtmRI
2016-04-23 10:32:54 +02:00
Andrzej Hunt 6e73f243a0 Bug 1263571 - Pre: cleanup imports r=me
MozReview-Commit-ID: 8KdYp5gHEVR
2016-04-12 10:48:55 -07:00
Sebastian Kaspari 4896a20583 Bug 1266668 - Remove Nightly flags from new ActionBar and floating text selection. r=capella
MozReview-Commit-ID: KpIJeCn2Gj4
2016-04-22 12:19:23 +02:00
Jorick Caberio 386ee165ef Bug 1261040 - Remove code code guarded by AppConstants.Versions.preICS. r=sebastian
MozReview-Commit-ID: Jmwl6sfEdx0
2016-04-07 17:17:21 +08:00
Michael Comella 8e357ee7f0 Bug 1258789 - Remove WhitespaceAround tokens filter and fix lcurly issues. r=grisha
Some issues remain.

MozReview-Commit-ID: 3vWQ3z5mnba
2016-04-13 11:17:55 -07:00
Michael Comella 3f67ad622b Bug 1258789 - Add rcurly and fix {} issues. r=grisha
MozReview-Commit-ID: m2dF4mPC1u
2016-04-13 10:51:26 -07:00
Michael Comella a046b02bac Bug 1258789 - Add plus operator to WhitespaceAround and fix. r=grisha
MozReview-Commit-ID: 419NkkMHWCG
2016-04-12 18:42:40 -07:00
Michael Comella b0b8adb484 Bug 1258789 - Add star to WhitespaceAround and fix. r=grisha
MozReview-Commit-ID: 3FY8m1qPj8V
2016-04-12 18:36:28 -07:00
Michael Comella bc0bac7670 Bug 1258789 - Add while to WhitespaceAround. r=grisha
MozReview-Commit-ID: HhbBCjojNiC
2016-04-12 18:21:45 -07:00
Michael Comella 3a2272e8a0 Bug 1258789 - Add switch for whitespaceAround. r=grisha
MozReview-Commit-ID: 167JoSl5go5
2016-04-12 18:19:14 -07:00
Michael Comella cad83a23ef Bug 1258789 - Add literal catch & a few others that don't break for WhitespaceAround. r=grisha
MozReview-Commit-ID: 1En0xuxT4md
2016-04-12 18:16:16 -07:00
Sebastian Kaspari 77681f70d5 Bug 1232706 - Promote "Add to home screen" for frequently visited websites. r=margaret
MozReview-Commit-ID: 2OW7GKxuQmr
2016-04-06 09:41:34 +02:00
Michael Comella e606eeea86 Bug 1263056 - Add WhitespaceAfter comma & fix issues. r=sebastian
Fixed via:
 gsed -i"" -e "s/,\([^[:space:]\"']\)/, \1/g" **/*.java

And hand curation.

MozReview-Commit-ID: DHaXJbW4plY
2016-04-07 18:07:29 -07:00
Sebastian Kaspari fa6ca75c16 Bug 1171110 - Add support for floating text selection toolbar for Android 6.0+. r=capella
MozReview-Commit-ID: 7FLGgrT5gDg
2016-03-14 11:57:05 +01:00
Jim Chen 0a0568bae4 Bug 1260243 - Add GeckoThread.waitOnGecko; r=snorp
GeckoThread.waitOnGecko blocks the current thread and waits for previous
events on the Gecko thread to finish executing before continuing. This
is implemented by synchronously running a dummy event on the Gecko
thread. This patch also lets us get rid of sendEventToGeckoSync in
GeckoAppShell.
2016-04-05 21:43:40 -04:00
Jim Chen 876e11475a Bug 1259653 - Support initializing GeckoThread with a specific profile; r=snorp
Add GeckoThread.initWithProfile that make it easy to target a particular
profile. The method succeeds when GeckoThread has not been initialized
or is already using the specified profile. It fails when the current
profile does not match the specified profile.
2016-04-05 21:43:40 -04:00