In #clearValuesAndCheck, values are placed in the value map based on a
key that depends on the current user. When these values are checked
in #call, it uses default user 0 (unless CALL_METHOD_USER_KEY is
populated).
Considering we don't even use getStringForUser when checking the values,
it seems to make sense to check against the userId used to set the
values in #clearValuesAndCheck.
Test: atest TestableSettingsProviderTest
Change-Id: I0ee9313b1394515d9405344482dc1779d15c0819
Change-Id: Ie20f91dbdd0ba6b57b5909cbf0152a32754fe02d
Fixes: 62263757
Test: runtest systemui-notification, cts AudioManagerTest,
cts-verifier DND tests, verify bug reports after toggling
access for various types of managed services, verified
default approved services aren't renabled on boot; verified that
they are reenabled after a device reset, verified that
settings are migrated after a restore from OC backup.
Instead of just having random tests fail, fail all the tests with a
slightly more useful message.
Also remove all the code around acquiring and contention, now that
we have a test rule in place for TestableContext, we can just use
that for cleanup and have a simple copy-on-write provider.
Test: runtest -x frameworks/base/tests/testables && runtest systemui
Change-Id: I907da23730a4a96cfa2bb112100a06980f01b078
Fixes: 37302051