summaryrefslogtreecommitdiff
path: root/core/tests/overlaytests
diff options
context:
space:
mode:
authorMÃ¥rten Kongstad <marten.kongstad@sony.com>2019-03-27 09:47:28 +0100
committerTodd Kennedy <toddke@google.com>2019-04-09 15:12:20 -0700
commit44bdc880c27fc16e55666989345b641d6dd959cf (patch)
treec33452a406c6325344357eea79549db6e9cf874b /core/tests/overlaytests
parentaacec3d11137411b6485f8c2b0a52c47498d73c1 (diff)
OMS: always update overlays.xml when overlay is removed
The OverlayChangeListener in the overlay manger service is responsible for both writing /data/system/overlays.xml and starting the flow to notify affected processes. Because of this, the listener needs to know when an overlay is removed regardless of wheather the overlay is enabled or not, or overlays.xml will contain stale information. Unconditionally notify the OverlayChangeListener when an overlay is removed. Test: atest OverlayHostTests Bug: 129368140 Change-Id: I1f5aeb285154a5d90ff81161825a95d9325a479e
Diffstat (limited to 'core/tests/overlaytests')
-rw-r--r--core/tests/overlaytests/host/src/com/android/server/om/hosttest/InstallOverlayTests.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/core/tests/overlaytests/host/src/com/android/server/om/hosttest/InstallOverlayTests.java b/core/tests/overlaytests/host/src/com/android/server/om/hosttest/InstallOverlayTests.java
index 99b6421d2bc7..267cb365748e 100644
--- a/core/tests/overlaytests/host/src/com/android/server/om/hosttest/InstallOverlayTests.java
+++ b/core/tests/overlaytests/host/src/com/android/server/om/hosttest/InstallOverlayTests.java
@@ -163,6 +163,20 @@ public class InstallOverlayTests extends BaseHostJUnit4Test {
assertTrue(overlayManagerContainsPackage(APP_OVERLAY_PACKAGE_NAME));
}
+ @Test
+ public void changesPersistedWhenUninstallingDisabledOverlay() throws Exception {
+ getDevice().enableAdbRoot();
+ assertFalse(getDevice().executeShellCommand("cat /data/system/overlays.xml")
+ .contains(APP_OVERLAY_PACKAGE_NAME));
+ installPackage("OverlayHostTests_AppOverlayV1.apk");
+ assertTrue(getDevice().executeShellCommand("cat /data/system/overlays.xml")
+ .contains(APP_OVERLAY_PACKAGE_NAME));
+ uninstallPackage(APP_OVERLAY_PACKAGE_NAME);
+ delay();
+ assertFalse(getDevice().executeShellCommand("cat /data/system/overlays.xml")
+ .contains(APP_OVERLAY_PACKAGE_NAME));
+ }
+
private void delay() {
try {
Thread.sleep(1000);