1 // Copyright 2014 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 package org.chromium.chromoting; 6 7 import android.app.Activity; 8 9 /** 10 * Interface to extend the Android client's functionality by providing a way to communicate with 11 * the Chromoting host. 12 */ 13 public interface ClientExtension { 14 15 /** Returns the capability supported by this extension, or an empty string. */ 16 public String getCapability(); 17 18 /** 19 * Called when the client receives an extension message from the host through JniInterface. It 20 * returns true if the message was handled appropriately, and false otherwise. 21 */ 22 public boolean onExtensionMessage(String type, String data); 23 24 /** 25 * Called when an activity offers to accept an ActivityListener for its lifecycle events. 26 * This gives Extensions the option to hook into an existing Activity, get notified about 27 * changes in its state and modify its behavior. Returns the extension's activity listener, 28 * or null. 29 */ 30 public ActivityLifecycleListener onActivityAcceptingListener(Activity activity); 31 32 } 33