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

Commit e4895f43 authored by Songchun Fan's avatar Songchun Fan
Browse files

[incremental] increase progress comparison precision

This ensures that the package is not regarded as fully loaded even if
only 1 page is missing in a 4GB app.

BUG: 182205656
Test: atest android.cts.statsdatom.statsd.IncrementalAtomTests
Change-Id: Id6f41a77c690c01cf0d210e6b09708572a36e088
parent 867e305d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -293,11 +293,11 @@ public final class IncrementalStates {
            Slog.i(TAG, "received progress update: " + progress);
        }
        mLoadingState.setProgress(progress);
        if (1 - progress < 0.001) {
        if (Math.abs(1.0f - progress) < 0.00000001f) {
            if (DEBUG) {
                Slog.i(TAG, "package is fully loaded");
            }
            mLoadingState.setProgress(1);
            mLoadingState.setProgress(1.0f);
            if (mLoadingState.isLoading()) {
                mLoadingState.adoptNewLoadingStateLocked(false);
            }