• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java LogReceiver类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.android.ddmlib.log.LogReceiver的典型用法代码示例。如果您正苦于以下问题:Java LogReceiver类的具体用法?Java LogReceiver怎么用?Java LogReceiver使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



LogReceiver类属于com.android.ddmlib.log包,在下文中一共展示了LogReceiver类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: runLocalEventLogService

import com.android.ddmlib.log.LogReceiver; //导入依赖的package包/类
/**
 * Runs an event log service out of a local file.
 * @param fileName the full file name of the local file containing the event log.
 * @param logReceiver the receiver that will handle the log
 * @throws IOException
 */
@WorkerThread
private void runLocalEventLogService(String fileName, LogReceiver logReceiver)
        throws IOException {
    byte[] buffer = new byte[256];

    FileInputStream fis = new FileInputStream(fileName);
    try {
        int count;
        while ((count = fis.read(buffer)) != -1) {
            logReceiver.parseNewData(buffer, 0, count);
        }
    } finally {
        fis.close();
    }
}
 
开发者ID:utds3lab,项目名称:SMVHunter,代码行数:22,代码来源:EventLogPanel.java


示例2: runEventLogService

import com.android.ddmlib.log.LogReceiver; //导入依赖的package包/类
@Override
public void runEventLogService(LogReceiver arg0)
    throws TimeoutException,
        AdbCommandRejectedException,
        IOException {
    // TODO Auto-generated method stub

}
 
开发者ID:MusalaSoft,项目名称:atmosphere-agent,代码行数:9,代码来源:ShellCommandExecutorTest.java


示例3: runLogService

import com.android.ddmlib.log.LogReceiver; //导入依赖的package包/类
@Override
public void runLogService(String arg0, LogReceiver arg1)
    throws TimeoutException,
        AdbCommandRejectedException,
        IOException {
    // TODO Auto-generated method stub

}
 
开发者ID:MusalaSoft,项目名称:atmosphere-agent,代码行数:9,代码来源:ShellCommandExecutorTest.java


示例4: runLocalEventLogService

import com.android.ddmlib.log.LogReceiver; //导入依赖的package包/类
/**
 * Runs an event log service out of a local file.
 * @param fileName the full file name of the local file containing the event log.
 * @param logReceiver the receiver that will handle the log
 * @throws IOException
 */
@WorkerThread
private void runLocalEventLogService(String fileName, LogReceiver logReceiver)
        throws IOException {
    byte[] buffer = new byte[256];

    FileInputStream fis = new FileInputStream(fileName);

    int count;
    while ((count = fis.read(buffer)) != -1) {
        logReceiver.parseNewData(buffer, 0, count);
    }
}
 
开发者ID:lrscp,项目名称:ControlAndroidDeviceFromPC,代码行数:19,代码来源:EventLogPanel.java


示例5: stopLogService

import com.android.ddmlib.log.LogReceiver; //导入依赖的package包/类
private void stopLogService(final IDevice device) {
    ApplicationManager.getApplication().executeOnPooledThread(new Runnable() {
        @Override
        public void run() {
            LogReceiver service = logServices.remove(device);
            if (service != null) {
                service.cancel();
            }
        }
    });
}
 
开发者ID:willowtreeapps,项目名称:resPeeker,代码行数:12,代码来源:ResPeekerToolWindowFactory.java


示例6: runLogService

import com.android.ddmlib.log.LogReceiver; //导入依赖的package包/类
/**
 * Runs a log service on the {@link com.android.ddmlib.Device}, and provides its output to the {@link LogReceiver}.
 * <p/>This call is blocking until {@link LogReceiver#isCancelled()} returns true.
 *
 * @param adbSockAddr the socket address to connect to adb
 * @param device      the Device on which to run the service
 * @param logName     the name of the log file to output
 * @param rcvr        the {@link LogReceiver} to receive the log output
 * @throws TimeoutException            in case of timeout on the connection.
 * @throws AdbCommandRejectedException if adb rejects the command
 * @throws IOException                 in case of I/O error on the connection.
 */
