Example usage for android.os Debug stopMethodTracing

List of usage examples for android.os Debug stopMethodTracing

Introduction

In this page you can find the example usage for android.os Debug stopMethodTracing.

Prototype

public static void stopMethodTracing() 

Source Link

Document

Stop method tracing.

Usage

From source file:Main.java

/**
 * Stop method tracing.
 */
public static void stopMethodTracing() {
    if (isDebug) {
        Debug.stopMethodTracing();
    }
}

From source file:com.anysoftkeyboard.ui.dev.DeveloperUtils.java

public static void stopTracing() {
    try {/*from   w w w .  j a v  a2s.  c o  m*/
        Debug.stopMethodTracing();
    } catch (Exception e) {
        e.printStackTrace();
        Logger.w("DEBUG_TOOLS", "Failed to stop method tracing. ", e);
    }
    msTracingStarted = false;
}

From source file:com.ecoplayer.beta.MainActivity.java

@Override
protected void onDestroy() {
    unregisterReceiver(broadcastReceiver);
    Debug.stopMethodTracing();
    super.onDestroy();
}

From source file:com.binomed.showtime.android.util.activity.AbstractCineShowTimeActivity.java

@Override
protected void onDestroy() {
    super.onDestroy();
    closeDB();//from w w  w.ja v a  2  s .c o  m
    getTracker().dispatch();
    getTracker().stop();
    if (CineShowtimeCst.TRACE_VIEW_ENABLE) {
        Debug.stopMethodTracing();
    }
}

From source file:com.android.calendar.Event.java

/**
 * Loads <i>days</i> days worth of instances starting at <i>startDay</i>.
 *///  ww  w .j ava 2s  . c o  m
public static void loadEvents(Context context, ArrayList<Event> events, int startDay, int days, int requestId,
        AtomicInteger sequenceNumber) {

    if (PROFILE) {
        Debug.startMethodTracing("loadEvents");
    }

    if (Build.VERSION.SDK_INT >= 23 && ContextCompat.checkSelfPermission(context,
            Manifest.permission.READ_CALENDAR) != PackageManager.PERMISSION_GRANTED) {
        //If permission is not granted then just return.
        return;
    }

    Cursor cEvents = null;
    Cursor cAllday = null;

    events.clear();
    try {
        int endDay = startDay + days - 1;

        // We use the byDay instances query to get a list of all events for
        // the days we're interested in.
        // The sort order is: events with an earlier start time occur
        // first and if the start times are the same, then events with
        // a later end time occur first. The later end time is ordered
        // first so that long rectangles in the calendar views appear on
        // the left side.  If the start and end times of two events are
        // the same then we sort alphabetically on the title.  This isn't
        // required for correctness, it just adds a nice touch.

        // Respect the preference to show/hide declined events
        SharedPreferences prefs = GeneralPreferences.getSharedPreferences(context);
        boolean hideDeclined = prefs.getBoolean(GeneralPreferences.KEY_HIDE_DECLINED, false);

        String where = EVENTS_WHERE;
        String whereAllday = ALLDAY_WHERE;
        if (hideDeclined) {
            String hideString = " AND " + Instances.SELF_ATTENDEE_STATUS + "!="
                    + Attendees.ATTENDEE_STATUS_DECLINED;
            where += hideString;
            whereAllday += hideString;
        }

        cEvents = instancesQuery(context.getContentResolver(), EVENT_PROJECTION, startDay, endDay, where, null,
                SORT_EVENTS_BY);
        cAllday = instancesQuery(context.getContentResolver(), EVENT_PROJECTION, startDay, endDay, whereAllday,
                null, SORT_ALLDAY_BY);

        // Check if we should return early because there are more recent
        // load requests waiting.
        if (requestId != sequenceNumber.get()) {
            return;
        }

        buildEventsFromCursor(events, cEvents, context, startDay, endDay);
        buildEventsFromCursor(events, cAllday, context, startDay, endDay);

    } finally {
        if (cEvents != null) {
            cEvents.close();
        }
        if (cAllday != null) {
            cAllday.close();
        }
        if (PROFILE) {
            Debug.stopMethodTracing();
        }
    }
}

