Sharing tabs with file:// URIs is not possible, but users can still send them to
other apps via the helper app system in the URL bar/context menu. "Intent:Open"
and "Intent:OpenForResult" are both sent from Gecko by HelperApps.jsm.
The same reasoning as in bug 1450449 applies as to why for publicly accessible
files content:// URIs are more trouble than they're worth.
Differential Revision: https://phabricator.services.mozilla.com/D9420
Added support for opening HTML files from internal storage when user is choosing fennec in the dialog picker.
Depends on D7167
Differential Revision: https://phabricator.services.mozilla.com/D7490
Created a new parcelable which is sent to MediaControlService where
the notification is created based on the data of this object instead of
referencing a static notification. Toggling the service is now done through
startService with a specific action for shutting down instead of calling
stopService due to concurrency issues where the service can be stopped before
having a chance to call startForeground.
MozReview-Commit-ID: 6qNPintkVy
Created a new parcelable which is sent to MediaControlService where
the notification is created based on the data of this object instead of
referencing a static notification. Toggling the service is now done through
startService with a specific action for shutting down instead of calling
stopService due to concurrency issues where the service can be stopped before
having a chance to call startForeground.
MozReview-Commit-ID: 6qNPintkVy
Since it is only us and the camera app who have to deal with the content:// URI,
it should be safe enough to use content:// URIs on all supported versions.
MozReview-Commit-ID: JMIhBRlCiA4
At least on some devices, there seems to exist some sort of intermediate danger
zone where the intent is no longer large enough to be rejected outright by the
OS, but still big enough to render Firefox inoperable through some sort of
resource exhaustion.
From Android 6.0 onwards, this doesn't matter as otherwise we would have crashed
anyway, but on previous Android versions a much too large intent will simply be
ignored, so if we truncate, but not enough, this actually makes matters worse.
The value used in this patch was chosen by attempting to share the whole
contents of planet.mozilla.org on a Samsumg S3 Mini running Android 4.1.2.
90k characters led to resource exhaustion and the screen turning black, while
85k characters still worked. On a more modern phone, even larger amounts (e.g.
100k characters, like Chrome) worked. Therefore, to have some additional margin,
a maximum limit of 80k characters will be used.
MozReview-Commit-ID: 6etHe0KUgig
Our current way is somewhat convoluted - we manually create an about:neterror
URL in the Android UI and then load it from the ContentDispatchChooser by simply
setting window.location.href, which means that the page URL won't reflect the
actual URL we were trying to load and the rest of Gecko will think that the page
load succeeded (unless they're explicitly checking the URL for the presence of
about:neterror).
MozReview-Commit-ID: Z0LSSE6AGU
Unlike capturing images/videos, the Android permission for recording audio is apparently only required if we want to record the audio ourselves, but not if we're merely calling out to some other app via MediaStore.Audio.Media.RECORD_SOUND_ACTION. Therefore we can drop that permission request for now.
MozReview-Commit-ID: 35vtm8Y78hh
Theoretically this patch would also handle the case where the user has granted only some of the requested permissions, but at the moment our Permissions implementation doesn't make it easy to find out *which* permissions have been denied in the fallback case. So for the time being, we assume having no permissions at all in the fallback case.
MozReview-Commit-ID: EtxFfiLQONF
Instead of initializing IntentHelper in GeckoApp, initialize it in
GeckoApplication, and make it available globally. This will let custom
tabs / PWA use IntentHelper-provided services.
MozReview-Commit-ID: Icedph6KG4u
The new, preferred solution for displaying additional web content outside of our normal tab infrastructure and UI is to use a separate GeckoView instance. Therefore, the support for different having additional "tab" types that aren't displayed in the normal UI, as well as for multiple GeckoApp instances displaying different tabs is no longer needed and can be removed.
MozReview-Commit-ID: FNx0gJIKybr
We may get an Activity that is not the main Fennec Activity in
IntentHelper.openUriExternal. In that case the Activity would not be a
FragmentActivity, and we should go through the fallback case. r=me for
trivial patch.
MozReview-Commit-ID: G5hiLBnrQlo
Use available Context or GeckoActivityMonitor to derive an Activity
instance, instead of using GeckoInterface.getActivity().
MozReview-Commit-ID: GHLMtnQkr2l
JSONObject.optString defaults to empty string ("") if the key doesn't
exist, whereas GeckoBundle.getString defaults to null if the key doesn't
exist. So the correct conversion for `json.optString("foo")` should be
`bundle.getString("foo", "")`. This patch fixes the wrong conversions
from before. In case we did default to null, this patch gets rid of the
redundant null second argument to GeckoBundle.getString.
Convert events used in IntentHelper to bundle events. UI thread events
are used for most events because the listeners perform operations on
Intent objects, which is best done on the UI thread. For
"Intent:GetHandlers", use a Gecko thread event because it's possible we
want a synchronous callback response.