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

Commit 1d254f2e authored by Lee Shombert's avatar Lee Shombert
Browse files

Correct debugging of accountsForUser binder cache

Bug: 140788621

Replaced the default result comparison so that two results can be compared
for value equality.  This code is only exercised with VERIFY is set true
in PropertyInvalidatedCache (this is a compile-time flag).

Test: Created a special build that sets VERIFY to true; verified that the
binder cache does not detect any inconsistent results.  Further modified
the build to generate inconsistencies; verified that the new code does,
in fact, detect true inconsistencies.

Change-Id: I48080cd3109b96159f711bd2d84a69530450c2c8
parent 9e47bc44
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -388,6 +388,16 @@ public class AccountManager {
                throw e.rethrowFromSystemServer();
            }
        }
        @Override
        protected boolean debugCompareQueryResults(Account[] l, Account[] r) {
            if (l == r) {
                return true;
            } else if (l == null || r == null) {
                return false;
            } else {
                return Arrays.equals(l, r);
            }
        }
    };

    /**