summaryrefslogtreecommitdiff
path: root/cmds/bootanimation/BootAnimation.cpp
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2023-08-29 22:21:43 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2023-08-29 22:21:43 +0000
commit35eaa6616059af0d771ba7cb89f7a7c1bb2c35a8 (patch)
treebcada1d4a4ede2ff339389d1f6b84d32bd79975a /cmds/bootanimation/BootAnimation.cpp
parent747bb66db0faab2c6ac34015c27fdc8af8c77a7a (diff)
parent093158d736244dff64b13b4e57eb3ce186191db1 (diff)
Merge "Use String8/16 c_str" into main am: 5af8505e4a am: 5accccc4c3 am: 83ab214b87 am: 093158d736
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2704207 Change-Id: If3391f1880bb2d1f833d060b3737cf3c12f0dd85 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'cmds/bootanimation/BootAnimation.cpp')
-rw-r--r--cmds/bootanimation/BootAnimation.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp
index fd79a04814fd..2047f1867c31 100644
--- a/cmds/bootanimation/BootAnimation.cpp
+++ b/cmds/bootanimation/BootAnimation.cpp
@@ -1135,7 +1135,7 @@ bool BootAnimation::parseAnimationDesc(Animation& animation) {
if (!readFile(animation.zip, "desc.txt", desString)) {
return false;
}
- char const* s = desString.string();
+ char const* s = desString.c_str();
std::string dynamicColoringPartName = "";
bool postDynamicColoring = false;
@@ -1144,7 +1144,7 @@ bool BootAnimation::parseAnimationDesc(Animation& animation) {
const char* endl = strstr(s, "\n");
if (endl == nullptr) break;
String8 line(s, endl - s);
- const char* l = line.string();
+ const char* l = line.c_str();
int fps = 0;
int width = 0;
int height = 0;
@@ -1328,7 +1328,7 @@ bool BootAnimation::preloadZip(Animation& animation) {
// If there is trimData present, override the positioning defaults.
for (Animation::Part& part : animation.parts) {
- const char* trimDataStr = part.trimData.string();
+ const char* trimDataStr = part.trimData.c_str();
for (size_t frameIdx = 0; frameIdx < part.frames.size(); frameIdx++) {
const char* endl = strstr(trimDataStr, "\n");
// No more trimData for this part.
@@ -1336,7 +1336,7 @@ bool BootAnimation::preloadZip(Animation& animation) {
break;
}
String8 line(trimDataStr, endl - trimDataStr);
- const char* lineStr = line.string();
+ const char* lineStr = line.c_str();
trimDataStr = ++endl;
int width = 0, height = 0, x = 0, y = 0;
if (sscanf(lineStr, "%dx%d+%d+%d", &width, &height, &x, &y) == 4) {
@@ -1564,7 +1564,7 @@ bool BootAnimation::playAnimation(const Animation& animation) {
1.0f);
ALOGD("Playing files = %s/%s, Requested repeat = %d, playUntilComplete = %s",
- animation.fileName.string(), part.path.string(), part.count,
+ animation.fileName.c_str(), part.path.c_str(), part.count,
part.playUntilComplete ? "true" : "false");
// For the last animation, if we have progress indicator from
@@ -1785,17 +1785,17 @@ void BootAnimation::releaseAnimation(Animation* animation) const {
BootAnimation::Animation* BootAnimation::loadAnimation(const String8& fn) {
if (mLoadedFiles.indexOf(fn) >= 0) {
SLOGE("File \"%s\" is already loaded. Cyclic ref is not allowed",
- fn.string());
+ fn.c_str());
return nullptr;
}
ZipFileRO *zip = ZipFileRO::open(fn);
if (zip == nullptr) {
SLOGE("Failed to open animation zip \"%s\": %s",
- fn.string(), strerror(errno));
+ fn.c_str(), strerror(errno));
return nullptr;
}
- ALOGD("%s is loaded successfully", fn.string());
+ ALOGD("%s is loaded successfully", fn.c_str());
Animation *animation = new Animation;
animation->fileName = fn;