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


Java Debug.isDebuggerConnected方法代码示例

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


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

示例1: handleMessage

import android.os.Debug; //导入方法依赖的package包/类
@Override
public boolean handleMessage(Message msg) {
    // TODO uncomment below code when release
    if (Debug.isDebuggerConnected()) {
        return true;
    }
    Event event = (Event) msg.obj;
    if (event != null) {
        try {
            processEvent(event);
        } catch (Exception e) {
            e.printStackTrace();
        }
        event.recycle();
    }
    // return true, so handler won't process this msg again, since we have event recycled here
    return true;
}
 
开发者ID:zhangjianli,项目名称:StallBuster,代码行数:19,代码来源:EventProcessor.java

示例2: println

import android.os.Debug; //导入方法依赖的package包/类
@Override
public void println(String x) {
    if (mStopWhenDebugging && Debug.isDebuggerConnected()) {
        return;
    }
    if (!mPrintingStarted) {
        mStartTimestamp = System.currentTimeMillis();
        mStartThreadTimestamp = SystemClock.currentThreadTimeMillis();
        mPrintingStarted = true;
        startDump();
    } else {
        final long endTime = System.currentTimeMillis();
        mPrintingStarted = false;
        if (isBlock(endTime)) {
            notifyBlockEvent(endTime);
        }
        stopDump();
    }
}
 
开发者ID:markzhai,项目名称:AndroidPerformanceMonitor,代码行数:20,代码来源:LooperMonitor.java

示例3: println

import android.os.Debug; //导入方法依赖的package包/类
@Override
public void println(String x) {
    this.mStartedPrinting = !this.mStartedPrinting;
    if (this.mStartedPrinting) {
        this.mDebuggerConnected = Debug.isDebuggerConnected();
    }

    if (this.mDebuggerConnected) {
        if (this.mStartedPrinting) {
            this.mStartUpTime = SystemClock.uptimeMillis();
            this.mStartThreadTime = SystemClock.currentThreadTimeMillis();
            this.mLooperLog = x;
            this.beginTrace(this.mStartUpTime);
        } else {
            long costTime = SystemClock.uptimeMillis() - this.mStartUpTime;
            this.endTrace();
            if (this.isBlock(costTime)) {
                this.notifyBlock(costTime);
            }
        }
    }
}
 
开发者ID:succlz123,项目名称:S1-Go,代码行数:23,代码来源:BlockPrinter.java

示例4: showBlockTips

import android.os.Debug; //导入方法依赖的package包/类
private void showBlockTips() {
    if (!BuildConfig.DEBUG) {
        return;
    }
    if (Debug.isDebuggerConnected()) {
        return;
    }
    String msg = "打开Logcat,设置过滤级别为:DEBUG,过滤字符串为:BlockUtils," +
            "可以看到BlockUtils检测到的卡顿代码位置。";
    Log.w(TAG, msg);
    Toast.makeText(this, msg, Toast.LENGTH_LONG).show();
}
 
开发者ID:aesean,项目名称:ActivityStack,代码行数:13,代码来源:MainActivity.java

示例5: run

import android.os.Debug; //导入方法依赖的package包/类
@Override
public void run() {
	while (dialog != null && !Debug.isDebuggerConnected()) {
		try {
			Thread.sleep(200);
		} catch (InterruptedException e) {

		}
	}
	sendEmptyMessage(2);
}
 
开发者ID:Mastermiao,项目名称:APK,代码行数:12,代码来源:DevLoaderActivity.java

示例6: keepScreenOnWhileDebugging

import android.os.Debug; //导入方法依赖的package包/类
/**
 * Keep screen on while debugging.
 *
 * @param activity  the activity
 * @param debugging the debugging
 */
public static void keepScreenOnWhileDebugging(Activity activity, boolean debugging) {
    if (debugging) { // don't even consider it otherwise
        if (Debug.isDebuggerConnected()) {
            Log.d("SCREEN",
                    "Keeping screen on for debugging, detach debugger and force an onResume to turn it off.");
            activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
        } else {
            activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
            Log.d("SCREEN", "Keeping screen on for debugging is now deactivated.");
        }
    }
}
 
开发者ID:nisrulz,项目名称:android-utils,代码行数:19,代码来源:DebugUtils.java

示例7: ServiceProxy

import android.os.Debug; //导入方法依赖的package包/类
public ServiceProxy(Context context, Intent intent) {
    mContext = context;
    mIntent = intent;
    mTag = getClass().getSimpleName();
    if (Debug.isDebuggerConnected()) {
        mTimeout <<= 2;
    }
    mLogger = LoggerManager.getLogger(getClass());
}
 
开发者ID:NickAndroid,项目名称:Accessories_Android,代码行数:10,代码来源:ServiceProxy.java

示例8: wait_for_manual_attachment_of_debugger

import android.os.Debug; //导入方法依赖的package包/类
/**
 * Wait for the debugger to be manually attached to this running process.
 * Use this to debug test execution by adding this step to your test scenario and
 * when the test is running in Android Studio choose menu "Run - Attach debugger to Android process",
 * finally select the name of your app package from the list of processes displayed.
 */
@Given("^I wait for manual attachment of the debugger$")
public void wait_for_manual_attachment_of_debugger() throws InterruptedException {
    while (!Debug.isDebuggerConnected()) {
        Thread.sleep(1000);
    }
}
 
开发者ID:sebaslogen,项目名称:CleanGUITestArchitecture,代码行数:13,代码来源:StepDefinitions.java

示例9: run