static void runLogService(InetSocketAddress adbSockAddr, Device device, String logName, LogReceiver rcvr)
        throws TimeoutException, AdbCommandRejectedException, IOException {

    SocketChannel adbChan = null;

    try {
        adbChan = SocketChannel.open(adbSockAddr);
        adbChan.configureBlocking(false);

        // if the device is not -1, then we first tell adb we're looking to talk
        // to a specific device
        setDevice(adbChan, device);

        byte[] request = formAdbRequest("log:" + logName);
        write(adbChan, request);

        AdbResponse resp = readAdbResponse(adbChan, false /* readDiagString */);
        if (!resp.okay) {
            throw new AdbCommandRejectedException(resp.message);
        }

        byte[] data = new byte[16384];
        ByteBuffer buf = ByteBuffer.wrap(data);
        while (true) {
            int count;

            if (rcvr != null && rcvr.isCancelled()) {
                break;
            }

            count = adbChan.read(buf);
            if (count < 0) {
                break;
            } else if (count == 0) {
                try {
                    Thread.sleep(WAIT_TIME * 5);
                } catch (InterruptedException e) {
                    Thread.currentThread().interrupt();
                    // Throw a timeout exception in place of interrupted exception to avoid API changes.
                    throw new TimeoutException(
                            "runLogService interrupted with immediate timeout via interruption.");
                }
            } else {
                if (rcvr != null) {
                    rcvr.parseNewData(buf.array(), buf.arrayOffset(), buf.position());
                }
                buf.rewind();
            }
        }
    } finally {
        if (adbChan != null) {
            //noinspection ThrowFromFinallyBlock
            adbChan.close();
        }
    }
}
 
开发者ID:rock3r,项目名称:framer,代码行数:69,代码来源:AdbHelper.java


示例7: runEventLogService

import com.android.ddmlib.log.LogReceiver; //导入依赖的package包/类
@Override
public void runEventLogService(LogReceiver receiver)
        throws TimeoutException, AdbCommandRejectedException, IOException {
    AdbHelper.runEventLogService(AndroidDebugBridge.getSocketAddress(), this, receiver);
}
 
开发者ID:rock3r,项目名称:framer,代码行数:6,代码来源:Device.java


示例8: runLogService

import com.android.ddmlib.log.LogReceiver; //导入依赖的package包/类
@Override
public void runLogService(String logname, LogReceiver receiver)
        throws TimeoutException, AdbCommandRejectedException, IOException {
    AdbHelper.runLogService(AndroidDebugBridge.getSocketAddress(), this, logname, receiver);
}
 
开发者ID:rock3r,项目名称:framer,代码行数:6,代码来源:Device.java


示例9: runLogService

import com.android.ddmlib.log.LogReceiver; //导入依赖的package包/类
/**
 * Runs a log service on the {@link Device}, and provides its output to the {@link LogReceiver}.
 * <p/>This call is blocking until {@link LogReceiver#isCancelled()} returns true.
 * @param adbSockAddr the socket address to connect to adb
 * @param device the Device on which to run the service
 * @param logName the name of the log file to output
 * @param rcvr the {@link LogReceiver} to receive the log output
 * @throws TimeoutException in case of timeout on the connection.
 * @throws AdbCommandRejectedException if adb rejects the command
 * @throws IOException in case of I/O error on the connection.
 */
