Merge "Update ClipDescription.getTimeStamp to use currentTimeMillis timebase." into oc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
2cef335b5b
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user