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

Commit be0f217f authored by Josh Guilfoyle's avatar Josh Guilfoyle
Browse files

Fix a dumb error allowing isThemeable=true for themes.

This issue caused problems attempting to access the resources from a
theme package by using Context#createPackageContext.  If the package
context was marked as themeable, the resulting AssetManager would
include both the requested theme APK as well as the global theme APK
which would conflict.

Change-Id: Ieece5fc4e5d4e7d50bbd16f9165afce4c09c4ea2
parent cfbf0164
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1124,7 +1124,6 @@ public class PackageParser {
            } else if (tagName.equals("theme")) {
                // this is a theme apk.
                pkg.mIsThemeApk = true;
                pkg.applicationInfo.isThemeable = false;
                pkg.mThemeInfos.add(new ThemeInfo(parser, res, attrs));
            } else if (RIGID_PARSER) {
                outError[0] = "Bad element under <manifest>: "
@@ -1198,6 +1197,9 @@ public class PackageParser {
                        >= android.os.Build.VERSION_CODES.DONUT)) {
            pkg.applicationInfo.flags |= ApplicationInfo.FLAG_SUPPORTS_SCREEN_DENSITIES;
        }
        if (pkg.mIsThemeApk) {
            pkg.applicationInfo.isThemeable = false;
        }

        return pkg;
    }