summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Sudheer Shanka <sudheersai@google.com> 2020-02-18 17:28:12 -0800
committer Sudheer Shanka <sudheersai@google.com> 2020-02-19 10:28:23 -0800
commit51a6c6ee50c7144abb5aab4930eb4ae3887b47d9 (patch)
tree970d39ebce70cb672ae93de99941402133149600
parent251c21df37937f301234e72ab295084e39c75901 (diff)
Allow lease expiry to be +ve when the corresponding blobs expiry is 0.
It is fine for an app to aquire a lease until a certain time even if the corresponding the blob doesn't have a expiry date associated with it. Fixes: 149789374 Test: atest --test-mapping apex/blobstore Change-Id: I76f7bdb616d78a5d83a8489a898f1e6015589f38
-rw-r--r--apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java b/apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java
index d4ceabda8acc..7b3764a999f7 100644
--- a/apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java
+++ b/apex/blobstore/service/java/com/android/server/blob/BlobStoreManagerService.java
@@ -334,7 +334,8 @@ public class BlobStoreManagerService extends SystemService {
throw new SecurityException("Caller not allowed to access " + blobHandle
+ "; callingUid=" + callingUid + ", callingPackage=" + callingPackage);
}
- if (leaseExpiryTimeMillis != 0 && leaseExpiryTimeMillis > blobHandle.expiryTimeMillis) {
+ if (leaseExpiryTimeMillis != 0 && blobHandle.expiryTimeMillis != 0
+ && leaseExpiryTimeMillis > blobHandle.expiryTimeMillis) {
throw new IllegalArgumentException(
"Lease expiry cannot be later than blobs expiry time");
}