summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ashutosh Joshi <ashutoshj@google.com> 2017-07-19 09:52:57 -0700
committer Ashutosh Joshi <ashutoshj@google.com> 2017-07-19 09:52:57 -0700
commit53e5aa93fa2855616b9691c5e1878f1db1464ace (patch)
treeaddab93340d4768f0159fddf4e41e218650fadf7
parentde1ad9de0c1de1507588d7a3b9c43b6ca764262e (diff)
Use appendFormat instead of append when passing arguments
Using append crashes the system. Bug: 63804323 Test: On a contrived build with no sensors, dumpsys does not crash the sensorservice. Change-Id: I4ee942d58af8347388f4f5f71c48da339c1cf7e7
-rw-r--r--services/sensorservice/SensorService.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/services/sensorservice/SensorService.cpp b/services/sensorservice/SensorService.cpp
index 209eea5202..62c2756d2f 100644
--- a/services/sensorservice/SensorService.cpp
+++ b/services/sensorservice/SensorService.cpp
@@ -394,7 +394,7 @@ status_t SensorService::dump(int fd, const Vector<String16>& args) {
}
} else if (!mSensors.hasAnySensor()) {
result.append("No Sensors on the device\n");
- result.append("devInitCheck : %d\n", SensorDevice::getInstance().initCheck());
+ result.appendFormat("devInitCheck : %d\n", SensorDevice::getInstance().initCheck());
} else {
// Default dump the sensor list and debugging information.
//