diff options
author | 2023-08-30 00:52:59 +0000 | |
---|---|---|
committer | 2023-08-30 00:52:59 +0000 | |
commit | fafdf4e50c8374af92e8644f27c7eb4e904aaf7d (patch) | |
tree | d5fd5ab3c51b3cba9f12475c1bf5bddabb43e383 /cmds/bootanimation/BootAnimation.cpp | |
parent | 9084ca7f4136bc33931fc76ab4557e202b2e4cbf (diff) | |
parent | 35eaa6616059af0d771ba7cb89f7a7c1bb2c35a8 (diff) |
Merge "Use String8/16 c_str" into main am: 5af8505e4a am: 5accccc4c3 am: 83ab214b87 am: 093158d736 am: 35eaa66160
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2704207
Change-Id: Ic86288ea551b32c6a95ca134bdd0693d7dbce482
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.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp index 2cbd665ec25a..69c161ac8c0d 100644 --- a/cmds/bootanimation/BootAnimation.cpp +++ b/cmds/bootanimation/BootAnimation.cpp @@ -1171,7 +1171,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; @@ -1180,7 +1180,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; @@ -1365,7 +1365,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. @@ -1373,7 +1373,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) { @@ -1606,7 +1606,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 @@ -1831,17 +1831,17 @@ BootAnimation::Animation* BootAnimation::loadAnimation(const String8& fn) { ATRACE_CALL(); 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; |