The Android-specific AddonUpdateService has a bit of redundant code
because AddonManagerPrivate has a backgroundUpdateCheck method that does
a lot of the same thing. This patch makes AddonUpdateService call that
method so there's less code and more consistency.
This requires flipping the "extensions.update.enabled" pref, which was
disabled in bug 528588 for showing the XUL addon update dialog. I don't
think this is relevant anymore in native Fennec and with the later
rewrite of AddonManager, so I'm fairly certain it's okay to flip that
pref.
The patch also disables the AddonManager update timer because we have
our own update timer on Android.
Experiments should differ from normal add-ons in a few ways:
* They can always be enabled regardless of compatibility info
* They default to disabled when installed
* They cannot be checked for updates
* They only stay enabled for the lifetime of the current process
* The UI doesn't give users the ability to enable/disable
This makes a few changes to keep these differences but remove much of the special casing code for experiments.
Being able to use regardless of compatibility was mostly fixed by bug 1220198 but I've also removed the redundant override in isCompatible.
Previously the "enabled until restart" feature worked with by not updating the DBAddonInternal object and instead using a hack to make the wrapper still seem enabled. This seems likely to break other code that relies on the state of the DBAddonInternal object so instead we update that as normal and simply don't persist the enabled state to disk.
Also switch the DBAddonInteral.prototype code to use some newer JS features.
I've removed the hack from addon.permissions which was hiding the enable/disable buttons in the UI and instead just hidden them in the UI stylesheet. This makes the API make sense and means callers can use addon.permissions to verify that enabling will work.
In order to meet the addon signing requirement for tests, specialpowers
needs to be installed at gecko runtime. This means it must be restartless.
This patch packages specialpowers as a restartless addon, but it does not
yet install it at runtime.
Attempt to get around the fact that XP SP2 (and below) systems won't be able to
handle Authenticode signatues with SHA-2 digests by disabling the maintenance
service, the only thing on our update path that uses Authenticode, on systems
running WinXP below SP3.
This patch both prevents the service from being included in new installations,
and prevents the service from being used where it is already installed.
I tried to keep the changes to existing tests as minimal as
possible. There were a few exceptions, though:
* test_update_ignorecompat.js was completely broken. I couldn't
figure out why it was suddenly failing after I changed it to use
`add_test`, and it turned out that it had been failing all along,
but in a way that the harness didn't pick up.
* I changed most of the `do_throw` in update callbacks to `ok(false`
because it took me about an hour to figure out where the test was
failing when I hit one of them.
* I made some changes to sync `test_update.js` and `test_update_ignorecompat.js`
where one appeared to have been changed without updating the
other.
* I made `promiseFindAddonUpdates` a bit more generic, because I was
planning to convert most of `test_update.js` to use it, rather
than nested callbacks. I changed my mind a quarter of the way
through, but decided to keep the changes, since they'll probably
be useful elsewhere.
I tried to keep the changes to existing tests as minimal as
possible. There were a few exceptions, though:
* test_update_ignorecompat.js was completely broken. I couldn't
figure out why it was suddenly failing after I changed it to use
`add_test`, and it turned out that it had been failing all along,
but in a way that the harness didn't pick up.
* I changed most of the `do_throw` in update callbacks to `ok(false`
because it took me about an hour to figure out where the test was
failing when I hit one of them.
* I made some changes to sync `test_update.js` and `test_update_ignorecompat.js`
where one appeared to have been changed without updating the
other.
* I made `promiseFindAddonUpdates` a bit more generic, because I was
planning to convert most of `test_update.js` to use it, rather
than nested callbacks. I changed my mind a quarter of the way
through, but decided to keep the changes, since they'll probably
be useful elsewhere.
If not building the Windows Maintenance Service, avoid a dependency
on crypt32.dll and wintrust.dll.
Also, avoid setting sUsingService inside the updater code; this
ensures that all Maintenance Service related codepaths are skipped.
Rather that trying to get the method from the sandbox global object which will
only work for var and function declared methods instead evaluate the function
name in the sandbox scope and get the result which will give us access to the
lexical scope.
The configure option has explicitly thrown an error for more than a year now,
and it happens that the remaining way to still forcefully use it has been
broken for more than 8 months.
By making the updated system add-on install location return an empty set when
in safe mode it causes us to rescan and enable the default system add-ons.
The complication is calling the uninstall method on the updated add-ons when
switching to safe mode, for that we have to cache the fact that an add-on
can run in safe mode in the bootstrappedAddons data so it persists to the
next restart and can be accessed when the updated add-on has been hidden.
Unifies the methods we have to check that bootstrap add-ons are correctly loaded
and makes it easier to make changes to them all in the future without needing to
re-sign add-ons etc.
This code allows a bootstrap script to use a shared script in a single line of
code. The shared scripts sends out all the relevant info over the observer
service, the add-ons manager test harness receives and retains the current state
for every add-on also performing sanity checks like making sure an "install"
method is always called before any "startup" method etc. It also provides simple
functions to check the state of a given add-on.
Unifies the methods we have to check that bootstrap add-ons are correctly loaded
and makes it easier to make changes to them all in the future without needing to
re-sign add-ons etc.
This code allows a bootstrap script to use a shared script in a single line of
code. The shared scripts sends out all the relevant info over the observer
service, the add-ons manager test harness receives and retains the current state
for every add-on also performing sanity checks like making sure an "install"
method is always called before any "startup" method etc. It also provides simple
functions to check the state of a given add-on.
This moves the app-shipped system add-ons into <appdir>/features. I've created
a new directory provider location for this since it allows us to override the
location without allowing external apps to do so as would be the case with
prefs.
We've wanted a hidden property for add-ons for a while so we can do things like
hide "uninstalled" sideloaded add-ons so this adds the basic version of it to
hide system add-ons.