Now using the the TYPE_APPLICATION_OVERLAY window type to display alert windows for devices running on Android O.
MozReview-Commit-ID: 7pdquyowbsB
***
--HG--
extra : rebase_source : c8ccb6d9c8bb681ee32d71b58c95f6efd933d34a
Actually, Gecko uses thread name "main" to find main thread. But Android
has Looper object to get main loop. So we should use it instead.
MozReview-Commit-ID: 9oVqftqLZmh
--HG--
extra : rebase_source : 84593b794f9055739a10a08ca2b4fa737043100c
Bug details:
The problem stemmed from the now called GeckoPreferences.trySwitchToHeader(int id) which could be called with an invalid id, constant with the same value as the id of the last available setting.
(GeckoPreferenceFragment().getHeader() would return valid ids only for preference screens that are launched directly. Otherwise it would return: -1)
By chance the id for the last available setting - vendor was not set and so Android saw it with an invalid header id: -1.
GeckoPreferences.trySwitchToHeader(int id) would just switch to showing the vendor setting because that is what he has been instructed to whenever the user tried to access other settings than the ones which can be launched directly.
Cleaned the code a bit:
- renamed GeckoPreferences.switchToHeader(..) to trySwitchToHeader(..) as it won't always perform that action
- removed the call to activity.showBreadCrumbs(..) as in my tests it didn't have any effect and the documentation says "This will normally be called for you".
Tested on An Android 8 tablet, on an Android 8 phone, on an Android 5.0.1 phone and all works ok.
MozReview-Commit-ID: 2sbfcuRHgZd
--HG--
extra : rebase_source : 51f4629e89846d01224a0cd7dd8b3fba93657f40
Made QR string consistent with respect to other url related strings
MozReview-Commit-ID: 432jaONccer
--HG--
extra : rebase_source : 44b50664e9602a11d82a1c1759b3e35e9f25e075
Added localization notes and more verbose strings for non-visual users.
MozReview-Commit-ID: FiOcDJrgRIy
--HG--
extra : rebase_source : 3fcaafc16e7bdbbeab881d16270b036b0a781cf4
Added contentDescription strings for QR Code and Voice Input
MozReview-Commit-ID: 6tpoewhPxev
--HG--
extra : rebase_source : 3ed1f0263f108ad63131f99168ee9879f83fbdb2
Because Mma cannot work if Health Report is disabled by the user (Settings - Privacy)
we will treat toggling Health Report on/off the same as we treat toggling the new preference from Settings - Notifications.
Toggling Health Report on will inform about the need to start LeanPlum (useful if the user did not explicitly stopped LP notifications but only Health Report which in turn disabled LeanPlum also) but there are other checks made afterwards (BrowserAp() is informed about this which calls GeckoPreferences.isMmaAvailable(..)) to decide if LP can and should be enabled.
Toggling any of these preferences will trigger an event caught by BrowserApp which can either
- immediately initialize LeanPlum (if the toggle was off LP is not running) as it would normally do when the app first starts
- stop LeanPlum reporting to servers, flush the per-session available messages
and resets the LP started status so that it can be restarted in the same app session (like if the user toggles the feature again)
MozReview-Commit-ID: 1SmhN0NucWW
***
--HG--
extra : rebase_source : b461677fd8a07d7c0c463e55c33bae1a3a973a1f
With the adding of the new preference that Mma depends on we need to have only one place where all the conditions for considering if Mma is available are checked - GeckoPreferences.isMmaAvailableAndEnabled()
Added only one place from where the availability of the LP experiments should be checked as that currently involves two checks - MmaDelegate.isMmaExperimentEnabled(..)
Also renamed isMmaEnabled() from MmaDelegate() and initSwitchboard from BrowserApp() to better express what those methods do.
MozReview-Commit-ID: BCJqM9b5JbW
***
--HG--
extra : rebase_source : 3c4b1707f69bfa5b39fe12ff45d8961b713f2291
According to current LP documentation there are no SDK APIs to allow users to fully stop LP: events reporting and message displaying there.
After extensive testing and investigations I think I found the least intrusive way to offer that.
We will use internal methods but which are public so I hope they will be supported in the future also. Nevertheless we will need to maintain this in regards to future SDK updates.
MozReview-Commit-ID: Ke3HGAyCqVA
***
--HG--
extra : rebase_source : e6510e12777ee3286742f00ae75d8ca69296989e
The behavior of this new preference is dynamic in that:
- it will be hidden if LeanPlum is not available for the device
- it will be toggled off and disabled if Health Report is disabled by the user
MozReview-Commit-ID: 1x9zZukyygr
***
--HG--
extra : rebase_source : c31ad02cbbb106613914634b5192f856aad185b7
The ActionBar's title will always be updated with the title of the visiting PreferenceScreen.
MozReview-Commit-ID: b5MyrSaWFC
--HG--
extra : rebase_source : 1ad23955ba940935898a4331debb5554a61b4359
The Fennec CrashReporter class is also renamed to
CrashReporterActivity. When running in Fennec, the Activity will be used
which retains what we do today, prompting for comments, email, etc. When
used in standalone GeckoView, we report the crash without user
interaction if the appropriate GeckoRuntimeSetting was set. The app will
want to ask for user permission at least once in order to set this.
We do not collect the URL, email, or logcat with GeckoView crashes.
Logcat and URL would be nice to have, but it's not clear what the API
for those would look like, and they can be addressed in followup
patches.
MozReview-Commit-ID: C5ROsUKreRe
The Fennec CrashReporter class is also renamed to
CrashReporterActivity. When running in Fennec, the Activity will be used
which retains what we do today, prompting for comments, email, etc. When
used in standalone GeckoView, we report the crash without user
interaction if the appropriate GeckoRuntimeSetting was set. The app will
want to ask for user permission at least once in order to set this.
We do not collect the URL, email, or logcat with GeckoView crashes.
Logcat and URL would be nice to have, but it's not clear what the API
for those would look like, and they can be addressed in followup
patches.
MozReview-Commit-ID: C5ROsUKreRe
Added a static broadcast receiver that will inform us as soon as possible of any installed packages.
Because mma methods are static, if LeanPlum is enabled, the event will be tracked even if the app was not running when the new package was installed
and as per LeanPlum's internal workings the event will be reported to the dashboard when the application resumes.
MozReview-Commit-ID: AGNsQn7LuCz
***
--HG--
extra : rebase_source : 3d40a9f85036c0495b110409bff86e56f8b7c465
Fix all Java warnings in the Android codebase except deprecation and
serial warnings, and warnings in third-party code.
There is one required change to exoplayer2 code under thirdparty,
because that code is included directly in the geckoview project, instead
of the thirdparty project. I think I'll just make a pull-request to
upstream the change, instead of separating exoplayer2 into a
gv-thirdparty project.
--HG--
extra : amend_source : 29419a24db9b956a7f3ee573a63f7a055ed90636
Fix all Java warnings in the Android codebase except deprecation and
serial warnings, and warnings in third-party code.
There is one required change to exoplayer2 code under thirdparty,
because that code is included directly in the geckoview project, instead
of the thirdparty project. I think I'll just make a pull-request to
upstream the change, instead of separating exoplayer2 into a
gv-thirdparty project.
The Fennec CrashReporter class is also renamed to
CrashReporterActivity. When running in Fennec, the Activity will be used
which retains what we do today, prompting for comments, email, etc. When
used in standalone GeckoView, we report the crash without user
interaction if the appropriate GeckoRuntimeSetting was set. The app will
want to ask for user permission at least once in order to set this.
We do not collect the URL, email, or logcat with GeckoView crashes.
Logcat and URL would be nice to have, but it's not clear what the API
for those would look like, and they can be addressed in followup
patches.
MozReview-Commit-ID: C5ROsUKreRe
To allow users to opt-out from receiving LeanPlum messages we need a new setting added.
This are the Strings for the title and summary of that setting.
Localization notes also added as this Strings will ship before the feature.
Decided to suppress all UnusedResources Lint errors for android strings until the patch for #1454686 lands as using in-line suppression caused other errors.
Ran Lint locally, the build passed.
MozReview-Commit-ID: 9Kx567ruY3n
***
--HG--
extra : rebase_source : acb555719b4da9199364ca737ff140012dacb47c
After investigating and analyzing the crash reports this type of scenario can occur due to multi-window or some popups. We are tracking this scenario for further investiagion with a telemetry event. Also added a constant for the hardcoded telemetry event when onPause gets called before onResume.
MozReview-Commit-ID: 2qXCYFyjlce
--HG--
extra : rebase_source : 9883fbc38864d93e653d27f270667b3976bbfbf9
The behaviour of Android Firefox Account instances recently changed in
the face of system "Clear data" commands. To align more closely with
common Apps like Dropbox and Whatsapp (which generally don't use
Android Account instances), after a "Clear data" a Firefox Account is
moved to the Separated state, requiring the user to re-connect them
with a password challenge. To achieve this, newly created accounts
include a first run UUID; after a "Clear data", the App is killed and
restarted, Sync sees a different first run UUID, and the Account is
moved to the Separated state. (I honestly don't know what happens if
the Sync code never sees a different first run UUID, but that's for
another day.) If the user then, in the same first run session,
re-connects the Firefox Account... the Sync code will again see the
different first run UUID and move the Account to the Separated state.
This patch updates the first run UUID when the Account is
re-connected, breaking that cycle.
MozReview-Commit-ID: 9jcO9Ym54an
--HG--
extra : rebase_source : be92a7ab0f36563e7b3af69f42095dc2b244bdd2
Move the remote debugging setting to GeckoRuntimeSettings and use it in
geckoview_example.
MozReview-Commit-ID: G2IINILQAOm
--HG--
extra : rebase_source : fad2c96241593c6ce8898691ebf03c224815f339
Move the remote debugging setting to GeckoRuntimeSettings and use it in
geckoview_example.
MozReview-Commit-ID: G2IINILQAOm
--HG--
extra : rebase_source : fad2c96241593c6ce8898691ebf03c224815f339
To allow users to opt-out from receiving LeanPlum messages we need a new setting added.
This are the Strings for the title and summary of that setting.
Localization notes also added as this Strings will ship before the feature.
MozReview-Commit-ID: 9Kx567ruY3n
--HG--
extra : source : 9dece6b7a5949d4c56415ee7ed6f4e03c3eb8e42
Move the remote debugging setting to GeckoRuntimeSettings and use it in
geckoview_example.
MozReview-Commit-ID: LW4f4qenUrx
--HG--
extra : rebase_source : 3664b00d6b66a835063a8333e0151760f7aa8bcb
To allow users to opt-out from receiving LeanPlum messages we need a new setting added.
This are the Strings for the title and summary of that setting.
Localization notes also added as this Strings will ship before the feature.
MozReview-Commit-ID: 9Kx567ruY3n
--HG--
extra : rebase_source : 67bd840c00b9cc3dfa0d80152f0960c51f5f39eb
Use SharedPreference to ensure we won't loose previous state if Fennec is killed, set as default, restarted.
The default browser status will only be set once, when the app is resumed, as it cannot change while the app is in foreground.
We will track "E_Changed_Default_To_Fennec" only if Fennec wasn't previously the default browser.
The method to track the event is safe to be called even before the mma init process is finished as LeanPlum postpones the track operation until it has actually been started.
Refactored MmaDelegate to not use a WeakReference for application context anymore as that should exist for the entire time the app is open, and only in that timeframe the MmaDelegate methods that use that context can be called.
MozReview-Commit-ID: JMJJclWj9fq
--HG--
extra : rebase_source : a6b3c6b097dfacb348a4fd0bbf054dd0c14b2d4a