blob: caa2f3f491ac529b741e3a1b29aeee51c4c93c30 [file] [log] [blame]
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[JavaPackage="org.chromium.mojo.intent"]
module intent_receiver;
// Service to interact with android intents.
interface IntentReceiverManager {
// This method takes an |IntentReceiver| and returns a serialized intent.
// The serialized intent can be deserialized using an android parcel. The
// caller can then transform this intent into a PendingIntent using
// |PendingIntent#getService| and send it to another android application.
// Whenever the pending intent is executed, the receiver will be called with
// the content of the received intent.
// To be noted, this will fail if the received intent is active (contains
// either a Binder or a file descriptor).
RegisterIntentReceiver(IntentReceiver receiver) => (array<uint8>? intent);
// This method takes an |IntentReceiver| and returns a serialized intent.
// The serialized intent can be deserialized using an android parcel. The
// caller can then add an intent it wants the system to send using
// |Activity#startActivityForResult| and then send it using
// |Context#startService|. Whenever the started activity sends a result, the
// receiver will be called with the content of the received intent. If the
// activity is cancelled, the receiver will be closed.
RegisterActivityResultReceiver(IntentReceiver receiver) =>
(array<uint8>? intent);
};
// Receiver interface, to be used with |IntentReceiverManager|.
interface IntentReceiver {
OnIntent(array<uint8> intent);
};