diff --git a/res/values/strings.xml b/res/values/strings.xml
index 8ee4e8464f2..6f2cd04750b 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -13307,6 +13307,11 @@
Suspend execution for cached apps
+
+ Never expires.
+
+ Lease never expires.
+
Allow screen overlays on Settings
diff --git a/src/com/android/settings/development/storage/BlobInfoListView.java b/src/com/android/settings/development/storage/BlobInfoListView.java
index 54579645f16..d3c70336756 100644
--- a/src/com/android/settings/development/storage/BlobInfoListView.java
+++ b/src/com/android/settings/development/storage/BlobInfoListView.java
@@ -156,10 +156,16 @@ public class BlobInfoListView extends ListActivity {
final BlobInfo blob = getItem(position);
holder.blobLabel.setText(blob.getLabel());
holder.blobId.setText(getString(R.string.blob_id_text, blob.getId()));
- holder.blobExpiry.setText(getString(R.string.blob_expires_text,
- SharedDataUtils.formatTime(blob.getExpiryTimeMs())));
+ holder.blobExpiry.setText(formatExpiryTime(blob.getExpiryTimeMs()));
holder.blobSize.setText(SharedDataUtils.formatSize(blob.getSizeBytes()));
return convertView;
}
+
+ private String formatExpiryTime(long expiryTimeMs) {
+ if (expiryTimeMs == 0) {
+ return getString(R.string.blob_never_expires_text);
+ }
+ return getString(R.string.blob_expires_text, SharedDataUtils.formatTime(expiryTimeMs));
+ }
}
}
diff --git a/src/com/android/settings/development/storage/LeaseInfoListView.java b/src/com/android/settings/development/storage/LeaseInfoListView.java
index 22002fb49f4..597e155908b 100644
--- a/src/com/android/settings/development/storage/LeaseInfoListView.java
+++ b/src/com/android/settings/development/storage/LeaseInfoListView.java
@@ -171,8 +171,7 @@ public class LeaseInfoListView extends ListActivity {
holder.appIcon.setImageDrawable(appIcon);
holder.leasePackageName.setText(lease.getPackageName());
holder.leaseDescription.setText(getDescriptionString(lease));
- holder.leaseExpiry.setText(getString(R.string.accessor_expires_text,
- SharedDataUtils.formatTime(lease.getExpiryTimeMillis())));
+ holder.leaseExpiry.setText(formatExpiryTime(lease.getExpiryTimeMillis()));
return convertView;
}
@@ -191,5 +190,13 @@ public class LeaseInfoListView extends ListActivity {
}
return description;
}
+
+ private String formatExpiryTime(long expiryTimeMillis) {
+ if (expiryTimeMillis == 0) {
+ return getString(R.string.accessor_never_expires_text);
+ }
+ return getString(R.string.accessor_expires_text,
+ SharedDataUtils.formatTime(expiryTimeMillis));
+ }
}
}