Java Code Examples for android.support.v4.util.TimeUtils

The following examples show how to use android.support.v4.util.TimeUtils. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: letv   Source File: AsyncTaskLoader.java    License: Apache License 2.0 6 votes vote down vote up
public void dump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args) {
    super.dump(prefix, fd, writer, args);
    if (this.mTask != null) {
        writer.print(prefix);
        writer.print("mTask=");
        writer.print(this.mTask);
        writer.print(" waiting=");
        writer.println(this.mTask.waiting);
    }
    if (this.mCancellingTask != null) {
        writer.print(prefix);
        writer.print("mCancellingTask=");
        writer.print(this.mCancellingTask);
        writer.print(" waiting=");
        writer.println(this.mCancellingTask.waiting);
    }
    if (this.mUpdateThrottle != 0) {
        writer.print(prefix);
        writer.print("mUpdateThrottle=");
        TimeUtils.formatDuration(this.mUpdateThrottle, writer);
        writer.print(" mLastLoadCompleteTime=");
        TimeUtils.formatDuration(this.mLastLoadCompleteTime, SystemClock.uptimeMillis(), writer);
        writer.println();
    }
}
 
Example 2
Source Project: CodenameOne   Source File: AsyncTaskLoader.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Override
public void dump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args) {
    super.dump(prefix, fd, writer, args);
    if (mTask != null) {
        writer.print(prefix); writer.print("mTask="); writer.print(mTask);
                writer.print(" waiting="); writer.println(mTask.waiting);
    }
    if (mCancellingTask != null) {
        writer.print(prefix); writer.print("mCancellingTask="); writer.print(mCancellingTask);
                writer.print(" waiting="); writer.println(mCancellingTask.waiting);
    }
    if (mUpdateThrottle != 0) {
        writer.print(prefix); writer.print("mUpdateThrottle=");
                TimeUtils.formatDuration(mUpdateThrottle, writer);
                writer.print(" mLastLoadCompleteTime=");
                TimeUtils.formatDuration(mLastLoadCompleteTime,
                        SystemClock.uptimeMillis(), writer);
                writer.println();
    }
}
 
Example 3
Source Project: adt-leanback-support   Source File: AsyncTaskLoader.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void dump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args) {
    super.dump(prefix, fd, writer, args);
    if (mTask != null) {
        writer.print(prefix); writer.print("mTask="); writer.print(mTask);
                writer.print(" waiting="); writer.println(mTask.waiting);
    }
    if (mCancellingTask != null) {
        writer.print(prefix); writer.print("mCancellingTask="); writer.print(mCancellingTask);
                writer.print(" waiting="); writer.println(mCancellingTask.waiting);
    }
    if (mUpdateThrottle != 0) {
        writer.print(prefix); writer.print("mUpdateThrottle=");
                TimeUtils.formatDuration(mUpdateThrottle, writer);
                writer.print(" mLastLoadCompleteTime=");
                TimeUtils.formatDuration(mLastLoadCompleteTime,
                        SystemClock.uptimeMillis(), writer);
                writer.println();
    }
}
 
Example 4
Source Project: android-recipes-app   Source File: AsyncTaskLoader.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void dump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args) {
    super.dump(prefix, fd, writer, args);
    if (mTask != null) {
        writer.print(prefix); writer.print("mTask="); writer.print(mTask);
                writer.print(" waiting="); writer.println(mTask.waiting);
    }
    if (mCancellingTask != null) {
        writer.print(prefix); writer.print("mCancellingTask="); writer.print(mCancellingTask);
                writer.print(" waiting="); writer.println(mCancellingTask.waiting);
    }
    if (mUpdateThrottle != 0) {
        writer.print(prefix); writer.print("mUpdateThrottle=");
                TimeUtils.formatDuration(mUpdateThrottle, writer);
                writer.print(" mLastLoadCompleteTime=");
                TimeUtils.formatDuration(mLastLoadCompleteTime,
                        SystemClock.uptimeMillis(), writer);
                writer.println();
    }
}
 
Example 5
Source Project: V.FlyoutTest   Source File: AsyncTaskLoader.java    License: MIT License 6 votes vote down vote up
@Override
public void dump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args) {
    super.dump(prefix, fd, writer, args);
    if (mTask != null) {
        writer.print(prefix); writer.print("mTask="); writer.print(mTask);
                writer.print(" waiting="); writer.println(mTask.waiting);
    }
    if (mCancellingTask != null) {
        writer.print(prefix); writer.print("mCancellingTask="); writer.print(mCancellingTask);
                writer.print(" waiting="); writer.println(mCancellingTask.waiting);
    }
    if (mUpdateThrottle != 0) {
        writer.print(prefix); writer.print("mUpdateThrottle=");
                TimeUtils.formatDuration(mUpdateThrottle, writer);
                writer.print(" mLastLoadCompleteTime=");
                TimeUtils.formatDuration(mLastLoadCompleteTime,
                        SystemClock.uptimeMillis(), writer);
                writer.println();
    }
}
 
