diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp
index 854982f..57f0e0c 100644
--- a/cmds/bootanimation/BootAnimation.cpp
+++ b/cmds/bootanimation/BootAnimation.cpp
@@ -1185,9 +1185,12 @@
     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 @@
 
         // 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 @@
                 (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 @@
 
             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
             }
         }
diff --git a/cmds/bootanimation/BootAnimation.h b/cmds/bootanimation/BootAnimation.h
index b52222c..1b47fef 100644
--- a/cmds/bootanimation/BootAnimation.h
+++ b/cmds/bootanimation/BootAnimation.h
@@ -187,7 +187,8 @@
     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);
