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

Commit be77996a authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6535363 from 1ae0612a to mainline-release

Change-Id: I443706bc476a3f71010e58eb75983834efe936c6
parents d82d18f5 1ae0612a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@ stubs_defaults {
        ":opt-telephony-srcs",
        ":opt-net-voip-srcs",
        ":art-module-public-api-stubs-source",
        ":conscrypt.module.public.api.stubs.source",
        ":conscrypt.module.public.api{.public.stubs.source}",
        ":android_icu4j_public_api_files",
        "test-mock/src/**/*.java",
        "test-runner/src/**/*.java",
+1 −1
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ stubs_defaults {
    name: "metalava-full-api-stubs-default",
    defaults: ["metalava-base-api-stubs-default"],
    srcs: [
        ":conscrypt.module.public.api.stubs.source",
        ":conscrypt.module.public.api{.public.stubs.source}",
        ":framework-updatable-sources",
    ],
    sdk_version: "core_platform",
+4 −1
Original line number Diff line number Diff line
@@ -212,7 +212,10 @@ class BlobMetadata {
    }

    boolean isAccessAllowedForCaller(@NonNull String callingPackage, int callingUid) {
        // TODO: verify blob is still valid (expiryTime is not elapsed)
        // Don't allow the blob to be accessed after it's expiry time has passed.
        if (getBlobHandle().isExpired()) {
            return false;
        }
        synchronized (mMetadataLock) {
            // Check if packageName already holds a lease on the blob.
            for (int i = 0, size = mLeasees.size(); i < size; ++i) {
+12 −0
Original line number Diff line number Diff line
@@ -1059,6 +1059,18 @@ public class BlobStoreManagerService extends SystemService {
        }
    }

    boolean isBlobAvailable(long blobId, int userId) {
        synchronized (mBlobsLock) {
            final ArrayMap<BlobHandle, BlobMetadata> userBlobs = getUserBlobsLocked(userId);
            for (BlobMetadata blobMetadata : userBlobs.values()) {
                if (blobMetadata.getBlobId() == blobId) {
                    return true;
                }
            }
            return false;
        }
    }

    @GuardedBy("mBlobsLock")
    private void dumpSessionsLocked(IndentingPrintWriter fout, DumpArgs dumpArgs) {
        for (int i = 0, userCount = mSessions.size(); i < userCount; ++i) {
+18 −0
Original line number Diff line number Diff line
@@ -46,6 +46,8 @@ class BlobStoreManagerShellCommand extends ShellCommand {
                return runDeleteBlob(pw);
            case "idle-maintenance":
                return runIdleMaintenance(pw);
            case "query-blob-existence":
                return runQueryBlobExistence(pw);
            default:
                return handleDefaultCommands(cmd);
        }
@@ -91,6 +93,16 @@ class BlobStoreManagerShellCommand extends ShellCommand {
        return 0;
    }

    private int runQueryBlobExistence(PrintWriter pw) {
        final ParsedArgs args = new ParsedArgs();
        if (parseOptions(pw, args) < 0) {
            return -1;
        }

        pw.println(mService.isBlobAvailable(args.blobId, args.userId) ? 1 : 0);
        return 0;
    }

    @Override
    public void onHelp() {
        final PrintWriter pw = getOutPrintWriter();
@@ -121,6 +133,8 @@ class BlobStoreManagerShellCommand extends ShellCommand {
        pw.println("      --tag: Tag of the blob to delete.");
        pw.println("idle-maintenance");
        pw.println("    Run idle maintenance which takes care of removing stale data.");
        pw.println("query-blob-existence [-b BLOB_ID]");
        pw.println("    Prints 1 if blob exists, otherwise 0.");
        pw.println();
    }

@@ -147,6 +161,9 @@ class BlobStoreManagerShellCommand extends ShellCommand {
                case "--tag":
                    args.tag = getNextArgRequired();
                    break;
                case "-b":
                    args.blobId = Long.parseLong(getNextArgRequired());
                    break;
                default:
                    pw.println("Error: unknown option '" + opt + "'");
                    return -1;
@@ -166,6 +183,7 @@ class BlobStoreManagerShellCommand extends ShellCommand {
        public long expiryTimeMillis;
        public CharSequence label;
        public String tag;
        public long blobId;

        public BlobHandle getBlobHandle() {
            return BlobHandle.create(algorithm, digest, label, expiryTimeMillis, tag);
Loading