Provide Fennec's implementation of GeckoAppShell.NotificationListener in
NotificationClient. A lot of the code was removed in an earlier patch
from GeckoAppShell, so combined with this patch, we're essentially
moving code from GeckoAppShell to NotificationClient.
Use string names instead of integer IDs to identify notifications. The
integer IDs came from the hashes of the string names, so they are not
guaranteed to be unique. Because the names from Gecko are a combination
of the site origin and notification tag, there can be unintentional
collisions, or worse, a site can intentionally make its notification
collide with and replace another site's notification.
GeckoService and the notification package have some interdependencies,
so if we want to move the notification package, we have to move
GeckoService also. With that said, it's good to move GeckoService in any
case, because it's a Fennec component just like GeckoApp.
--HG--
rename : mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoService.java => mobile/android/base/java/org/mozilla/gecko/GeckoService.java
rename : mobile/android/geckoview/src/main/java/org/mozilla/gecko/notifications/AppNotificationClient.java => mobile/android/base/java/org/mozilla/gecko/notifications/AppNotificationClient.java
rename : mobile/android/geckoview/src/main/java/org/mozilla/gecko/notifications/NotificationClient.java => mobile/android/base/java/org/mozilla/gecko/notifications/NotificationClient.java
rename : mobile/android/geckoview/src/main/java/org/mozilla/gecko/notifications/NotificationHandler.java => mobile/android/base/java/org/mozilla/gecko/notifications/NotificationHandler.java
rename : mobile/android/geckoview/src/main/java/org/mozilla/gecko/notifications/NotificationHelper.java => mobile/android/base/java/org/mozilla/gecko/notifications/NotificationHelper.java
rename : mobile/android/geckoview/src/main/java/org/mozilla/gecko/notifications/NotificationReceiver.java => mobile/android/base/java/org/mozilla/gecko/notifications/NotificationReceiver.java
rename : mobile/android/geckoview/src/main/java/org/mozilla/gecko/notifications/NotificationService.java => mobile/android/base/java/org/mozilla/gecko/notifications/NotificationService.java
rename : mobile/android/geckoview/src/main/java/org/mozilla/gecko/notifications/ServiceNotificationClient.java => mobile/android/base/java/org/mozilla/gecko/notifications/ServiceNotificationClient.java
Instead of using NotificationClient directly from GeckoAppShell, add a
NotificationListener interface, which NotificationClient would
implement. This isolates NotificationClient (and the notification
package) from GeckoAppShell and lets us move the notification package to
Fennec. It also makes a cleaner interface for GeckoView consumers to
implement notification support.
General cleanup patch: make JNI methods in GeckoAppShell private if
possible, because they're not meant to be used in Java from outside of
GeckoAppShell.
This patch allows specifying an OriginAttributes when creating a sandbox
using Components.utils.Sandbox() by specifying an originAttributes
member on the options dictionary.
If an OA is specified in this way, it is used for creating codebase
principals from the string arguments passed to the function. Otherwise,
if one or more principals are passed in the array argument to Sandbox(),
the OA of the principal(s) is used to construct codebase principals from
the strings inside the array. In this case, we check to make sure that
all of the passed principals have the same OA, otherwise we'll throw an
exception.
In case no explicit OA is specified and no principals are passed in the
array argument, we create the codebase principals using a default OA.