summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Luo <royluo@google.com>2023-12-05 17:13:33 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2023-12-05 17:13:33 +0000
commitda596ccc273f371da8880e1c84b1faa7c3772f06 (patch)
tree390ce662f1becb6f8ca1e95fcbc1041fc8c8cf8a
parent65499a880a04b5611121eff52eeeba8030f4f050 (diff)
parenta83201a117bbb67201d4cc4a4ba67622588a9f8c (diff)
downloadpixel-da596ccc273f371da8880e1c84b1faa7c3772f06.tar.gz
Merge "Revert "Use boot_clock for BuildVendorUsbDataSessionEvent"" into main
-rw-r--r--usb/CommonUtils.cpp6
-rw-r--r--usb/include/pixelusb/CommonUtils.h9
2 files changed, 7 insertions, 8 deletions
diff --git a/usb/CommonUtils.cpp b/usb/CommonUtils.cpp
index 6e0f08c9..91688b98 100644
--- a/usb/CommonUtils.cpp
+++ b/usb/CommonUtils.cpp
@@ -200,10 +200,10 @@ static VendorUsbDataSessionEvent_UsbDeviceState stringToUsbDeviceStateProto(
}
}
-void BuildVendorUsbDataSessionEvent(bool is_host, boot_clock::time_point currentTime,
- boot_clock::time_point startTime,
+void BuildVendorUsbDataSessionEvent(bool is_host, steady_clock::time_point currentTime,
+ steady_clock::time_point startTime,
std::vector<std::string> *states,
- std::vector<boot_clock::time_point> *timestamps,
+ std::vector<steady_clock::time_point> *timestamps,
VendorUsbDataSessionEvent *event) {
if (is_host) {
event->set_usb_role(VendorUsbDataSessionEvent_UsbDataRole_USB_ROLE_HOST);
diff --git a/usb/include/pixelusb/CommonUtils.h b/usb/include/pixelusb/CommonUtils.h
index dbd59c63..93855be3 100644
--- a/usb/include/pixelusb/CommonUtils.h
+++ b/usb/include/pixelusb/CommonUtils.h
@@ -17,7 +17,6 @@
#ifndef HARDWARE_GOOGLE_PIXEL_USB_UTILSCOMMON_H_
#define HARDWARE_GOOGLE_PIXEL_USB_UTILSCOMMON_H_
-#include <android-base/chrono_utils.h>
#include <android-base/unique_fd.h>
#include <hardware/google/pixel/pixelstats/pixelatoms.pb.h>
@@ -59,8 +58,8 @@ constexpr char kUvcEnabled[] = "ro.usb.uvc.enabled";
#define FUNCTION_PATH CONFIG_PATH FUNCTION_NAME
#define RNDIS_PATH FUNCTIONS_PATH "gsi.rndis"
-using ::android::base::boot_clock;
using android::hardware::google::pixel::PixelAtoms::VendorUsbDataSessionEvent;
+using ::std::chrono::steady_clock;
// Adds the given fd to the epollfd(epfd).
int addEpollFd(const ::android::base::unique_fd &epfd, const ::android::base::unique_fd &fd);
@@ -74,10 +73,10 @@ int linkFunction(const char *function, int index);
bool setVidPidCommon(const char *vid, const char *pid);
// Pulls down USB gadget. Returns true on success, false on failure
bool resetGadgetCommon();
-void BuildVendorUsbDataSessionEvent(bool is_host, boot_clock::time_point currentTime,
- boot_clock::time_point startTime,
+void BuildVendorUsbDataSessionEvent(bool is_host, steady_clock::time_point currentTime,
+ steady_clock::time_point startTime,
std::vector<std::string> *states,
- std::vector<boot_clock::time_point> *timestamps,
+ std::vector<steady_clock::time_point> *timestamps,
VendorUsbDataSessionEvent *event);
} // namespace usb