1 /* 2 * Copyright (C) 2010 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.tradefed.device; 17 18 import com.android.ddmlib.AndroidDebugBridge; 19 import com.android.ddmlib.AndroidDebugBridge.IDeviceChangeListener; 20 import com.android.ddmlib.IDevice; 21 22 /** 23 * Interface definition for {@link com.android.ddmlib.AndroidDebugBridge} methods used in this 24 * package. 25 * <p/> 26 * Exposed so use of {@link com.android.ddmlib.AndroidDebugBridge} can be mocked out in unit tests. 27 */ 28 public interface IAndroidDebugBridge { 29 30 /** 31 * Wrapper for {@link AndroidDebugBridge#getDevices()}. 32 */ getDevices()33 IDevice[] getDevices(); 34 35 /** 36 * Wrapper for {@link AndroidDebugBridge#addDeviceChangeListener(IDeviceChangeListener)} 37 */ addDeviceChangeListener(IDeviceChangeListener listener)38 void addDeviceChangeListener(IDeviceChangeListener listener); 39 40 /** 41 * Wrapper for {@link AndroidDebugBridge#removeDeviceChangeListener(IDeviceChangeListener)} 42 */ removeDeviceChangeListener(IDeviceChangeListener listener)43 void removeDeviceChangeListener(IDeviceChangeListener listener); 44 45 /** 46 * Wrapper for {@link AndroidDebugBridge#init(boolean)} and 47 * {@link AndroidDebugBridge#createBridge(String, boolean)} 48 */ init(boolean clientSupport, String adbOsLocation)49 void init(boolean clientSupport, String adbOsLocation); 50 51 /** 52 * Returns the adb full version of the adb location provided, or null if anything goes wrong. 53 */ getAdbVersion(String adbOsLocation)54 String getAdbVersion(String adbOsLocation); 55 56 /** 57 * Wrapper for {@link AndroidDebugBridge#terminate()} 58 */ terminate()59 void terminate(); 60 61 /** 62 * Wrapper for {@link AndroidDebugBridge#disconnectBridge()} 63 */ disconnectBridge()64 void disconnectBridge(); 65 66 } 67