本文整理汇总了Java中android.os.Debug.stopMethodTracing方法的典型用法代码示例。如果您正苦于以下问题:Java Debug.stopMethodTracing方法的具体用法?Java Debug.stopMethodTracing怎么用?Java Debug.stopMethodTracing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.os.Debug
的用法示例。
在下文中一共展示了Debug.stopMethodTracing方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: hideWindow
import android.os.Debug; //导入方法依赖的package包/类
@Override
public void hideWindow() {
LatinImeLogger.commit();
onAutoCompletionStateChanged(false);
if (TRACE)
Debug.stopMethodTracing();
if (mOptionsDialog != null && mOptionsDialog.isShowing()) {
mOptionsDialog.dismiss();
mOptionsDialog = null;
}
mWordToSuggestions.clear();
mWordHistory.clear();
super.hideWindow();
TextEntryState.endSession();
}
示例2: runOneByOneTests
import android.os.Debug; //导入方法依赖的package包/类
protected void runOneByOneTests(List<T> list, int loadCount, int modifyCount) {
dao.insertInTx(list);
List<K> keys = new ArrayList<K>(loadCount);
for (int i = 0; i < loadCount; i++) {
keys.add(daoAccess.getKey(list.get(i)));
}
clearIdentityScopeIfAny();
list = runLoadOneByOne(keys, "load-one-by-one-1");
list = runLoadOneByOne(keys, "load-one-by-one-2");
Debug.stopMethodTracing();
dao.deleteAll();
startClock("insert-one-by-one");
for (int i = 0; i < modifyCount; i++) {
dao.insert(list.get(i));
}
stopClock();
startClock("update-one-by-one");
for (int i = 0; i < modifyCount; i++) {
dao.update(list.get(i));
}
stopClock();
startClock("delete-one-by-one");
for (int i = 0; i < modifyCount; i++) {
dao.delete(list.get(i));
}
stopClock();
}
示例3: hideWindow
import android.os.Debug; //导入方法依赖的package包/类
@Override
public void hideWindow() {
LatinImeLogger.commit();
onAutoCompletionStateChanged(false);
if (TRACE) Debug.stopMethodTracing();
if (mOptionsDialog != null && mOptionsDialog.isShowing()) {
mOptionsDialog.dismiss();
mOptionsDialog = null;
}
mWordToSuggestions.clear();
mWordHistory.clear();
super.hideWindow();
TextEntryState.endSession();
}
示例4: 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();
}
});
}
示例5: onTouchEvent
import android.os.Debug; //导入方法依赖的package包/类
@Override
public boolean onTouchEvent(MotionEvent event) {
if (!mInputEnabled || !isEnabled()) {
return false;
}
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
handleActionDown(event);
return true;
case MotionEvent.ACTION_UP:
handleActionUp(event);
return true;
case MotionEvent.ACTION_MOVE:
handleActionMove(event);
return true;
case MotionEvent.ACTION_CANCEL:
mPatternInProgress = false;
resetPattern();
notifyPatternCleared();
if (PROFILE_DRAWING) {
if (mDrawingProfilingStarted) {
Debug.stopMethodTracing();
mDrawingProfilingStarted = false;
}
}
return true;
}
return false;
}
示例6: handleActionUp
import android.os.Debug; //导入方法依赖的package包/类
private void handleActionUp(MotionEvent event) {
// Report pattern detected
if (!mPattern.isEmpty()) {
mPatternInProgress = false;
cancelLineAnimations();
notifyPatternDetected();
invalidate();
}
if (PROFILE_DRAWING) {
if (mDrawingProfilingStarted) {
Debug.stopMethodTracing();
mDrawingProfilingStarted = false;
}
}
}
示例7: hideWindow
import android.os.Debug; //导入方法依赖的package包/类
@Override
public void hideWindow() {
mKeyboardSwitcher.onHideWindow();
if (TRACE) Debug.stopMethodTracing();
if (isShowingOptionDialog()) {
mOptionsDialog.dismiss();
mOptionsDialog = null;
}
super.hideWindow();
}
示例8: stopLogging
import android.os.Debug; //导入方法依赖的package包/类
private void stopLogging() {
if (getConfigBoolean("CAPTURE_NETLOG")) {
mCronetEngine.stopNetLog();
}
if (getConfigBoolean("CAPTURE_TRACE") || getConfigBoolean("CAPTURE_SAMPLED_TRACE")) {
Debug.stopMethodTracing();
}
}
示例9: onTouchEvent
import android.os.Debug; //导入方法依赖的package包/类
@Override
public boolean onTouchEvent(MotionEvent event) {
if (!mInputEnabled || !isEnabled()) {
return false;
}
switch(event.getAction()) {
case MotionEvent.ACTION_DOWN:
handleActionDown(event);
return true;
case MotionEvent.ACTION_UP:
handleActionUp(event);
return true;
case MotionEvent.ACTION_MOVE:
handleActionMove(event);
return true;
case MotionEvent.ACTION_CANCEL:
resetPattern();
mPatternInProgress = false;
notifyPatternCleared();
if (PROFILE_DRAWING) {
if (mDrawingProfilingStarted) {
Debug.stopMethodTracing();
mDrawingProfilingStarted = false;
}
}
return true;
}
return false;
}
示例10: handleActionUp
import android.os.Debug; //导入方法依赖的package包/类
private void handleActionUp(MotionEvent event) {
// report pattern detected
if (!mPattern.isEmpty()) {
mPatternInProgress = false;
notifyPatternDetected();
invalidate();
}
if (PROFILE_DRAWING) {
if (mDrawingProfilingStarted) {
Debug.stopMethodTracing();
mDrawingProfilingStarted = false;
}
}
}
示例11: stopTracing
import android.os.Debug; //导入方法依赖的package包/类
public static void stopTracing() {
if (!debug)
return;
long tracingStopTime = System.currentTimeMillis();
if (!TextUtils.isEmpty(tracingName))
Debug.stopMethodTracing();
float ts = (tracingStopTime - tracingStartTime) / 1000f;
L.d("Tracing Name: " + tracingName + " Consuming Time: " + ts + "s");
}
示例12: onTouchEvent
import android.os.Debug; //导入方法依赖的package包/类
@Override
public boolean onTouchEvent(MotionEvent event) {
if (!mInputEnabled || !isEnabled()) {
return false;
}
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
handleActionDown(event);
return true;
case MotionEvent.ACTION_UP:
handleActionUp(event);
return true;
case MotionEvent.ACTION_MOVE:
handleActionMove(event);
return true;
case MotionEvent.ACTION_CANCEL:
if (mPatternInProgress) {
mPatternInProgress = false;
resetPattern();
notifyPatternCleared();
}
if (PROFILE_DRAWING) {
if (mDrawingProfilingStarted) {
Debug.stopMethodTracing();
mDrawingProfilingStarted = false;
}
}
return true;
}
return false;
}
示例13: handleActionUp
import android.os.Debug; //导入方法依赖的package包/类
private void handleActionUp(MotionEvent event) {
// report pattern detected
if (!mPattern.isEmpty()) {
mPatternInProgress = false;
cancelLineAnimations();
notifyPatternDetected();
invalidate();
}
if (PROFILE_DRAWING) {
if (mDrawingProfilingStarted) {
Debug.stopMethodTracing();
mDrawingProfilingStarted = false;
}
}
}
示例14: resetCurrentContext
import android.os.Debug; //导入方法依赖的package包/类
private void resetCurrentContext(@Nullable ReactContext reactContext) {
if (mCurrentContext == reactContext) {
// new context is the same as the old one - do nothing
return;
}
// if currently profiling stop and write the profile file
if (mIsCurrentlyProfiling) {
mIsCurrentlyProfiling = false;
String profileName = (Environment.getExternalStorageDirectory().getPath() +
"/profile_" + mProfileIndex + ".json");
mProfileIndex++;
Debug.stopMethodTracing();
mCurrentContext.getCatalystInstance().stopProfiler("profile", profileName);
}
mCurrentContext = reactContext;
// Recreate debug overlay controller with new CatalystInstance object
if (mDebugOverlayController != null) {
mDebugOverlayController.setFpsDebugViewVisible(false);
}
if (reactContext != null) {
mDebugOverlayController = new DebugOverlayController(reactContext);
}
if (mDevSettings.isHotModuleReplacementEnabled() && mCurrentContext != null) {
try {
URL sourceUrl = new URL(getSourceUrl());
String path = sourceUrl.getPath().substring(1); // strip initial slash in path
String host = sourceUrl.getHost();
int port = sourceUrl.getPort();
mCurrentContext.getJSModule(HMRClient.class).enable("android", path, host, port);
} catch (MalformedURLException e) {
showNewJavaError(e.getMessage(), e);
}
}
reloadSettings();
}
示例15: onTouchEvent
import android.os.Debug; //导入方法依赖的package包/类
@Override
public boolean onTouchEvent(MotionEvent event) {
if (!mInputEnabled || !isEnabled()) {
return false;
}
switch(event.getAction()) {
case MotionEvent.ACTION_DOWN:
handleActionDown(event);
return true;
case MotionEvent.ACTION_UP:
handleActionUp(event);
return true;
case MotionEvent.ACTION_MOVE:
handleActionMove(event);
return true;
case MotionEvent.ACTION_CANCEL:
if (mPatternInProgress) {
mPatternInProgress = false;
resetPattern();
notifyPatternCleared();
}
if (PROFILE_DRAWING) {
if (mDrawingProfilingStarted) {
Debug.stopMethodTracing();
mDrawingProfilingStarted = false;
}
}
return true;
}
return false;
}