summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Kaiser <gkaiser@google.com>2020-08-12 07:03:50 -0700
committerGreg Kaiser <gkaiser@google.com>2020-08-12 07:03:50 -0700
commit6aa7e65e4921a1bf8af55efcb1265387cb1550a9 (patch)
treecbadf5b98e7bf1b035de6c7f12e6ad3aac0a9bf4
parent18ac499b9acd22d1cc45306f229d417f6a6ddde8 (diff)
charger: Avoid a couple string constructions
With a couple recent changes to APIs taking a const std::string&, instead of a const char *, we switch to directly passing in a reference to our string. Test: TreeHugger Change-Id: Id9f832dd5e3def28cfeaa0d3cda7da323332b16c
-rw-r--r--healthd/healthd_mode_charger.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/healthd/healthd_mode_charger.cpp b/healthd/healthd_mode_charger.cpp
index 04a99a30e4..e95efc04c2 100644
--- a/healthd/healthd_mode_charger.cpp
+++ b/healthd/healthd_mode_charger.cpp
@@ -693,7 +693,7 @@ void Charger::Init(struct healthd_config* config) {
InitAnimation();
- ret = CreateDisplaySurface(batt_anim_.fail_file.c_str(), &surf_unknown_);
+ ret = CreateDisplaySurface(batt_anim_.fail_file, &surf_unknown_);
if (ret < 0) {
LOGE("Cannot load custom battery_fail image. Reverting to built in: %d\n", ret);
ret = CreateDisplaySurface((system_animation_root + "charger/battery_fail.png"s).c_str(),
@@ -708,7 +708,7 @@ void Charger::Init(struct healthd_config* config) {
int scale_count;
int scale_fps; // Not in use (charger/battery_scale doesn't have FPS text
// chunk). We are using hard-coded frame.disp_time instead.
- ret = CreateMultiDisplaySurface(batt_anim_.animation_file.c_str(), &scale_count, &scale_fps,
+ ret = CreateMultiDisplaySurface(batt_anim_.animation_file, &scale_count, &scale_fps,
&scale_frames);
if (ret < 0) {
LOGE("Cannot load battery_scale image\n");