本文整理汇总了Java中android.os.Debug.startMethodTracing方法的典型用法代码示例。如果您正苦于以下问题:Java Debug.startMethodTracing方法的具体用法?Java Debug.startMethodTracing怎么用?Java Debug.startMethodTracing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.os.Debug
的用法示例。
在下文中一共展示了Debug.startMethodTracing方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: start
import android.os.Debug; //导入方法依赖的package包/类
void start(int initialVelocity) {
initialVelocity = modifyFlingInitialVelocity(initialVelocity);
int initialY = initialVelocity < 0 ? Integer.MAX_VALUE : 0;
mLastFlingY = initialY;
mScroller.fling(0, initialY, 0, initialVelocity,
0, Integer.MAX_VALUE, 0, Integer.MAX_VALUE);
mTouchMode = TOUCH_MODE_FLING;
post(this);
if (PROFILE_FLINGING) {
if (!mFlingProfilingStarted) {
Debug.startMethodTracing("AbsListViewFling");
mFlingProfilingStarted = true;
}
}
}
示例2: start
import android.os.Debug; //导入方法依赖的package包/类
void start(int initialVelocity) {
initialVelocity = modifyFlingInitialVelocity(initialVelocity);
int initialY = initialVelocity < 0 ? Integer.MAX_VALUE : 0;
mLastFlingY = initialY;
mScroller.fling(0, initialY, 0, initialVelocity, 0, Integer.MAX_VALUE, 0, Integer.MAX_VALUE);
if (DEBUG)
Log.d(TAG, String.format("String Fling: [%d, %d] to [%d]", initialY, initialVelocity, mScroller.getFinalY()));
mTouchMode = TOUCH_MODE_FLING;
post(this);
if (PROFILE_FLINGING) {
if (!mFlingProfilingStarted) {
Debug.startMethodTracing("AbsListViewFling");
mFlingProfilingStarted = true;
}
}
}
示例3: startupStep2
import android.os.Debug; //导入方法依赖的package包/类
void startupStep2()
{
// ***** LOG FRAMEWORK
TDLog.setLogTarget();
TDLog.loadLogPreferences( mPrefs );
mData.compileStatements();
PtCmapActivity.setMap( mPrefs.getString( "DISTOX_PT_CMAP", null ) );
TDSetting.loadSecondaryPreferences( this, mPrefs );
checkAutoPairing();
if ( TDLog.LOG_DEBUG ) {
isTracing = true;
Debug.startMethodTracing("DISTOX");
}
mPrefs.registerOnSharedPreferenceChangeListener( this );
// TDLog.Debug("ready");
}
示例4: handleActionDown
import android.os.Debug; //导入方法依赖的package包/类
private void handleActionDown(MotionEvent event) {
resetPattern();
final float x = event.getX();
final float y = event.getY();
final Cell hitCell = detectAndAddHit(x, y);
if (hitCell != null) {
mPatternInProgress = true;
mPatternDisplayMode = DisplayMode.Right;
notifyPatternStarted();
} else {
mPatternInProgress = false;
notifyPatternCleared();
}
if (hitCell != null) {
invalidate();
}
mInProgressX = x;
mInProgressY = y;
if (PROFILE_DRAWING) {
if (!mDrawingProfilingStarted) {
Debug.startMethodTracing("LockPatternDrawing");
mDrawingProfilingStarted = true;
}
}
}
示例5: onCreate
import android.os.Debug; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mCtx = MainMvpActivity.this;
initDatas();
Debug.startMethodTracing("traceFile");
// 自行维护观察者关系,跟随生命周期取消观察
// onInitView();
Debug.stopMethodTracing();
// 第一种写法:直接Post, 线程回调后不一定达成懒加载
// new MyBackTask().start();
// 第二种写法:直接PostDelay DEALY_TIME比较难控制.
// mainHandler.postDelayed(new MyBackTask(), DEALY_TIME);
/**
* 第三种写法:利用DecorView内部维护的Looper时机,优化的DelayLoad,在onResume之后回调
* 需要使用本地handler进行承接,注意post和sendMessage方式在线程调度上的区别
*/
getWindow().getDecorView().post(new Runnable() {
@Override
public void run() {
Log.d(TAG, "getDecorView.post: currentThread-> " + Thread.currentThread().getName());
// 懒加载3.1:-》main Thread
// mainHandler.post(new MyBackTask());
// 懒加载3.2:-》work Thread
mainHandler.obtainMessage(MSG_BACK_TASK).sendToTarget();
}
});
}
示例6: handleActionDown
import android.os.Debug; //导入方法依赖的package包/类
private void handleActionDown(MotionEvent event) {
resetPattern();
float x = event.getX();
float y = event.getY();
Dot hitDot = detectAndAddHit(x, y);
if (hitDot != null) {
mPatternInProgress = true;
mPatternViewMode = CORRECT;
notifyPatternStarted();
} else {
mPatternInProgress = false;
notifyPatternCleared();
}
if (hitDot != null) {
float startX = getCenterXForColumn(hitDot.mColumn);
float startY = getCenterYForRow(hitDot.mRow);
float widthOffset = mViewWidth / 2f;
float heightOffset = mViewHeight / 2f;
invalidate((int) (startX - widthOffset),
(int) (startY - heightOffset),
(int) (startX + widthOffset), (int) (startY + heightOffset));
}
mInProgressX = x;
mInProgressY = y;
if (PROFILE_DRAWING) {
if (!mDrawingProfilingStarted) {
Debug.startMethodTracing("PatternLockDrawing");
mDrawingProfilingStarted = true;
}
}
}
示例7: startLogging
import android.os.Debug; //导入方法依赖的package包/类
@SuppressLint("NewApi")
private void startLogging() {
if (getConfigBoolean("CAPTURE_NETLOG")) {
mCronetEngine.startNetLogToFile(
getFilesDir().getPath() + "/" + mName + ".json", false);
}
if (getConfigBoolean("CAPTURE_TRACE")) {
Debug.startMethodTracing(getFilesDir().getPath() + "/" + mName + ".trace");
} else if (getConfigBoolean("CAPTURE_SAMPLED_TRACE")) {
Debug.startMethodTracingSampling(
getFilesDir().getPath() + "/" + mName + ".trace", 8000000, 10);
}
}
示例8: handleActionDown
import android.os.Debug; //导入方法依赖的package包/类
private void handleActionDown(MotionEvent event) {
resetPattern();
final float x = event.getX();
final float y = event.getY();
final Cell hitCell = detectAndAddHit(x, y);
if (hitCell != null) {
mPatternInProgress = true;
mPatternDisplayMode = DisplayMode.Correct;
notifyPatternStarted();
} else {
mPatternInProgress = false;
notifyPatternCleared();
}
if (hitCell != null) {
final float startX = getCenterXForColumn(hitCell.column);
final float startY = getCenterYForRow(hitCell.row);
final float widthOffset = mSquareWidth / 2f;
final float heightOffset = mSquareHeight / 2f;
invalidate((int) (startX - widthOffset), (int) (startY - heightOffset),
(int) (startX + widthOffset), (int) (startY + heightOffset));
}
mInProgressX = x;
mInProgressY = y;
if (PROFILE_DRAWING) {
if (!mDrawingProfilingStarted) {
Debug.startMethodTracing("LockPatternDrawing");
mDrawingProfilingStarted = true;
}
}
}
示例9: startTracing
import android.os.Debug; //导入方法依赖的package包/类
public static void startTracing(String name) {
if (!debug)
return;
if (!TextUtils.isEmpty(name))
Debug.startMethodTracing(name);
tracingName = name;
tracingStartTime = System.currentTimeMillis();
}
示例10: handleActionDown
import android.os.Debug; //导入方法依赖的package包/类
private void handleActionDown(MotionEvent event) {
resetPattern();
final float x = event.getX();
final float y = event.getY();
final Cell hitCell = detectAndAddHit(x, y);
if (hitCell != null) {
mPatternInProgress = true;
mPatternDisplayMode = DisplayMode.Correct;
notifyPatternStarted();
} else if (mPatternInProgress) {
mPatternInProgress = false;
notifyPatternCleared();
}
if (hitCell != null) {
final float startX = getCenterXForColumn(hitCell.column);
final float startY = getCenterYForRow(hitCell.row);
final float widthOffset = mSquareWidth / 2f;
final float heightOffset = mSquareHeight / 2f;
invalidate((int) (startX - widthOffset),
(int) (startY - heightOffset),
(int) (startX + widthOffset), (int) (startY + heightOffset));
}
mInProgressX = x;
mInProgressY = y;
if (PROFILE_DRAWING) {
if (!mDrawingProfilingStarted) {
Debug.startMethodTracing("LockPatternDrawing");
mDrawingProfilingStarted = true;
}
}
}
示例11: handleActionDown
import android.os.Debug; //导入方法依赖的package包/类
private void handleActionDown(MotionEvent event) {
resetPattern();
final float x = event.getX();
final float y = event.getY();
final Cell hitCell = detectAndAddHit(x, y);
if (hitCell != null) {
mPatternInProgress = true;
mPatternDisplayMode = DisplayMode.Correct;
notifyPatternStarted();
} else if (mPatternInProgress) {
mPatternInProgress = false;
notifyPatternCleared();
}
if (hitCell != null) {
final float startX = getCenterXForColumn(hitCell.column);
final float startY = getCenterYForRow(hitCell.row);
final float widthOffset = mSquareWidth / 2f;
final float heightOffset = mSquareHeight / 2f;
invalidate((int) (startX - widthOffset), (int) (startY - heightOffset),
(int) (startX + widthOffset), (int) (startY + heightOffset));
}
mInProgressX = x;
mInProgressY = y;
if (PROFILE_DRAWING) {
if (!mDrawingProfilingStarted) {
Debug.startMethodTracing("LockPatternDrawing");
mDrawingProfilingStarted = true;
}
}
}
示例12: handleActionDown
import android.os.Debug; //导入方法依赖的package包/类
private void handleActionDown(MotionEvent event) {
resetPattern();
final float x = event.getX();
final float y = event.getY();
final Cell hitCell = detectAndAddHit(x, y);
if (hitCell != null) {
mPatternInProgress = true;
mPatternDisplayMode = DisplayMode.Correct;
notifyPatternStarted();
} else {
/*
* Original source check for mPatternInProgress == true first before
* calling this block. But if we do that, there will be nothing
* happened when the user taps at empty area and releases the
* finger. We want the pattern to be reset and the message will be
* updated after the user did that.
*/
mPatternInProgress = false;
notifyPatternCleared();
}
if (hitCell != null) {
final float startX = getCenterXForColumn(hitCell.column);
final float startY = getCenterYForRow(hitCell.row);
final float widthOffset = mSquareWidth / 2f;
final float heightOffset = mSquareHeight / 2f;
invalidate((int) (startX - widthOffset),
(int) (startY - heightOffset),
(int) (startX + widthOffset), (int) (startY + heightOffset));
}
mInProgressX = x;
mInProgressY = y;
if (PROFILE_DRAWING) {
if (!mDrawingProfilingStarted) {
Debug.startMethodTracing("LockPatternDrawing");
mDrawingProfilingStarted = true;
}
}
}
示例13: handleActionDown
import android.os.Debug; //导入方法依赖的package包/类
private void handleActionDown(MotionEvent event) {
clearPattern();
final float x = event.getX();
final float y = event.getY();
final Cell hitCell = detectAndAddHit(x, y);
if (hitCell != null) {
mPatternInProgress = true;
mPatternDisplayMode = DisplayMode.Correct;
notifyPatternStarted();
} else {
mPatternInProgress = false;
notifyPatternCleared();
}
if (hitCell != null) {
final float startX = getCenterXForColumn(hitCell.column);
final float startY = getCenterYForRow(hitCell.row);
final float widthOffset = mSquareWidth / 2f;
final float heightOffset = mSquareHeight / 2f;
invalidate((int) (startX - widthOffset), (int) (startY - heightOffset), (int) (startX + widthOffset), (int) (startY + heightOffset));
}
mInProgressX = x;
mInProgressY = y;
if (PROFILE_DRAWING) {
if (!mDrawingProfilingStarted) {
Debug.startMethodTracing("LockPatternDrawing");
mDrawingProfilingStarted = true;
}
}
}
示例14: onCreate
import android.os.Debug; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Debug.startMethodTracing("main");
setContentView(R.layout.act_main);
bindViews();
initData();
initFragments();
}
示例15: onMenuItemSelected
import android.os.Debug; //导入方法依赖的package包/类
@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
Intent i;
switch(item.getItemId()) {
case CHANGE_LEVEL_ID:
i = new Intent(this, LevelSelectActivity.class);
startActivityForResult(i, ACTIVITY_CHANGE_LEVELS);
return true;
case TEST_ANIMATION_ID:
i = new Intent(this, AnimationPlayerActivity.class);
i.putExtra("animation", AnimationPlayerActivity.ROKUDOU_ENDING);
startActivity(i);
return true;
case TEST_DIARY_ID:
i = new Intent(this, DiaryActivity.class);
i.putExtra("text", R.string.Diary10);
startActivity(i);
return true;
case METHOD_TRACING_ID:
if (mMethodTracing) {
Debug.stopMethodTracing();
} else {
Debug.startMethodTracing("andou");
}
mMethodTracing = !mMethodTracing;
return true;
}
return super.onMenuItemSelected(featureId, item);
}