當前位置: 首頁>>代碼示例>>Java>>正文


Java Debug.stopMethodTracing方法代碼示例

本文整理匯總了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();
}
 
開發者ID:klausw,項目名稱:hackerskeyboard,代碼行數:17,代碼來源:LatinIME.java

示例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();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:33,代碼來源:PerformanceTest.java

示例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();
}
 
開發者ID:PhilippC,項目名稱:keepass2android,代碼行數:16,代碼來源:KP2AKeyboard.java

示例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();


            }
        });
    }
 
開發者ID:BlueYangDroid,項目名稱:MvpPlus,代碼行數:35,代碼來源:MainMvpActivity.java

示例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;
}
 
開發者ID:aritraroy,項目名稱:PatternLockView,代碼行數:32,代碼來源:PatternLockView.java

示例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;
        }
    }
}
 
開發者ID:aritraroy,項目名稱:PatternLockView,代碼行數:16,代碼來源:PatternLockView.java

示例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();
}
 
開發者ID:rkkr,項目名稱:simple-keyboard,代碼行數:12,代碼來源:LatinIME.java

示例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();
    }
}
 
開發者ID:lizhangqu,項目名稱:chromium-net-for-android,代碼行數:9,代碼來源:CronetPerfTestActivity.java

示例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;
}
 
開發者ID:SShineTeam,項目名稱:Huochexing12306,代碼行數:31,代碼來源:LockPatternView.java

示例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;
        }
    }
}
 
開發者ID:SShineTeam,項目名稱:Huochexing12306,代碼行數:15,代碼來源:LockPatternView.java

示例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");
}
 
開發者ID:tranleduy2000,項目名稱:javaide,代碼行數:13,代碼來源:L.java

示例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;
}
 
開發者ID:Dnet3,項目名稱:CustomAndroidOneSheeld,代碼行數:33,代碼來源:LockPatternViewEx.java

示例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;
        }
    }
}
 
開發者ID:Dnet3,項目名稱:CustomAndroidOneSheeld,代碼行數:16,代碼來源:LockPatternViewEx.java

示例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();
}
 
開發者ID:john1jan,項目名稱:ReactNativeSignatureExample,代碼行數:41,代碼來源:DevSupportManagerImpl.java

示例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;
}
 
開發者ID:jiangzehui,項目名稱:xmpp,代碼行數:33,代碼來源:LockPatternView.java


注:本文中的android.os.Debug.stopMethodTracing方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。