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

Commit b3460cf3 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 10045008 from 0c763652 to udc-qpr1-release

Change-Id: I245f204881c459ce289427d4f7e582b1f5331307
parents f4187cf3 0c763652
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -771,6 +771,7 @@ public class ActivityManager {

    /**
     * The set of flags for process capability.
     * Keep it in sync with ProcessCapability in atoms.proto.
     * @hide
     */
    @IntDef(flag = true, prefix = { "PROCESS_CAPABILITY_" }, value = {
+9 −1
Original line number Diff line number Diff line
@@ -213,9 +213,17 @@ public final class WallpaperColors implements Parcelable {
                    .resizeBitmapArea(MAX_WALLPAPER_EXTRACTION_AREA)
                    .generate();
        } else {
            // in any case, always use between 5 and 128 clusters
            int minClusters = 5;
            int maxClusters = 128;

            // if the bitmap is very small, use bitmapArea/16 clusters instead of 128
            int minPixelsPerCluster = 16;
            int numberOfColors = Math.max(minClusters,
                    Math.min(maxClusters, bitmapArea / minPixelsPerCluster));
            palette = Palette
                    .from(bitmap, new CelebiQuantizer())
                    .maximumColorCount(128)
                    .maximumColorCount(numberOfColors)
                    .resizeBitmapArea(MAX_WALLPAPER_EXTRACTION_AREA)
                    .generate();
        }
+34 −0
Original line number Diff line number Diff line
@@ -2072,6 +2072,25 @@ public class PackageInstaller {
        return new InstallInfo(result);
    }

    /**
     * Parse a single APK file passed as an FD to get install relevant information about
     * the package wrapped in {@link InstallInfo}.
     * @throws PackageParsingException if the package source file(s) provided is(are) not valid,
     * or the parser isn't able to parse the supplied source(s).
     * @hide
     */
    @NonNull
    public InstallInfo readInstallInfo(@NonNull ParcelFileDescriptor pfd,
            @Nullable String debugPathName, int flags) throws PackageParsingException {
        final ParseTypeImpl input = ParseTypeImpl.forDefaultParsing();
        final ParseResult<PackageLite> result = ApkLiteParseUtils.parseMonolithicPackageLite(input,
                pfd.getFileDescriptor(), debugPathName, flags);
        if (result.isError()) {
            throw new PackageParsingException(result.getErrorCode(), result.getErrorMessage());
        }
        return new InstallInfo(result);
    }

    // (b/239722738) This class serves as a bridge between the PackageLite class, which
    // is a hidden class, and the consumers of this class. (e.g. InstallInstalling.java)
    // This is a part of an effort to remove dependency on hidden APIs and use SystemAPIs or
@@ -2125,6 +2144,21 @@ public class PackageInstaller {
        public long calculateInstalledSize(@NonNull SessionParams params) throws IOException {
            return InstallLocationUtils.calculateInstalledSize(mPkg, params.abiOverride);
        }

        /**
         * @param params {@link SessionParams} of the installation
         * @param pfd of an APK opened for read
         * @return Total disk space occupied by an application after installation.
         * Includes the size of the raw APKs, possibly unpacked resources, raw dex metadata files,
         * and all relevant native code.
         * @throws IOException when size of native binaries cannot be calculated.
         * @hide
         */
        public long calculateInstalledSize(@NonNull SessionParams params,
                @NonNull ParcelFileDescriptor pfd) throws IOException {
            return InstallLocationUtils.calculateInstalledSize(mPkg, params.abiOverride,
                    pfd.getFileDescriptor());
        }
    }

    /**
+28 −1
Original line number Diff line number Diff line
@@ -109,7 +109,7 @@ public class ApkLiteParseUtils {
    }

    /**
     * Parse lightweight details about a single APK files.
     * Parse lightweight details about a single APK file.
     */
    public static ParseResult<PackageLite> parseMonolithicPackageLite(ParseInput input,
            File packageFile, int flags) {
@@ -134,6 +134,33 @@ public class ApkLiteParseUtils {
        }
    }

    /**
     * Parse lightweight details about a single APK file passed as an FD.
     */
    public static ParseResult<PackageLite> parseMonolithicPackageLite(ParseInput input,
            FileDescriptor packageFd, String debugPathName, int flags) {
        Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "parseApkLite");
        try {
            final ParseResult<ApkLite> result = parseApkLite(input, packageFd, debugPathName,
                    flags);
            if (result.isError()) {
                return input.error(result);
            }

            final ApkLite baseApk = result.getResult();
            final String packagePath = debugPathName;
            return input.success(
                    new PackageLite(packagePath, baseApk.getPath(), baseApk, null /* splitNames */,
                            null /* isFeatureSplits */, null /* usesSplitNames */,
                            null /* configForSplit */, null /* splitApkPaths */,
                            null /* splitRevisionCodes */, baseApk.getTargetSdkVersion(),
                            null /* requiredSplitTypes */, null, /* splitTypes */
                            baseApk.isAllowUpdateOwnership()));
        } finally {
            Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
        }
    }

    /**
     * Parse lightweight details about a directory of APKs.
     *
+1 −1
Original line number Diff line number Diff line
@@ -11325,7 +11325,7 @@ public final class ViewRootImpl implements ViewParent,
                        // to sync the same frame in the same BBQ. That shouldn't be possible, but
                        // if it did happen, invoke markSyncReady so the active SSG doesn't get
                        // stuck.
                        Log.e(mTag, "Unable to syncNextTransaction. Possibly something else is"
                        Log.w(mTag, "Unable to syncNextTransaction. Possibly something else is"
                                + " trying to sync?");
                        surfaceSyncGroup.markSyncReady();
                    }
Loading