Loading apex/blobstore/service/java/com/android/server/blob/BlobMetadata.java +8 −2 Original line number Diff line number Diff line Loading @@ -116,7 +116,7 @@ class BlobMetadata { return mUserId; } void addCommitter(@NonNull Committer committer) { void addOrReplaceCommitter(@NonNull Committer committer) { synchronized (mMetadataLock) { // We need to override the committer data, so first remove any existing // committer before adding the new one. Loading @@ -139,6 +139,12 @@ class BlobMetadata { } } void removeCommitter(@NonNull Committer committer) { synchronized (mMetadataLock) { mCommitters.remove(committer); } } void removeInvalidCommitters(SparseArray<String> packages) { synchronized (mMetadataLock) { mCommitters.removeIf(committer -> Loading @@ -154,7 +160,7 @@ class BlobMetadata { } } void addLeasee(String callingPackage, int callingUid, int descriptionResId, void addOrReplaceLeasee(String callingPackage, int callingUid, int descriptionResId, CharSequence description, long leaseExpiryTimeMillis) { synchronized (mMetadataLock) { // We need to override the leasee data, so first remove any existing Loading apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java +7 −3 Original line number Diff line number Diff line Loading @@ -401,7 +401,7 @@ public class BlobStoreManagerService extends SystemService { throw new LimitExceededException("Total amount of data with an active lease" + " is exceeding the max limit"); } blobMetadata.addLeasee(callingPackage, callingUid, blobMetadata.addOrReplaceLeasee(callingPackage, callingUid, descriptionResId, description, leaseExpiryTimeMillis); if (LOGV) { Slog.v(TAG, "Acquired lease on " + blobHandle Loading Loading @@ -573,12 +573,16 @@ public class BlobStoreManagerService extends SystemService { final Committer newCommitter = new Committer(session.getOwnerPackageName(), session.getOwnerUid(), session.getBlobAccessMode()); final Committer existingCommitter = blob.getExistingCommitter(newCommitter); blob.addCommitter(newCommitter); blob.addOrReplaceCommitter(newCommitter); try { writeBlobsInfoLocked(); session.sendCommitCallbackResult(COMMIT_RESULT_SUCCESS); } catch (Exception e) { blob.addCommitter(existingCommitter); if (existingCommitter == null) { blob.removeCommitter(newCommitter); } else { blob.addOrReplaceCommitter(existingCommitter); } session.sendCommitCallbackResult(COMMIT_RESULT_ERROR); } getUserSessionsLocked(UserHandle.getUserId(session.getOwnerUid())) Loading Loading
apex/blobstore/service/java/com/android/server/blob/BlobMetadata.java +8 −2 Original line number Diff line number Diff line Loading @@ -116,7 +116,7 @@ class BlobMetadata { return mUserId; } void addCommitter(@NonNull Committer committer) { void addOrReplaceCommitter(@NonNull Committer committer) { synchronized (mMetadataLock) { // We need to override the committer data, so first remove any existing // committer before adding the new one. Loading @@ -139,6 +139,12 @@ class BlobMetadata { } } void removeCommitter(@NonNull Committer committer) { synchronized (mMetadataLock) { mCommitters.remove(committer); } } void removeInvalidCommitters(SparseArray<String> packages) { synchronized (mMetadataLock) { mCommitters.removeIf(committer -> Loading @@ -154,7 +160,7 @@ class BlobMetadata { } } void addLeasee(String callingPackage, int callingUid, int descriptionResId, void addOrReplaceLeasee(String callingPackage, int callingUid, int descriptionResId, CharSequence description, long leaseExpiryTimeMillis) { synchronized (mMetadataLock) { // We need to override the leasee data, so first remove any existing Loading
apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java +7 −3 Original line number Diff line number Diff line Loading @@ -401,7 +401,7 @@ public class BlobStoreManagerService extends SystemService { throw new LimitExceededException("Total amount of data with an active lease" + " is exceeding the max limit"); } blobMetadata.addLeasee(callingPackage, callingUid, blobMetadata.addOrReplaceLeasee(callingPackage, callingUid, descriptionResId, description, leaseExpiryTimeMillis); if (LOGV) { Slog.v(TAG, "Acquired lease on " + blobHandle Loading Loading @@ -573,12 +573,16 @@ public class BlobStoreManagerService extends SystemService { final Committer newCommitter = new Committer(session.getOwnerPackageName(), session.getOwnerUid(), session.getBlobAccessMode()); final Committer existingCommitter = blob.getExistingCommitter(newCommitter); blob.addCommitter(newCommitter); blob.addOrReplaceCommitter(newCommitter); try { writeBlobsInfoLocked(); session.sendCommitCallbackResult(COMMIT_RESULT_SUCCESS); } catch (Exception e) { blob.addCommitter(existingCommitter); if (existingCommitter == null) { blob.removeCommitter(newCommitter); } else { blob.addOrReplaceCommitter(existingCommitter); } session.sendCommitCallbackResult(COMMIT_RESULT_ERROR); } getUserSessionsLocked(UserHandle.getUserId(session.getOwnerUid())) Loading