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

Commit 06e6bcd1 authored by Song Chun Fan's avatar Song Chun Fan Committed by Android (Google) Code Review
Browse files

Merge "Fix a subtle timing issue in AppsFilter"

parents f7fc4ab4 ffc409d0
Loading
Loading
Loading
Loading
+8 −7
Original line number Original line Diff line number Diff line
@@ -834,12 +834,6 @@ public final class AppsFilterImpl extends AppsFilterLocked implements Watchable,
            }
            }


            updateEntireShouldFilterCacheInner(snapshot, settings, usersRef[0], USER_ALL);
            updateEntireShouldFilterCacheInner(snapshot, settings, usersRef[0], USER_ALL);
            synchronized (mImplicitlyQueryableLock) {
                if (mNeedToUpdateCacheForImplicitAccess) {
                    updateShouldFilterCacheForImplicitAccess();
                    mNeedToUpdateCacheForImplicitAccess = false;
                }
            }
            logCacheRebuilt(reason, SystemClock.currentTimeMicro() - currentTimeUs,
            logCacheRebuilt(reason, SystemClock.currentTimeMicro() - currentTimeUs,
                    users.length, settings.size());
                    users.length, settings.size());


@@ -850,7 +844,14 @@ public final class AppsFilterImpl extends AppsFilterLocked implements Watchable,
                return;
                return;
            }
            }


            synchronized (mImplicitlyQueryableLock) {
                if (mNeedToUpdateCacheForImplicitAccess) {
                    updateShouldFilterCacheForImplicitAccess();
                    mNeedToUpdateCacheForImplicitAccess = false;
                }
                mCacheReady = true;
                mCacheReady = true;
            }

            onChanged();
            onChanged();
        }, delayMs);
        }, delayMs);
    }
    }