Home | History | Annotate | Download | only in core
      1 /*
      2  * Copyright (C) 2011 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 package com.android.chimpchat.core;
     17 
     18 import com.android.chimpchat.core.IChimpDevice;
     19 
     20 /**
     21  * Interface between the ChimpChat API and the ChimpChat backend that communicates
     22  * with Monkey.
     23  */
     24 public interface IChimpBackend {
     25     /**
     26      * Wait for a default device to connect to the backend.
     27      *
     28      * @return the connected device (or null if timeout);
     29      */
     30     IChimpDevice waitForConnection();
     31 
     32     /**
     33      * Wait for a device to connect to the backend.
     34      *
     35      * @param timeoutMs how long (in ms) to wait
     36      * @param deviceIdRegex the regular expression to specify which device to wait for.
     37      * @return the connected device (or null if timeout);
     38      */
     39     IChimpDevice waitForConnection(long timeoutMs, String deviceIdRegex);
     40 
     41     /**
     42      * Shutdown the backend and cleanup any resources it was using.
     43      */
     44     void shutdown();
     45 }
     46