Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c8201910 authored by Sudheer Shanka's avatar Sudheer Shanka
Browse files

Update ClipDescription.getTimeStamp to use currentTimeMillis timebase.

Bug: 37419581
Test: cts-tradefed run singleCommand cts-dev -m CtsContentTestCases -t \
      android.content.cts.ClipDescriptionTest

Change-Id: I699bfc073c471534eee0b3aa0300a6b6682ab8dd
parent fca728da
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ package android.content;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.PersistableBundle;
import android.os.SystemClock;
import android.text.TextUtils;
import android.util.TimeUtils;

@@ -150,7 +149,7 @@ public class ClipDescription implements Parcelable {
     * global clipboard.
     *
     * @param timeStamp at which the associated {@link ClipData} is copeid to clipboard in
     *                  {@link SystemClock#elapsedRealtime()} time base.
     *                  {@link System#currentTimeMillis()} time base.
     * @hide
     */
    public void setTimestamp(long timeStamp) {
@@ -159,7 +158,7 @@ public class ClipDescription implements Parcelable {

    /**
     * Return the timestamp at which the associated {@link ClipData} is copied to global clipboard
     * in the {@link SystemClock#elapsedRealtime()} time base.
     * in the {@link System#currentTimeMillis()} time base.
     *
     * @return timestamp at which the associated {@link ClipData} is copied to global clipboard
     *         or {@code 0} if it is not copied to clipboard.
@@ -317,7 +316,9 @@ public class ClipDescription implements Parcelable {
                b.append(' ');
            }
            first = false;
            TimeUtils.formatDuration(mTimeStamp, b);
            b.append('<');
            b.append(TimeUtils.logTimeOfDay(mTimeStamp));
            b.append('>');
        }
        return !first;
    }
+1 −2
Original line number Diff line number Diff line
@@ -41,7 +41,6 @@ import android.os.RemoteCallbackList;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.SystemProperties;
import android.os.SystemClock;
import android.os.UserHandle;
import android.os.UserManager;
import android.util.Slog;
@@ -407,7 +406,7 @@ public class ClipboardService extends SystemService {
        if (clip != null) {
            final ClipDescription description = clip.getDescription();
            if (description != null) {
                description.setTimestamp(SystemClock.elapsedRealtime());
                description.setTimestamp(System.currentTimeMillis());
            }
        }
        final long ident = Binder.clearCallingIdentity();