[Change]
开始USB摄像头的功能集成,还无法获取usb连接广播需要调试
Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
(cherry picked from commit b10306fc45)
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
package com.serenegiant.utils;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.SystemClock;
|
||||
|
||||
public class Time {
|
||||
|
||||
public static boolean prohibitElapsedRealtimeNanos = true;
|
||||
|
||||
private static Time sTime;
|
||||
static {
|
||||
reset();
|
||||
}
|
||||
|
||||
public static long nanoTime() {
|
||||
return sTime.timeNs();
|
||||
}
|
||||
|
||||
public static void reset() {
|
||||
if (!prohibitElapsedRealtimeNanos && BuildCheck.isJellyBeanMr1()) {
|
||||
sTime = new TimeJellyBeanMr1();
|
||||
} else {
|
||||
sTime = new Time();
|
||||
}
|
||||
}
|
||||
|
||||
private Time() {
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
private static class TimeJellyBeanMr1 extends Time {
|
||||
public long timeNs() {
|
||||
return SystemClock.elapsedRealtimeNanos();
|
||||
}
|
||||
}
|
||||
|
||||
protected long timeNs() {
|
||||
return System.nanoTime();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user