When an overlay package has been upgraded, OMS needs to reconcile any previous settings about the overlay with the new state of affairs. Sometimes it is possible to rebase the OMS settings on the new information [e.g. the overlay has changed categories]; sometimes the OMS settings have to be scrapped [e.g. the overlay has changed target package]. Update OMS to do The Right Thing. Bug: 78809704 Test: manual (adb shell stop, adb push specially prepared overlays, adb shell start, adb exec-out cmd overlay dump) Test: ran unit tests Test: adb install out/target/product/walleye/data/app/SettingsUnitTests/SettingsUnitTests.apk Test: adb shell am instrument -w -e class com.android.settings.display.ThemePreferenceControllerTest com.android.settings.tests.unit/android.support.test.runner.AndroidJUnitRunner Test: NOTE: 3 of 4 failures both pre and post change; looks like there are issue with the unit tests themselves Change-Id: Icd1ae633dbee5b5ca957fa6b652af6209b4b1260
To build the tests you can use the following command at the root of your android source tree $ make SettingsUnitTests The test apk then needs to be installed onto your test device via for example $ adb install -r out/target/product/shamu/data/app/SettingsUnitTests/SettingsUnitTests.apk To run all tests: $ adb shell am instrument -w com.android.settings.tests.unit/android.support.test.runner.AndroidJUnitRunner To run all tests in a specific class: $ adb shell am instrument -w -e class com.android.settings.<class> com.android.settings.tests.unit/android.support.test.runner.AndroidJUnitRunner To run a specific test: $ adb shell am instrument -w -e class com.android.settings.<class>#<test> com.android.settings.tests.unit/android.support.test.runner.AndroidJUnitRunner More general information can be found at http://developer.android.com/reference/android/support/test/runner/AndroidJUnitRunner.html