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

Commit c0aa8809 authored by Andreas Gampe's avatar Andreas Gampe Committed by android-build-merger
Browse files

Merge "Frameworks: Fix idle-background-job flag" am: 3a16db62 am: 83419c75

am: 64f4a15a

Change-Id: I657a946fd67a44697a51df4b43a60de0cc69c8be
parents 0228c8f9 64f4a15a
Loading
Loading
Loading
Loading
+7 −7
Original line number Original line Diff line number Diff line
@@ -209,7 +209,7 @@ public class PackageDexOptimizer {


            // Get the dexopt flags after getRealCompilerFilter to make sure we get the correct
            // Get the dexopt flags after getRealCompilerFilter to make sure we get the correct
            // flags.
            // flags.
            final int dexoptFlags = getDexFlags(pkg, compilerFilter, options.isBootComplete());
            final int dexoptFlags = getDexFlags(pkg, compilerFilter, options);


            for (String dexCodeIsa : dexCodeInstructionSets) {
            for (String dexCodeIsa : dexCodeInstructionSets) {
                int newResult = dexOptPath(pkg, path, dexCodeIsa, compilerFilter,
                int newResult = dexOptPath(pkg, path, dexCodeIsa, compilerFilter,
@@ -349,8 +349,7 @@ public class PackageDexOptimizer {
                dexUseInfo.isUsedByOtherApps());
                dexUseInfo.isUsedByOtherApps());
        // Get the dexopt flags after getRealCompilerFilter to make sure we get the correct flags.
        // Get the dexopt flags after getRealCompilerFilter to make sure we get the correct flags.
        // Secondary dex files are currently not compiled at boot.
        // Secondary dex files are currently not compiled at boot.
        int dexoptFlags = getDexFlags(info, compilerFilter, /* bootComplete */ true)
        int dexoptFlags = getDexFlags(info, compilerFilter, options) | DEXOPT_SECONDARY_DEX;
                | DEXOPT_SECONDARY_DEX;
        // Check the app storage and add the appropriate flags.
        // Check the app storage and add the appropriate flags.
        if (info.deviceProtectedDataDir != null &&
        if (info.deviceProtectedDataDir != null &&
                FileUtils.contains(info.deviceProtectedDataDir, path)) {
                FileUtils.contains(info.deviceProtectedDataDir, path)) {
@@ -486,11 +485,11 @@ public class PackageDexOptimizer {
     * filter.
     * filter.
     */
     */
    private int getDexFlags(PackageParser.Package pkg, String compilerFilter,
    private int getDexFlags(PackageParser.Package pkg, String compilerFilter,
            boolean bootComplete) {
            DexoptOptions options) {
        return getDexFlags(pkg.applicationInfo, compilerFilter, bootComplete);
        return getDexFlags(pkg.applicationInfo, compilerFilter, options);
    }
    }


    private int getDexFlags(ApplicationInfo info, String compilerFilter, boolean bootComplete) {
    private int getDexFlags(ApplicationInfo info, String compilerFilter, DexoptOptions options) {
        int flags = info.flags;
        int flags = info.flags;
        boolean debuggable = (flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0;
        boolean debuggable = (flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0;
        // Profile guide compiled oat files should not be public.
        // Profile guide compiled oat files should not be public.
@@ -501,7 +500,8 @@ public class PackageDexOptimizer {
                (isPublic ? DEXOPT_PUBLIC : 0)
                (isPublic ? DEXOPT_PUBLIC : 0)
                | (debuggable ? DEXOPT_DEBUGGABLE : 0)
                | (debuggable ? DEXOPT_DEBUGGABLE : 0)
                | profileFlag
                | profileFlag
                | (bootComplete ? DEXOPT_BOOTCOMPLETE : 0);
                | (options.isBootComplete() ? DEXOPT_BOOTCOMPLETE : 0)
                | (options.isDexoptIdleBackgroundJob() ? DEXOPT_IDLE_BACKGROUND_JOB : 0);
        return adjustDexoptFlags(dexFlags);
        return adjustDexoptFlags(dexFlags);
    }
    }