Add timestamps of when tag monitoring dumps are cached
This CL adds a timestamp of when a client's tag monitoring dump is
cached. The timestamp is printed along with the rest of the dump through
`watch dump`.
Bug: 209565054
Test: Manually tested
Change-Id: I4dba62495bdee48ad8ec252cf9c17e974f3f5d86
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index 569ab63..8147701 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -4284,12 +4284,20 @@
if (dumpVector.empty()) { return; }
+ std::string dumpString;
+
+ String8 currentTime = getFormattedCurrentTime();
+ dumpString += "Cached @ ";
+ dumpString += currentTime.string();
+ dumpString += "\n"; // First line is the timestamp of when client is cached.
+
+
const String16 &packageName = client->getPackageName();
String8 packageName8 = String8(packageName);
const char *printablePackageName = packageName8.lockBuffer(packageName.size());
- std::string dumpString;
+
size_t i = dumpVector.size();
// Store the string in reverse order (latest last)