当前位置: 首页>>代码示例>>Java>>正文


Java AndroidDebugBridge.addDebugBridgeChangeListener方法代码示例

本文整理汇总了Java中com.android.ddmlib.AndroidDebugBridge.addDebugBridgeChangeListener方法的典型用法代码示例。如果您正苦于以下问题:Java AndroidDebugBridge.addDebugBridgeChangeListener方法的具体用法?Java AndroidDebugBridge.addDebugBridgeChangeListener怎么用?Java AndroidDebugBridge.addDebugBridgeChangeListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.android.ddmlib.AndroidDebugBridge的用法示例。


在下文中一共展示了AndroidDebugBridge.addDebugBridgeChangeListener方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: observeForDeviceChange

import com.android.ddmlib.AndroidDebugBridge; //导入方法依赖的package包/类
/**
 * Observe for deviec state changes
 */
private void observeForDeviceChange() {
    deviceSelectionListener =
            new DeviceContext.DeviceSelectionListener() {
                @Override
                public void deviceSelected(@Nullable IDevice device) {
                    notifyDeviceUpdated(device);
                }

                @Override
                public void deviceChanged(@NotNull IDevice device, int changeMask) {
                    if ((changeMask & IDevice.CHANGE_STATE) == IDevice.CHANGE_STATE) {
                        notifyDeviceUpdated(device);
                    }
                }

                @Override
                public void clientSelected(@Nullable final Client c) {
                }
            };
    deviceContext.addListener(deviceSelectionListener, this);
    AndroidDebugBridge.addClientChangeListener(this);
    AndroidDebugBridge.addDeviceChangeListener(this);
    AndroidDebugBridge.addDebugBridgeChangeListener(this);
}
 
开发者ID:josesamuel,项目名称:logviewer,代码行数:28,代码来源:LogSourceManager.java

示例2: waitForDeviceConnected

import com.android.ddmlib.AndroidDebugBridge; //导入方法依赖的package包/类
public IDevice waitForDeviceConnected(final String serialNumber, final long timeout) throws InterruptedException {
	id = serialNumber;
	Console.printLogMessage(serialNumber, "waitForDeviceConnected(" + serialNumber + " to be connected start");
   	
    IDevice [] devices = AndroidDebugBridge.getBridge().getDevices();
    if (devices != null) {
	   	for (IDevice device : devices) {
	   		if (device.getSerialNumber() == serialNumber) {
	   			Console.printLogMessage("", device.getSerialNumber());
	   			return device;
	   		}
	   	}
    }
   	
	AndroidDebugBridge.addDebugBridgeChangeListener(DeviceConnectHelper.this);
   	AndroidDebugBridge.addDeviceChangeListener(DeviceConnectHelper.this);    	
   	synchronized (this) {
   		while (getConnecedDevice(serialNumber) == null) {
   			Console.printLogMessage("", "wait");
   			wait(60000);
   		}
	}
   	Console.printLogMessage(serialNumber, "waitForDeviceConnected(" + serialNumber + " to be connected end");
   	
   	return getConnecedDevice(serialNumber);
}
 
开发者ID:apack1001,项目名称:Android-Monkey-Adapter,代码行数:27,代码来源:DeviceConnectHelper.java

示例3: DevicePanel

import com.android.ddmlib.AndroidDebugBridge; //导入方法依赖的package包/类
public DevicePanel(@NotNull Project project, @NotNull DeviceContext context) {
  myProject = project;
  myDeviceContext = context;
  myPreferredClients = Maps.newHashMap();
  myCandidateClientName = getApplicationName();
  Disposer.register(myProject, this);

  initializeDeviceCombo();
  initializeClientCombo();

  AndroidDebugBridge.addDeviceChangeListener(this);
  AndroidDebugBridge.addClientChangeListener(this);
  AndroidDebugBridge.addDebugBridgeChangeListener(this);

}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:DevicePanel.java

示例4: postCreation

import com.android.ddmlib.AndroidDebugBridge; //导入方法依赖的package包/类
@Override
protected void postCreation() {
    // ask for notification of changes in AndroidDebugBridge (a new one is created when
    // adb is restarted from a different location), IDevice and Client objects.
    AndroidDebugBridge.addDebugBridgeChangeListener(this);
    AndroidDebugBridge.addDeviceChangeListener(this);
    AndroidDebugBridge.addClientChangeListener(this);
}
 
开发者ID:utds3lab,项目名称:SMVHunter,代码行数:9,代码来源:DevicePanel.java

示例5: startAdb

import com.android.ddmlib.AndroidDebugBridge; //导入方法依赖的package包/类
/**
 * This method is executed in a worker thread started in {@link #start()}
 * 
 * @param osLocation
 * @param clientSupport
 */
private static void startAdb(String osLocation) {
	synchronized (INSTANCE) {
		INSTANCE.setState(DeviceManagerState.STARTING);

		INSTANCE._osLocation = osLocation;

		try {
			AndroidDebugBridge.init(false); // true == Mode 1:The library
			// monitors the devices and the
			// applications running on them.
			// false == Mode 2: The library only
			// monitors devices

		} catch (IllegalStateException e) {
			LOG.trace("AndroidDebugBridge.init() has already been called. Caught exception.");
		}

		AndroidDebugBridge.addClientChangeListener(INSTANCE);
		AndroidDebugBridge.addDebugBridgeChangeListener(INSTANCE);
		AndroidDebugBridge.addDeviceChangeListener(INSTANCE);

		LOG.trace("Attempting to connect to the currently running adb server");
		AndroidDebugBridge.createBridge();

		// FIXME: make this more fault tolerant (i.e. handle the condition
		// where adb is not currently running)

		// if (!AndroidDebugBridge.getBridge().isConnected()) {
		// LOG.debug("failed to connect. attempting to start a server with "
		// + osLocation);
		// AndroidDebugBridge.createBridge(osLocation, false);
		// if (!AndroidDebugBridge.getBridge().isConnected()) {
		// LOG.warn("failed to connect!");
		// stopAdb();
		// INSTANCE.setState(DeviceManagerState.FAILED);
		// return;
		// }
		// }
		INSTANCE.setState(DeviceManagerState.RUNNING);
	}
}
 
开发者ID:oliver32767,项目名称:MonkeyBoard,代码行数:48,代码来源:DeviceManager.java


注:本文中的com.android.ddmlib.AndroidDebugBridge.addDebugBridgeChangeListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。