From source file:com.rexmtorres.android.patternlock.PatternLockView.java

@Override
public boolean onTouchEvent(MotionEvent event) {
    if (!mInputEnabled || !isEnabled()) {
        return false;
    }/*from  w w w  .  ja  v  a  2  s.  c  o  m*/
    switch (event.getAction()) {
    case MotionEvent.ACTION_DOWN:
        handleActionDown(event);
        return true;
    case MotionEvent.ACTION_UP:
        handleActionUp();
        return true;
    case MotionEvent.ACTION_MOVE:
        handleActionMove(event);
        return true;
    case MotionEvent.ACTION_CANCEL:
        if (mPatternInProgress) {
            setPatternInProgress(false);
            resetPattern();
            notifyPatternCleared();
        }
        if (PROFILE_DRAWING) {
            if (mDrawingProfilingStarted) {
                Debug.stopMethodTracing();
                mDrawingProfilingStarted = false;
            }
        }
        return true;
    }
    return false;
}

From source file:org.rapidandroid.activity.FormReviewer.java

private void doRandomizedInjection() {
    Random random = new Random();

    // Debug.startMethodTracing("injection");
    for (int i = 0; i < 100; i++) {

        // first, let's get the
        String token = phones[random.nextInt(phones.length)];// Long.toString(Math.abs(r.nextLong()),
        // 36);/*from ww  w .  ja  v  a 2s  . co m*/
        Monitor monitor = MessageTranslator.GetMonitorAndInsertIfNew(this, token);

        Uri writeMessageUri = RapidSmsDBConstants.Message.CONTENT_URI;

        StringBuilder sb = this.generateRandomMessage();
        ContentValues messageValues = new ContentValues();
        messageValues.put(RapidSmsDBConstants.Message.MESSAGE, sb.toString());
        messageValues.put(RapidSmsDBConstants.Message.MONITOR, monitor.getID());

        Date now = getRandomDate();

        messageValues.put(RapidSmsDBConstants.Message.TIME, Message.SQLDateFormatter.format(now));
        messageValues.put(RapidSmsDBConstants.Message.IS_OUTGOING, false);

        Uri msgUri = null;

        msgUri = getContentResolver().insert(writeMessageUri, messageValues);

        Vector<IParseResult> results = ParsingService.ParseMessage(mForm, sb.toString());
        ParsedDataTranslator.InsertFormData(this, mForm,
                Integer.valueOf(msgUri.getPathSegments().get(1)).intValue(), results);
    }

    Debug.stopMethodTracing();

}

From source file:com.hippo.widget.lockpattern.LockPatternView.java

@Override
public boolean onTouchEvent(@NonNull MotionEvent event) {
    if (!mInputEnabled || !isEnabled()) {
        return false;
    }/*from   w  w w  . j  a  v a2 s.com*/

    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;
}

From source file:de.gebatzens.sia.MainActivity.java

@Override
public void onBackPressed() {
    if (shared.size() > 0) {
        resetShareToolbar();//from   w w  w  .  j  av a2 s.c  o  m
        return;
    }

    Debug.stopMethodTracing();
    if (mDrawerLayout.isDrawerOpen(GravityCompat.START)) {
        mDrawerLayout.closeDrawer(GravityCompat.START);
    } else {
        super.onBackPressed();
    }
}

From source file:com.hippo.widget.lockpattern.LockPatternView.java

private void handleActionUp(MotionEvent event) {
    // report pattern detected
    if (!mPattern.isEmpty()) {
        mPatternInProgress = false;//from w w w .  j  a  v a2  s .com
        cancelLineAnimations();
        notifyPatternDetected();
        invalidate();
    }
    if (PROFILE_DRAWING) {
        if (mDrawingProfilingStarted) {
            Debug.stopMethodTracing();
            mDrawingProfilingStarted = false;
        }
    }
}