Loading cmds/bootanimation/BootAnimation.cpp +11 −4 Original line number Diff line number Diff line Loading @@ -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) { Loading @@ -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); Loading @@ -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(); Loading Loading @@ -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 } } Loading cmds/bootanimation/BootAnimation.h +2 −1 Original line number Diff line number Diff line Loading @@ -187,7 +187,8 @@ private: void resizeSurface(int newWidth, int newHeight); void projectSceneToWindow(); bool shouldStopPlayingPart(const Animation::Part& part, int fadedFramesCount); bool shouldStopPlayingPart(const Animation::Part& part, int fadedFramesCount, int lastDisplayedProgress); void checkExit(); void handleViewport(nsecs_t timestep); Loading Loading
cmds/bootanimation/BootAnimation.cpp +11 −4 Original line number Diff line number Diff line Loading @@ -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) { Loading @@ -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); Loading @@ -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(); Loading Loading @@ -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 } } Loading
cmds/bootanimation/BootAnimation.h +2 −1 Original line number Diff line number Diff line Loading @@ -187,7 +187,8 @@ private: void resizeSurface(int newWidth, int newHeight); void projectSceneToWindow(); bool shouldStopPlayingPart(const Animation::Part& part, int fadedFramesCount); bool shouldStopPlayingPart(const Animation::Part& part, int fadedFramesCount, int lastDisplayedProgress); void checkExit(); void handleViewport(nsecs_t timestep); Loading