Merge "Include blob sizes in blob_store service dump." into rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
c712786944
@@ -29,6 +29,8 @@ import static android.app.blob.XmlTags.TAG_COMMITTER;
|
|||||||
import static android.app.blob.XmlTags.TAG_LEASEE;
|
import static android.app.blob.XmlTags.TAG_LEASEE;
|
||||||
import static android.os.Process.INVALID_UID;
|
import static android.os.Process.INVALID_UID;
|
||||||
import static android.system.OsConstants.O_RDONLY;
|
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.TAG;
|
||||||
import static com.android.server.blob.BlobStoreConfig.XML_VERSION_ADD_COMMIT_TIME;
|
import static com.android.server.blob.BlobStoreConfig.XML_VERSION_ADD_COMMIT_TIME;
|
||||||
@@ -335,8 +337,10 @@ class BlobMetadata {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void forEachLeasee(Consumer<Leasee> consumer) {
|
void forEachLeasee(Consumer<Leasee> consumer) {
|
||||||
|
synchronized (mMetadataLock) {
|
||||||
mLeasees.forEach(consumer);
|
mLeasees.forEach(consumer);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
File getBlobFile() {
|
File getBlobFile() {
|
||||||
if (mBlobFile == null) {
|
if (mBlobFile == null) {
|
||||||
@@ -460,10 +464,12 @@ class BlobMetadata {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void dump(IndentingPrintWriter fout, DumpArgs dumpArgs) {
|
void dump(IndentingPrintWriter fout, DumpArgs dumpArgs) {
|
||||||
|
synchronized (mMetadataLock) {
|
||||||
fout.println("blobHandle:");
|
fout.println("blobHandle:");
|
||||||
fout.increaseIndent();
|
fout.increaseIndent();
|
||||||
mBlobHandle.dump(fout, dumpArgs.shouldDumpFull());
|
mBlobHandle.dump(fout, dumpArgs.shouldDumpFull());
|
||||||
fout.decreaseIndent();
|
fout.decreaseIndent();
|
||||||
|
fout.println("size: " + formatFileSize(mContext, getSize(), FLAG_IEC_UNITS));
|
||||||
|
|
||||||
fout.println("Committers:");
|
fout.println("Committers:");
|
||||||
fout.increaseIndent();
|
fout.increaseIndent();
|
||||||
@@ -509,6 +515,7 @@ class BlobMetadata {
|
|||||||
}
|
}
|
||||||
fout.decreaseIndent();
|
fout.decreaseIndent();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void writeToXml(XmlSerializer out) throws IOException {
|
void writeToXml(XmlSerializer out) throws IOException {
|
||||||
synchronized (mMetadataLock) {
|
synchronized (mMetadataLock) {
|
||||||
|
|||||||
@@ -1070,10 +1070,8 @@ public class BlobStoreManagerService extends SystemService {
|
|||||||
return shouldRemove;
|
return shouldRemove;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (LOGV) {
|
Slog.d(TAG, "Completed idle maintenance; deleted "
|
||||||
Slog.v(TAG, "Completed idle maintenance; deleted "
|
|
||||||
+ Arrays.toString(deletedBlobIds.toArray()));
|
+ Arrays.toString(deletedBlobIds.toArray()));
|
||||||
}
|
|
||||||
writeBlobSessionsAsync();
|
writeBlobSessionsAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ import static android.system.OsConstants.O_CREAT;
|
|||||||
import static android.system.OsConstants.O_RDONLY;
|
import static android.system.OsConstants.O_RDONLY;
|
||||||
import static android.system.OsConstants.O_RDWR;
|
import static android.system.OsConstants.O_RDWR;
|
||||||
import static android.system.OsConstants.SEEK_SET;
|
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.TAG;
|
||||||
import static com.android.server.blob.BlobStoreConfig.XML_VERSION_ADD_SESSION_CREATION_TIME;
|
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("ownerUid: " + mOwnerUid);
|
||||||
fout.println("ownerPkg: " + mOwnerPackageName);
|
fout.println("ownerPkg: " + mOwnerPackageName);
|
||||||
fout.println("creation time: " + BlobStoreUtils.formatTime(mCreationTimeMs));
|
fout.println("creation time: " + BlobStoreUtils.formatTime(mCreationTimeMs));
|
||||||
|
fout.println("size: " + formatFileSize(mContext, getSize(), FLAG_IEC_UNITS));
|
||||||
|
|
||||||
fout.println("blobHandle:");
|
fout.println("blobHandle:");
|
||||||
fout.increaseIndent();
|
fout.increaseIndent();
|
||||||
|
|||||||
Reference in New Issue
Block a user