Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 84638af3 authored by Mårten Kongstad's avatar Mårten Kongstad Committed by Todd Kennedy
Browse files

OMS: never filter out isStatic="true" overlays

Now that the OMS knows about overlays with the isStatic="true"
attribute, stop filtering out those overlays that have both
isStatic="true" and targetPackage="android".

This makes the OMS API more consistent: IOverlayManager.getAllOverlays
and "adb exec-out cmd overlay list" now no longer hides anything from
the caller, as was already the case for "adb exec-out cmd overlay dump"
and IOverlayManager.getOverlayInfo.

Test: manual: prepare file system, check output of adb exec-out cmd overlay list
Change-Id: I5aec941f6fd1e653910e02ed459b61f30949f8f8
parent 8c12dcd1
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -179,19 +179,13 @@ final class OverlayManagerSettings {

    List<OverlayInfo> getOverlaysForTarget(@NonNull final String targetPackageName,
            final int userId) {
        // Static RROs targeting "android" are loaded from AssetManager, and so they should be
        // ignored in OverlayManagerService.
        return selectWhereTarget(targetPackageName, userId)
                .filter((i) -> !(i.isStatic() && "android".equals(i.getTargetPackageName())))
                .map(SettingsItem::getOverlayInfo)
                .collect(Collectors.toList());
    }

    ArrayMap<String, List<OverlayInfo>> getOverlaysForUser(final int userId) {
        // Static RROs targeting "android" are loaded from AssetManager, and so they should be
        // ignored in OverlayManagerService.
        return selectWhereUser(userId)
                .filter((i) -> !(i.isStatic() && "android".equals(i.getTargetPackageName())))
                .map(SettingsItem::getOverlayInfo)
                .collect(Collectors.groupingBy(info -> info.targetPackageName, ArrayMap::new,
                        Collectors.toList()));