Merge "Handle blobs and leases that never expire correctly."
This commit is contained in:
committed by
Android (Google) Code Review
commit
cbacb4aec0
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user