Bug 991167 - Add BundleEventListener class; r=mcomella
authorJim Chen <nchen@mozilla.com>
Wed, 19 Aug 2015 18:14:48 -0400
changeset 259077 53a0390d59dbf62030f4868e0fc869d15e365c3a
parent 259076 6d5b38d75c5e25b8f667b42402250359969fda9c
child 259078 f39b4a4435f56d019bbbd84edff7764677a135f7
push id29268
push userryanvm@gmail.com
push dateTue, 25 Aug 2015 00:37:23 +0000
treeherdermozilla-central@08015770c9d6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcomella
bugs991167
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 991167 - Add BundleEventListener class; r=mcomella
mobile/android/base/moz.build
mobile/android/base/util/BundleEventListener.java
--- a/mobile/android/base/moz.build
+++ b/mobile/android/base/moz.build
@@ -66,16 +66,17 @@ mgjar.extra_jars += [
 ]
 mgjar.javac_flags += ['-Xlint:all']
 
 gujar = add_java_jar('gecko-util')
 gujar.sources += [
     'util/ActivityResultHandler.java',
     'util/ActivityResultHandlerMap.java',
     'util/ActivityUtils.java',
+    'util/BundleEventListener.java',
     'util/Clipboard.java',
     'util/ColorUtils.java',
     'util/DrawableUtil.java',
     'util/EventCallback.java',
     'util/FileUtils.java',
     'util/FloatUtils.java',
     'util/GamepadUtils.java',
     'util/GeckoBackgroundThread.java',
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/util/BundleEventListener.java
@@ -0,0 +1,22 @@
+/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+package org.mozilla.gecko.util;
+
+import android.os.Bundle;
+
+public interface BundleEventListener {
+    /**
+     * Handles a message sent from Gecko.
+     *
+     * @param event    The name of the event being sent.
+     * @param message  The message data.
+     * @param callback The callback interface for this message. A callback is provided only if the
+     *                 originating Messaging.sendRequest call included a callback argument;
+     *                 otherwise, callback will be null. All listeners for a given event are given
+     *                 the same callback object, and exactly one listener must handle the callback.
+     */
+    void handleMessage(String event, Bundle message, EventCallback callback);
+}