本文整理汇总了Java中com.android.ddmlib.AndroidDebugBridge.disconnectBridge方法的典型用法代码示例。如果您正苦于以下问题:Java AndroidDebugBridge.disconnectBridge方法的具体用法?Java AndroidDebugBridge.disconnectBridge怎么用?Java AndroidDebugBridge.disconnectBridge使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.android.ddmlib.AndroidDebugBridge
的用法示例。
在下文中一共展示了AndroidDebugBridge.disconnectBridge方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: close
import com.android.ddmlib.AndroidDebugBridge; //导入方法依赖的package包/类
/**
* Closes all open resources. <b>MUST BE CALLED WHEN THIS CLASS IS NO LONGER NEEDED.</b>
*/
public void close() {
LOGGER.info("Closing the AgentManager.");
try {
// We close the bridge and adb service, so bridge creation wont fail next time we try. This is a workaround,
// ddmlib is bugged.
AndroidDebugBridge.disconnectBridge();
// Terminate the bridge connection
AndroidDebugBridge.terminate();
dispatcher.close();
// Stops the chrome driver started as a service
deviceManager.stopChromeDriverService();
if(AgentPropertiesLoader.hasFtpServer()) {
// Disconnect and logout the FTP client
deviceManager.stopFtpFileTransferService();
}
} catch (Exception e) {
// If something cannot be closed it was never opened, so it's okay.
// Nothing to do here.
LOGGER.info(e);
}
}
示例2: stopAdb
import com.android.ddmlib.AndroidDebugBridge; //导入方法依赖的package包/类
/**
* This method is executed in a worker thread started in {@link #stop()}
*
* @param osLocation
* @param clientSupport
*/
private static void stopAdb() {
synchronized (INSTANCE) {
INSTANCE.setState(DeviceManagerState.STOPPING);
INSTANCE._deviceThreadPool.shutdown();
INSTANCE.removeAllDevices();
// LOG.trace("Devices removed");
AndroidDebugBridge.removeClientChangeListener(INSTANCE);
AndroidDebugBridge.removeDebugBridgeChangeListener(INSTANCE);
AndroidDebugBridge.removeDeviceChangeListener(INSTANCE);
AndroidDebugBridge.disconnectBridge();
// AndroidDebugBridge.terminate();
INSTANCE.setState(DeviceManagerState.STOPPED);
}
}
示例3: shutdown
import com.android.ddmlib.AndroidDebugBridge; //导入方法依赖的package包/类
/**
* Shutdown the AndroidDebugBridge and clean up all connected devices.
*/
public void shutdown() {
log.info("Notifying device listener about shutdown");
for (HardwareDeviceListener listener : deviceListeners) {
for (AndroidDevice device : connectedDevices.values()) {
listener.onDeviceDisconnected(connectedDevices.get(device));
}
}
log.info("Removing Device Manager listener from ADB");
AndroidDebugBridge.removeDeviceChangeListener(this);
if (!shouldKeepAdbAlive) {
AndroidDebugBridge.disconnectBridge();
}
AndroidDebugBridge.terminate();
log.info("stopping Device Manager");
// TODO add thread interrupt and join handling
}
示例4: close
import com.android.ddmlib.AndroidDebugBridge; //导入方法依赖的package包/类
@Override
public void close() {
// TODO(radim): if we really need it then it belongs to core where ADBfactory lives
AndroidDebugBridge adb = AndroidSdkProvider.getAdb();
if (adb != null && adb.isConnected()) {
AndroidDebugBridge.disconnectBridge();
}
}
示例5: shutdown
import com.android.ddmlib.AndroidDebugBridge; //导入方法依赖的package包/类
/**
* Shutdown the AndroidDebugBridge and clean up all connected devices.
*/
@Override
public void shutdown() {
if (!shouldKeepAdbAlive) {
AndroidDebugBridge.disconnectBridge();
AndroidDebugBridge.terminate();
}
logger.info("stopping Device Manager");
}
示例6: disconnect
import com.android.ddmlib.AndroidDebugBridge; //导入方法依赖的package包/类
/**
*
*/
public void disconnect() {
if (!mIsAdbInitialized) {
Util.DbgLog("not connected..");
return;
}
mDeviceStateListener = null;
AndroidDebugBridge.disconnectBridge();
}
示例7: disconnect
import com.android.ddmlib.AndroidDebugBridge; //导入方法依赖的package包/类
public static void disconnect() {
if (AndroidDebugBridge.getBridge() != null
&& isAdbInitialized(AndroidDebugBridge.getBridge())) {
AndroidDebugBridge.disconnectBridge();
AndroidDebugBridge.terminate();
}
}
示例8: shutdownForcely
import com.android.ddmlib.AndroidDebugBridge; //导入方法依赖的package包/类
/**
* used with caution or don't call this method
*/
@Override
public void shutdownForcely() {
AndroidDebugBridge.disconnectBridge();
AndroidDebugBridge.terminate();
}