Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cbacb4ae authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Handle blobs and leases that never expire correctly."

parents a59a1926 eefce6a1
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -13307,6 +13307,11 @@
    <!-- Developer settings: app freezer title [CHAR LIMIT=50]-->
    <string name="cached_apps_freezer">Suspend execution for cached apps</string>
    <!-- Developer settings - Shared data: label to indicate that the shared data never expires [CHAR LIMIT=80] -->
    <string name="blob_never_expires_text">Never expires.</string>
    <!-- Developer settings - Shared data: label to indicate that the lease acquired by an app never expires [CHAR LIMIT=80] -->
    <string name="accessor_never_expires_text">Lease never expires.</string>
    <!-- Title for allowing screen overlays on Settings app. [CHAR LIMIT=50]-->
    <string name="overlay_settings_title">Allow screen overlays on Settings</string>
    <!-- Summary for allowing screen overlays on Settings app. [CHAR LIMIT=NONE]-->
+8 −2
Original line number Diff line number Diff line
@@ -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));
        }
    }
}
+9 −2
Original line number Diff line number Diff line
@@ -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));
        }
    }
}