Fix enable-exclusive atomic api

Disabling and enabling the same overlay in the atomic api is not
working as expected. Only enable the overlay once when using the
atomic api in the OMS shell command.

Bug: 180016597
Test: manual
Change-Id: I8ff922f4bcdd2beaa7e81fb343cf4c6f26e8a4fc
This commit is contained in:
Ryan Mitchell
2021-02-11 17:18:49 -08:00
parent 17e971d531
commit 9ee6c8db23

View File

@@ -335,6 +335,7 @@ final class OverlayManagerShellCommand extends ShellCommand {
final List<OverlayInfo> overlaysForTarget =
mInterface.getOverlayInfosForTarget(overlayInfo.targetPackageName, userId);
overlaysForTarget.remove(overlayInfo);
final OverlayManagerTransaction.Builder builder = new OverlayManagerTransaction.Builder();
for (final OverlayInfo disableOverlay : overlaysForTarget) {
if ((inCategory && !Objects.equals(disableOverlay.category,overlayInfo.category))