Fix metrics test flakiness
This commit makes two changes: 1) The shell commands for accessing config went directly to the ServiceConfigAccessor, while metrics used a cached copy of config. This means they may disagree under some circumstances like automated tests. This change tunnels shell command queries to the strategy object, which generates the metrics, ensuring a higher chance of consistency. 2) Some types of configuration change (used during tests) were not causing the copy of ConfigurationInternal held by TimeZoneDetectorStrategyImpl to be updated. This corrects that. This should fix automated tests that were receiving constradictory information about whether geo detection was supported on a device from shell command Vs metrics reporting. It is likely this is the result of a previous test changing the supported status (probably by changing the config of location time zone providers) and the issues fixed by points 1 and 2 (mostly 2) above causing the contradiction. Bug: 228457046 Test: Treehugger Change-Id: I95e79575ec102662bcbfbbab7c99c07437e3a633
Loading
Please register or sign in to comment