summaryrefslogtreecommitdiffstats
path: root/remoting/android/java/src/org/chromium/chromoting/ClientExtension.java
blob: 070dcc71bfc407b40cce103ffe1358bfaa2b1cd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright 2014 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.

package org.chromium.chromoting;

import android.app.Activity;

/**
 * Interface to extend the Android client's functionality by providing a way to communicate with
 * the Chromoting host.
 */
public interface ClientExtension {

    /** Returns the capability supported by this extension, or an empty string. */
    public String getCapability();

    /**
     * Called when the client receives an extension message from the host through JniInterface. It
     * returns true if the message was handled appropriately, and false otherwise.
     */
    public boolean onExtensionMessage(String type, String data);

    /**
     * Called when an activity offers to accept an ActivityListener for its lifecycle events.
     * This gives Extensions the option to hook into an existing Activity, get notified about
     * changes in its state and modify its behavior. Returns the extension's activity listener,
     * or null.
     */
    public ActivityLifecycleListener onActivityAcceptingListener(Activity activity);

}