本文整理匯總了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;
}