Example 6
Source Project: guideshow   Source File: AsyncTaskLoader.java    License: MIT License 6 votes vote down vote up
@Override
public void dump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args) {
    super.dump(prefix, fd, writer, args);
    if (mTask != null) {
        writer.print(prefix); writer.print("mTask="); writer.print(mTask);
                writer.print(" waiting="); writer.println(mTask.waiting);
    }
    if (mCancellingTask != null) {
        writer.print(prefix); writer.print("mCancellingTask="); writer.print(mCancellingTask);
                writer.print(" waiting="); writer.println(mCancellingTask.waiting);
    }
    if (mUpdateThrottle != 0) {
        writer.print(prefix); writer.print("mUpdateThrottle=");
                TimeUtils.formatDuration(mUpdateThrottle, writer);
                writer.print(" mLastLoadCompleteTime=");
                TimeUtils.formatDuration(mLastLoadCompleteTime,
                        SystemClock.uptimeMillis(), writer);
                writer.println();
    }
}
 
Example 7
@Override
public String toString () {
    StringBuilder s = new StringBuilder();
    s.append("BGLocation[").append(provider);
    s.append(String.format(" %.6f,%.6f", latitude, longitude));
    s.append(" id=").append(locationId);
    if (hasAccuracy) {
        s.append(String.format(" acc=%.0f", accuracy));
    } else {
        s.append(" acc=???");
    }
    if (time == 0) {
        s.append(" t=?!?");
    } else {
        s.append(" t=").append(time);
    }
    if (elapsedRealtimeNanos == 0) {
        s.append(" et=?!?");
    } else {
        s.append(" et=");
        TimeUtils.formatDuration(elapsedRealtimeNanos / 1000000L, s);
    }
    if (hasAltitude) s.append(" alt=").append(altitude);
    if (hasSpeed) s.append(" vel=").append(speed);
    if (hasBearing) s.append(" bear=").append(bearing);
    if (hasRadius) s.append(" radius=").append(radius);
    if (isFromMockProvider()) s.append(" mock");
    if (areMockLocationsEnabled()) s.append(" mocksEnabled");
    if (extras != null) {
        s.append(" {").append(extras).append('}');
    }
    s.append(" locprov=").append(locationProvider);
    s.append("]");

    return s.toString();
}
 
Example 8
Source Project: MiBandDecompiled   Source File: AsyncTaskLoader.java    License: Apache License 2.0 5 votes vote down vote up
public void dump(String s, FileDescriptor filedescriptor, PrintWriter printwriter, String as[])
{
    super.dump(s, filedescriptor, printwriter, as);
    if (c != null)
    {
        printwriter.print(s);
        printwriter.print("mTask=");
        printwriter.print(c);
        printwriter.print(" waiting=");
        printwriter.println(c.b);
    }
    if (d != null)
    {
        printwriter.print(s);
        printwriter.print("mCancellingTask=");
        printwriter.print(d);
        printwriter.print(" waiting=");
        printwriter.println(d.b);
    }
    if (e != 0L)
    {
        printwriter.print(s);
        printwriter.print("mUpdateThrottle=");
        TimeUtils.formatDuration(e, printwriter);
        printwriter.print(" mLastLoadCompleteTime=");
        TimeUtils.formatDuration(f, SystemClock.uptimeMillis(), printwriter);
        printwriter.println();
    }
}
 
Example 9
Source Project: cwac-mediarouter   Source File: MediaSessionStatus.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
    StringBuilder result = new StringBuilder();
    result.append("MediaSessionStatus{ ");
    result.append("timestamp=");
    TimeUtils.formatDuration(SystemClock.elapsedRealtime() - getTimestamp(), result);
    result.append(" ms ago");
    result.append(", sessionState=").append(sessionStateToString(getSessionState()));
    result.append(", queuePaused=").append(isQueuePaused());
    result.append(", extras=").append(getExtras());
    result.append(" }");
    return result.toString();
}
 
Example 10
Source Project: cwac-mediarouter   Source File: MediaItemStatus.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
    StringBuilder result = new StringBuilder();
    result.append("MediaItemStatus{ ");
    result.append("timestamp=");
    TimeUtils.formatDuration(SystemClock.elapsedRealtime() - getTimestamp(), result);
    result.append(" ms ago");
    result.append(", playbackState=").append(playbackStateToString(getPlaybackState()));
    result.append(", contentPosition=").append(getContentPosition());
    result.append(", contentDuration=").append(getContentDuration());
    result.append(", extras=").append(getExtras());
    result.append(" }");
    return result.toString();
}