OSDN Git Service

sensorservice: add power usage to dumpsys
authorKhalid Zubair <kzubair@cyngn.com>
Tue, 19 Apr 2016 17:46:48 +0000 (10:46 -0700)
committerGerrit Code Review <gerrit@cyanogenmod.org>
Wed, 20 Apr 2016 22:47:32 +0000 (15:47 -0700)
Include each sensor's power usage info in the per-sensor dumpsys
info section.

Change-Id: If10535d1e7fe6a35d9385ce2e6083a4c5188a06d

services/sensorservice/SensorService.cpp

index 28af943..8ab145a 100644 (file)
@@ -359,6 +359,8 @@ status_t SensorService::dump(int fd, const Vector<String16>& args)
                     result.appendFormat("non-wakeUp | ");
                 }
 
+                result.appendFormat("%.4f mA | ", s.getPowerUsage());
+
                 int bufIndex = mLastEventSeen.indexOfKey(s.getHandle());
                 if (bufIndex >= 0) {
                     const CircularBuffer* buf = mLastEventSeen.valueAt(bufIndex);