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

Commit 26b3368a authored by Sudheer Shanka's avatar Sudheer Shanka Committed by Automerger Merge Worker
Browse files

Merge "Include blob sizes in blob_store service dump." into rvc-dev am: c7127869 am: a863d528

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11826292

Change-Id: Id4fb8f061235205a2965c7cb109ac4765820186f
parents 4f4878c3 a863d528
Loading
Loading
Loading
Loading
+51 −44
Original line number Diff line number Diff line
@@ -29,6 +29,8 @@ import static android.app.blob.XmlTags.TAG_COMMITTER;
import static android.app.blob.XmlTags.TAG_LEASEE;
import static android.os.Process.INVALID_UID;
import static android.system.OsConstants.O_RDONLY;
import static android.text.format.Formatter.FLAG_IEC_UNITS;
import static android.text.format.Formatter.formatFileSize;

import static com.android.server.blob.BlobStoreConfig.TAG;
import static com.android.server.blob.BlobStoreConfig.XML_VERSION_ADD_COMMIT_TIME;
@@ -335,8 +337,10 @@ class BlobMetadata {
    }

    void forEachLeasee(Consumer<Leasee> consumer) {
        synchronized (mMetadataLock) {
            mLeasees.forEach(consumer);
        }
    }

    File getBlobFile() {
        if (mBlobFile == null) {
@@ -460,10 +464,12 @@ class BlobMetadata {
    }

    void dump(IndentingPrintWriter fout, DumpArgs dumpArgs) {
        synchronized (mMetadataLock) {
            fout.println("blobHandle:");
            fout.increaseIndent();
            mBlobHandle.dump(fout, dumpArgs.shouldDumpFull());
            fout.decreaseIndent();
            fout.println("size: " + formatFileSize(mContext, getSize(), FLAG_IEC_UNITS));

            fout.println("Committers:");
            fout.increaseIndent();
@@ -509,6 +515,7 @@ class BlobMetadata {
            }
            fout.decreaseIndent();
        }
    }

    void writeToXml(XmlSerializer out) throws IOException {
        synchronized (mMetadataLock) {
+2 −4
Original line number Diff line number Diff line
@@ -1070,10 +1070,8 @@ public class BlobStoreManagerService extends SystemService {
                return shouldRemove;
            });
        }
        if (LOGV) {
            Slog.v(TAG, "Completed idle maintenance; deleted "
        Slog.d(TAG, "Completed idle maintenance; deleted "
                + Arrays.toString(deletedBlobIds.toArray()));
        }
        writeBlobSessionsAsync();
    }

+3 −0
Original line number Diff line number Diff line
@@ -27,6 +27,8 @@ import static android.system.OsConstants.O_CREAT;
import static android.system.OsConstants.O_RDONLY;
import static android.system.OsConstants.O_RDWR;
import static android.system.OsConstants.SEEK_SET;
import static android.text.format.Formatter.FLAG_IEC_UNITS;
import static android.text.format.Formatter.formatFileSize;

import static com.android.server.blob.BlobStoreConfig.TAG;
import static com.android.server.blob.BlobStoreConfig.XML_VERSION_ADD_SESSION_CREATION_TIME;
@@ -533,6 +535,7 @@ class BlobStoreSession extends IBlobStoreSession.Stub {
            fout.println("ownerUid: " + mOwnerUid);
            fout.println("ownerPkg: " + mOwnerPackageName);
            fout.println("creation time: " + BlobStoreUtils.formatTime(mCreationTimeMs));
            fout.println("size: " + formatFileSize(mContext, getSize(), FLAG_IEC_UNITS));

            fout.println("blobHandle:");
            fout.increaseIndent();