public static void runLogService(InetSocketAddress adbSockAddr, Device device, String logName,
        LogReceiver rcvr) throws TimeoutException, AdbCommandRejectedException, IOException {
    SocketChannel adbChan = null;

    try {
        adbChan = SocketChannel.open(adbSockAddr);
        adbChan.configureBlocking(false);

        // if the device is not -1, then we first tell adb we're looking to talk
        // to a specific device
        setDevice(adbChan, device);

        byte[] request = formAdbRequest("log:" + logName);
        write(adbChan, request);

        AdbResponse resp = readAdbResponse(adbChan, false /* readDiagString */);
        if (!resp.okay) {
            throw new AdbCommandRejectedException(resp.message);
        }

        byte[] data = new byte[16384];
        ByteBuffer buf = ByteBuffer.wrap(data);
        while (true) {
            int count;

            if (rcvr != null && rcvr.isCancelled()) {
                break;
            }

            count = adbChan.read(buf);
            if (count < 0) {
                break;
            } else if (count == 0) {
                try {
                    Thread.sleep(WAIT_TIME * 5);
                } catch (InterruptedException ie) {
                }
            } else {
                if (rcvr != null) {
                    rcvr.parseNewData(buf.array(), buf.arrayOffset(), buf.position());
                }
                buf.rewind();
            }
        }
    } finally {
        if (adbChan != null) {
            adbChan.close();
        }
    }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:62,代码来源:AdbHelper.java


示例10: runLogService

import com.android.ddmlib.log.LogReceiver; //导入依赖的package包/类
/**
 * Runs a log service on the {@link Device}, and provides its output to the {@link LogReceiver}.
 * <p/>This call is blocking until {@link LogReceiver#isCancelled()} returns true.
 * @param adbSockAddr the socket address to connect to adb
 * @param device the Device on which to run the service
 * @param logName the name of the log file to output
 * @param rcvr the {@link LogReceiver} to receive the log output
 * @throws TimeoutException in case of timeout on the connection.
 * @throws AdbCommandRejectedException if adb rejects the command
 * @throws IOException in case of I/O error on the connection.
 */
public static void runLogService(InetSocketAddress adbSockAddr, Device device, String logName,
        LogReceiver rcvr) throws TimeoutException, AdbCommandRejectedException, IOException {
    SocketChannel adbChan = null;

    try {
        adbChan = SocketChannel.open(adbSockAddr);
        adbChan.configureBlocking(false);

        // if the device is not -1, then we first tell adb we're looking to talk
        // to a specific device
        setDevice(adbChan, device);

        byte[] request = formAdbRequest("log:" + logName);
        write(adbChan, request);

        AdbResponse resp = readAdbResponse(adbChan, false /* readDiagString */);
        if (resp.okay == false) {
            throw new AdbCommandRejectedException(resp.message);
        }

        byte[] data = new byte[16384];
        ByteBuffer buf = ByteBuffer.wrap(data);
        while (true) {
            int count;

            if (rcvr != null && rcvr.isCancelled()) {
                break;
            }

            count = adbChan.read(buf);
            if (count < 0) {
                break;
            } else if (count == 0) {
                try {
                    Thread.sleep(WAIT_TIME * 5);
                } catch (InterruptedException ie) {
                }
            } else {
                if (rcvr != null) {
                    rcvr.parseNewData(buf.array(), buf.arrayOffset(), buf.position());
                }
                buf.rewind();
            }
        }
    } finally {
        if (adbChan != null) {
            adbChan.close();
        }
    }
}
 
开发者ID:utds3lab,项目名称:SMVHunter,代码行数:62,代码来源:AdbHelper.java


示例11: runLogService

import com.android.ddmlib.log.LogReceiver; //导入依赖的package包/类
/**
 * Runs a log service on the {@link Device}, and provides its output to the
 * {@link LogReceiver}.
 * <p/>
 * This call is blocking until {@link LogReceiver#isCancelled()} returns
 * true.
 * 
 * @param adbSockAddr
 *            the socket address to connect to adb
 * @param device
 *            the Device on which to run the service
 * @param logName
 *            the name of the log file to output
 * @param rcvr
 *            the {@link LogReceiver} to receive the log output
 * @throws TimeoutException
 *             in case of timeout on the connection.
 * @throws AdbCommandRejectedException
 *             if adb rejects the command
 * @throws IOException
 *             in case of I/O error on the connection.
 */
public static void runLogService(InetSocketAddress adbSockAddr, Device device, String logName,
        LogReceiver rcvr) throws TimeoutException, AdbCommandRejectedException, IOException {
    SocketChannel adbChan = null;

    try {
        adbChan = SocketChannel.open(adbSockAddr);
        adbChan.configureBlocking(false);

        // if the device is not -1, then we first tell adb we're looking to
        // talk
        // to a specific device
        setDevice(adbChan, device);

        byte[] request = formAdbRequest("log:" + logName);
        write(adbChan, request);

        AdbResponse resp = readAdbResponse(adbChan, false /* readDiagString */);
        if (resp.okay == false) {
            throw new AdbCommandRejectedException(resp.message);
        }

        byte[] data = new byte[16384];
        ByteBuffer buf = ByteBuffer.wrap(data);
        while (true) {
            int count;

            if (rcvr != null && rcvr.isCancelled()) {
                break;
            }

            count = adbChan.read(buf);
            if (count < 0) {
                break;
            } else if (count == 0) {
                try {
                    Thread.sleep(WAIT_TIME * 5);
                } catch (InterruptedException ie) {}
            } else {
                if (rcvr != null) {
                    rcvr.parseNewData(buf.array(), buf.arrayOffset(), buf.position());
                }
                buf.rewind();
            }
        }
    } finally {
        if (adbChan != null) {
            adbChan.close();
        }
    }
}
 
开发者ID:lrscp,项目名称:ControlAndroidDeviceFromPC,代码行数:73,代码来源:AdbHelper.java


示例12: runEventLogService

import com.android.ddmlib.log.LogReceiver; //导入依赖的package包/类
@Override
public void runEventLogService(LogReceiver receiver) throws TimeoutException,
        AdbCommandRejectedException, IOException {
    AdbHelper.runEventLogService(AndroidDebugBridge.getSocketAddress(), this, receiver);
}
 
开发者ID:lrscp,项目名称:ControlAndroidDeviceFromPC,代码行数:6,代码来源:Device.java


示例13: runLogService

import com.android.ddmlib.log.LogReceiver; //导入依赖的package包/类
@Override
public void runLogService(String logname, LogReceiver receiver) throws TimeoutException,
        AdbCommandRejectedException, IOException {
    AdbHelper.runLogService(AndroidDebugBridge.getSocketAddress(), this, logname, receiver);
}
 
开发者ID:lrscp,项目名称:ControlAndroidDeviceFromPC,代码行数:6,代码来源:Device.java


示例14: runEventLogService

import com.android.ddmlib.log.LogReceiver; //导入依赖的package包/类
@Override
public void runEventLogService(LogReceiver logReceiver) throws TimeoutException,
    AdbCommandRejectedException, IOException {
  throw new UnsupportedOperationException();
}
 
开发者ID:saleehk,项目名称:buck-cutom,代码行数:6,代码来源:TestDevice.java


示例15: runLogService

import com.android.ddmlib.log.LogReceiver; //导入依赖的package包/类
@Override
public void runLogService(String s, LogReceiver logReceiver) throws TimeoutException,
    AdbCommandRejectedException, IOException {
  throw new UnsupportedOperationException();
}
 
开发者ID:saleehk,项目名称:buck-cutom,代码行数:6,代码来源:TestDevice.java


示例16: runEventLogService

import com.android.ddmlib.log.LogReceiver; //导入依赖的package包/类
public void runEventLogService(LogReceiver receiver)
        throws TimeoutException, AdbCommandRejectedException, IOException {
    AdbHelper.runEventLogService(AndroidDebugBridge.getSocketAddress(), this, receiver);
}
 
开发者ID:liuyq,项目名称:aster,代码行数:5,代码来源:Device.java


示例17: runLogService

import com.android.ddmlib.log.LogReceiver; //导入依赖的package包/类
public void runLogService(String logname, LogReceiver receiver)
        throws TimeoutException, AdbCommandRejectedException, IOException {
    AdbHelper.runLogService(AndroidDebugBridge.getSocketAddress(), this, logname, receiver);
}
 
开发者ID:liuyq,项目名称:aster,代码行数:5,代码来源:Device.java


示例18: runEventLogService

import com.android.ddmlib.log.LogReceiver; //导入依赖的package包/类
@Override
public void runEventLogService(LogReceiver logReceiver)
    throws TimeoutException, AdbCommandRejectedException, IOException {
  throw new UnsupportedOperationException();
}
 
开发者ID:facebook,项目名称:buck,代码行数:6,代码来源:TestDevice.java


示例19: runLogService

import com.android.ddmlib.log.LogReceiver; //导入依赖的package包/类
@Override
public void runLogService(String s, LogReceiver logReceiver)
    throws TimeoutException, AdbCommandRejectedException, IOException {
  throw new UnsupportedOperationException();
}
 
开发者ID:facebook,项目名称:buck,代码行数:6,代码来源:TestDevice.java


示例20: runEventLogService

import com.android.ddmlib.log.LogReceiver; //导入依赖的package包/类
@Override
public void runEventLogService(LogReceiver receiver)
		throws TimeoutException, AdbCommandRejectedException, IOException {
	// TODO Auto-generated method stub
	
}
 
开发者ID:oliver32767,项目名称:MonkeyBoard,代码行数:7,代码来源:DeviceController.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java NioSession类代码示例发布时间:2022-05-22
下一篇:
Java MRAsyncDiskService类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap