Work around AM ContentObserver timing issue
For the CtsAngleDeveloperOptionHostTest tests we are seeing a flaky failure in CTS and MTS testing. We tracked it down to a timing issue with how/when the Activity Manager's cached settings values are updated. Basically, we will set the settings to activate a particular code path in GraphicsEnvironment and then run a test to check that behavior. Sometimes, the test would fail. Logging showed that the test set the values but the GraphicsEnvironment code path did not see the changes because the Activity Manager's ContentObserver hadn't had time to process the settings change. We can't read from the settings provider directly because that has a huge performance impact and this is code run during application startup. Solution here is to add a command to ActivityManager to update it's settings cache. The test application then does: Set setting. Send AM refresh-settings-cache command. At this time we know the cache is up-to-date and the test can run. Test: atest android.angle.cts.CtsAngleDeveloperOptionHostTest Bug: 148545737 Bug: 148546966 Change-Id: I7a12ce098315bb98eaafad122c770bfbfe67b988
Loading
Please register or sign in to comment