Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3f47f90e authored by Songchun Fan's avatar Songchun Fan Committed by Automerger Merge Worker
Browse files

Merge "[pm] ignore partial progress update after off-incfs migration" into sc-dev am: 5ba5f139

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15405281

Change-Id: I1a62754cd190be0fb576e964c2a9afa3c3eb6b9e
parents a313bcd1 5ba5f139
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -118,12 +118,19 @@ public final class IncrementalStates {
     * @param progress Value between [0, 1].
     */
    public void setProgress(float progress) {
        final boolean oldLoadingState;
        final boolean newLoadingState;
        synchronized (mLock) {
            oldLoadingState = mLoadingState.isLoading();
            if (oldLoadingState) {
                // Due to asynchronous progress reporting, incomplete progress might be received
                // after the app is migrated off incremental. Ignore such progress updates.
                updateProgressLocked(progress);
            }
            newLoadingState = mLoadingState.isLoading();
        }
        if (!newLoadingState) {
        if (oldLoadingState && !newLoadingState) {
            // Only report the state change when loading state changes from true to false
            onLoadingStateChanged();
        }
    }