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

Commit a7a7c5ac authored by d34d's avatar d34d Committed by Clark Scheff
Browse files

Stop checking for resources.arsc in shouldCreateIdmap

The check for resources.arsc in the target apk was a fix for when
we supported legacy themes (t-mobile engine).  Since support for
legacy themes was dropped in cm-12.0, this patch just adds extra
overhead and results in ANRs in some cases.

Change-Id: I275d9ccd3e67eead91f3e8c39a2b64f31f473ed3
parent d008d55f
Loading
Loading
Loading
Loading
+0 −16
Original line number Diff line number Diff line
@@ -8284,32 +8284,16 @@ public class PackageManagerService extends IPackageManager.Stub {
    }
    /**
     * Checks for existance of resources.arsc in target apk, then
     * Compares the 32 bit hash of the target and overlay to those stored
     * in the idmap and returns true if either hash differs
     * @param targetPkg
     * @param overlayPkg
     * @return
     * @throws IOException
     */
    private boolean shouldCreateIdmap(PackageParser.Package targetPkg,
                                      PackageParser.Package overlayPkg) {
        if (targetPkg == null || targetPkg.baseCodePath == null || overlayPkg == null) return false;
        // Check if the target app has resources.arsc.
        // If it does not, then there is nothing to idmap
        ZipFile zfile = null;
        try {
            zfile = new ZipFile(targetPkg.baseCodePath);
            if (zfile.getEntry("resources.arsc") == null) return false;
        } catch (IOException e) {
            Log.e(TAG, "Error while checking resources.arsc on" + targetPkg.baseCodePath, e);
            return false;
        } finally {
            IoUtils.closeQuietly(zfile);
        }
        int targetHash = getPackageHashCode(targetPkg);
        int overlayHash = getPackageHashCode(overlayPkg);