summaryrefslogtreecommitdiff
path: root/cmds/bootanimation/BootAnimation.cpp
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2021-04-21 09:28:44 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2021-04-21 09:28:44 +0000
commit55b2ba298c378e350f32e7351ff6a3fb4a960105 (patch)
tree11c8370e86702ff6bb28d849208801edb5af1df6 /cmds/bootanimation/BootAnimation.cpp
parent52a8119c664e051f48c5f390090b5b7d768a7081 (diff)
parent10e844df412736a6c72eadd68dbe596aa6e6dd64 (diff)
Merge "bootanimation: ensure that if a percent is shown, we'll get to 100." am: 87c254de0e am: 10e844df41
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1681127 Change-Id: I6c86286bdb5eb45231ea1106d0e439970b3ec7bc
Diffstat (limited to 'cmds/bootanimation/BootAnimation.cpp')
-rw-r--r--cmds/bootanimation/BootAnimation.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp
index 854982f825dc..57f0e0c93b05 100644
--- a/cmds/bootanimation/BootAnimation.cpp
+++ b/cmds/bootanimation/BootAnimation.cpp
@@ -1185,9 +1185,12 @@ bool BootAnimation::movie() {
return false;
}
-bool BootAnimation::shouldStopPlayingPart(const Animation::Part& part, const int fadedFramesCount) {
+bool BootAnimation::shouldStopPlayingPart(const Animation::Part& part,
+ const int fadedFramesCount,
+ const int lastDisplayedProgress) {
// stop playing only if it is time to exit and it's a partial part which has been faded out
- return exitPending() && !part.playUntilComplete && fadedFramesCount >= part.framesToFadeCount;
+ return exitPending() && !part.playUntilComplete && fadedFramesCount >= part.framesToFadeCount &&
+ (lastDisplayedProgress == 0 || lastDisplayedProgress == 100);
}
bool BootAnimation::playAnimation(const Animation& animation) {
@@ -1214,7 +1217,7 @@ bool BootAnimation::playAnimation(const Animation& animation) {
// process the part not only while the count allows but also if already fading
for (int r=0 ; !part.count || r<part.count || fadedFramesCount > 0 ; r++) {
- if (shouldStopPlayingPart(part, fadedFramesCount)) break;
+ if (shouldStopPlayingPart(part, fadedFramesCount, lastDisplayedProgress)) break;
mCallbacks->playPart(i, part, r);
@@ -1231,7 +1234,7 @@ bool BootAnimation::playAnimation(const Animation& animation) {
(i == (pcount -1)) && currentProgress != 0;
for (size_t j=0 ; j<fcount ; j++) {
- if (shouldStopPlayingPart(part, fadedFramesCount)) break;
+ if (shouldStopPlayingPart(part, fadedFramesCount, lastDisplayedProgress)) break;
processDisplayEvents();
@@ -1330,6 +1333,10 @@ bool BootAnimation::playAnimation(const Animation& animation) {
if (exitPending() && !part.count && mCurrentInset >= mTargetInset &&
!part.hasFadingPhase()) {
+ if (lastDisplayedProgress != 0 && lastDisplayedProgress != 100) {
+ android::base::SetProperty(PROGRESS_PROP_NAME, "100");
+ continue;
+ }
break; // exit the infinite non-fading part when it has been played at least once
}
}