import android.os.Debug; //导入方法依赖的package包/类
@Override
public void run() {
    int lastTickNumber;
    while (!isStop) {
        lastTickNumber = tickCounter;
        uiHandler.post(ticker);

        try {
            Thread.sleep(frequency);
        } catch (InterruptedException e) {
            e.printStackTrace();
            break;
        }

        if (lastTickNumber == tickCounter) {
            if (!ignoreDebugger && Debug.isDebuggerConnected()) {
                Log.w(TAG, "当前由调试模式引起消息阻塞引起ANR,可以通过setIgnoreDebugger(true)来忽略调试模式造成的ANR");
                continue;
            }

            BlockError blockError;
            if (!reportAllThreadInfo) {
                blockError = BlockError.getUiThread();
            } else {
                blockError = BlockError.getAllThread();
            }

            if (onBlockListener != null) {
                onBlockListener.onBlock(blockError);
            }

            if (saveLog) {
                if (StorageUtils.isMounted()) {
                    File logDir = getLogDirectory();
                    saveLogToSdcard(blockError, logDir);
                } else {
                    Log.w(TAG, "sdcard is unmounted");
                }
            }
        }

    }
}
 
开发者ID:D-clock,项目名称:AndroidPerformanceTools,代码行数:44,代码来源:BlockLooper.java

示例10: isDebuggerAttached

import android.os.Debug; //导入方法依赖的package包/类
public static boolean isDebuggerAttached() {
    return Debug.isDebuggerConnected() || Debug.waitingForDebugger();
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:4,代码来源:CommonUtils.java

示例11: isDebuggerAttached

import android.os.Debug; //导入方法依赖的package包/类
public boolean isDebuggerAttached() {
    return Debug.isDebuggerConnected();
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:4,代码来源:AndroidDebuggerControl.java

示例12: isDebuggerAttached

import android.os.Debug; //导入方法依赖的package包/类
@Override public boolean isDebuggerAttached() {
  return Debug.isDebuggerConnected();
}
 
开发者ID:shengxiadeyu,项目名称:leakcannary,代码行数:4,代码来源:AndroidDebuggerControl.java

示例13: run

import android.os.Debug; //导入方法依赖的package包/类
@Override
public void run() {
    int lastTickNumber;
    while (!isStop) {
        lastTickNumber = tickCounter;
        uiHandler.post(ticker);

        try {
            Thread.sleep(frequency);
        } catch (InterruptedException e) {
            e.printStackTrace();
            break;
        }

        if (lastTickNumber == tickCounter) {
            if (!ignoreDebugger && Debug.isDebuggerConnected()) {
                Log.w(TAG, "当前由调试模式引起消息阻塞引起ANR,可以通过setIgnoreDebugger(true)来忽略调试模式造成的ANR");
                continue;
            }

            BlockError blockError;
            if (!reportAllThreadInfo) {
                blockError = BlockError.getUiThread();
            } else {
                blockError = BlockError.getAllThread();
            }

            if (onBlockListener != null) {
                onBlockListener.onBlock(blockError);
            }

            if (saveLog) {
                if (SdCradUtils.isSDCardEnable()) {
                    File logDir = getLogDirectory();
                    saveLogToSdcard(blockError, logDir);
                } else {
                    Log.w(TAG, "sdcard is unmounted");
                }
            }
        }

    }
}
 
开发者ID:Alex-Jerry,项目名称:LLApp,代码行数:44,代码来源:BlockLooper.java

示例14: process

import android.os.Debug; //导入方法依赖的package包/类
/**
 * Called internally by the stage to render the touch map and process queued touch events.
 *
 * @param context The rendering context
 */
public void process(RenderingContext context) {
    if (target == null) {
        return;
    }
    context.bindTarget(target);
    context.clear(0, 0, 1);
    ShaderProgram shaderBackup = context.getShader();
    context.setShader(shader);
    for (Map.Entry<Integer, TouchButton> entry : buttons.entrySet()) {
        final TouchButton button = entry.getValue();
        shader.feedObjectId((entry.getKey() + 256) % 256);
        context.pushMatrix(button.popLatestMatrix());
        button.render(context, Renderable.FLAG_PRESERVE_SHADER_PROGRAM);
        context.popMatrix();
    }
    while (!processQueue.isEmpty()) {
        final TouchEvent event = processQueue.poll();
        pixelBuffer.position(0);
        GLES20.glReadPixels(
                (int) event.x >> 1, target.getHeight() - ((int) event.y >> 1), 1, 1,
                GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, pixelBuffer
        );
        dispatchQueue.offer(new Pair<>(buttons.get((int) pixelBuffer.get(0)), event));
    }
    context.bindTarget(null);
    if (show && Debug.isDebuggerConnected()) {
        TextureShaderProgram program = (TextureShaderProgram) TextureManager.getShaderProgram();
        context.setShader(program);
        context.setColorFilter(0.75f, 0.75f, 0.75f, 0.75f);
        context.pushMatrix();
        context.identity();
        program.feed(target.getTextureHandle());
        program.feedTexCoords(TextureShaderProgram.getDefaultTextureBuffer());
        context.translate(520, 280);
        context.rotate(0);
        context.scale(1000, -600);
        context.rect();
        context.popMatrix();
    }
    GLES20.glViewport(0, 0, context.getScreenWidth(), context.getScreenHeight());
    context.setShader(shaderBackup);
}
 
开发者ID:hessan,项目名称:artenus,代码行数:48,代码来源:TouchMap.java

示例15: setState

import android.os.Debug; //导入方法依赖的package包/类
void setState(CacheState newState){
    if (Debug.isDebuggerConnected())
        Log.i(TAG,String.format("cacheState old=%s new=%s",state.toString(),newState.toString()));
    state = newState;
}
 
开发者ID:androidmalin,项目名称:WorldmapLibrary,代码行数:6,代码来源:Scene.java


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