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

Commit cb7b63d9 authored by Mårten Kongstad's avatar Mårten Kongstad Committed by Zoran Jovanovic
Browse files

RRO: prevent duplicate system overlays

System overlays, ie overlays with targetPackage="android", were loaded
twice, which caused all sorts of issues. Ensure they are only loaded
once, which will be during Zygote initialization.

Bug: 17765434
Change-Id: Ia5064045c77f713c58fb78adc3942f6af1abdc93
parent 96198eba
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -236,9 +236,11 @@ public:
private:
    struct asset_path
    {
        asset_path() : path(""), type(kFileTypeRegular), idmap(""), isSystemOverlay(false) {}
        String8 path;
        FileType type;
        String8 idmap;
        bool isSystemOverlay;
    };

    Asset* openInPathLocked(const char* fileName, AccessMode mode,
+6 −0
Original line number Diff line number Diff line
@@ -605,6 +605,11 @@ FileType AssetManager::getFileType(const char* fileName)
}

bool AssetManager::appendPathToResTable(const asset_path& ap) const {
    // skip those ap's that correspond to system overlays
    if (ap.isSystemOverlay) {
        return true;
    }

    Asset* ass = NULL;
    ResTable* sharedRes = NULL;
    bool shared = true;
@@ -790,6 +795,7 @@ void AssetManager::addSystemOverlays(const char* pathOverlaysList,
        oap.path = String8(buf, space - buf);
        oap.type = kFileTypeRegular;
        oap.idmap = String8(space + 1, newline - space - 1);
        oap.isSystemOverlay = true;

        Asset* oass = const_cast<AssetManager*>(this)->
            openNonAssetInPathLocked("resources.arsc",