sync AppUpdateStatusManager docs and varnames to InstallManagerService

This commit is contained in:
Hans-Christoph Steiner 2018-03-20 13:46:01 +01:00
parent 7c1e2ee09c
commit dbfac03b52
2 changed files with 14 additions and 11 deletions

View File

@ -29,13 +29,16 @@ import java.util.Map;
/** /**
* Manages the state of APKs that are being installed or that have updates available. * Manages the state of APKs that are being installed or that have updates available.
* This also ensures the state is saved across F-Droid restarts, and repopulates
* based on {@link org.fdroid.fdroid.data.Schema.InstalledAppTable} data, APKs that
* are present in the cache, and the {@code apks-pending-install}
* {@link SharedPreferences} instance.
* <p> * <p>
* The full URL for the APK file to download is used as the unique ID to * As defined in {@link org.fdroid.fdroid.installer.InstallManagerService}, the
* represent the status of the APK throughout F-Droid. The full download URL is guaranteed * canonical URL for the APK file to download is used as the unique ID to represent
* to be unique since it points to files on a filesystem, where there cannot be multiple files with * the status of the APK throughout F-Droid.
* the same name. This provides a unique ID beyond just {@code packageName} *
* and {@code versionCode} since there could be different copies of the same * @see org.fdroid.fdroid.installer.InstallManagerService
* APK on different servers, signed by different keys, or even different builds.
*/ */
public final class AppUpdateStatusManager { public final class AppUpdateStatusManager {
@ -556,8 +559,8 @@ public final class AppUpdateStatusManager {
* *
* @see #isPendingInstall(String) * @see #isPendingInstall(String)
*/ */
public void markAsPendingInstall(String uniqueKey) { public void markAsPendingInstall(String urlString) {
AppUpdateStatus entry = get(uniqueKey); AppUpdateStatus entry = get(urlString);
if (entry != null) { if (entry != null) {
Utils.debugLog(TAG, "Marking " + entry.apk.packageName + " as pending install."); Utils.debugLog(TAG, "Marking " + entry.apk.packageName + " as pending install.");
apksPendingInstall.edit().putBoolean(entry.apk.hash, true).apply(); apksPendingInstall.edit().putBoolean(entry.apk.hash, true).apply();
@ -568,8 +571,8 @@ public final class AppUpdateStatusManager {
* @see #markAsNoLongerPendingInstall(AppUpdateStatus) * @see #markAsNoLongerPendingInstall(AppUpdateStatus)
* @see #isPendingInstall(String) * @see #isPendingInstall(String)
*/ */
public void markAsNoLongerPendingInstall(String uniqueKey) { public void markAsNoLongerPendingInstall(String urlString) {
AppUpdateStatus entry = get(uniqueKey); AppUpdateStatus entry = get(urlString);
if (entry != null) { if (entry != null) {
markAsNoLongerPendingInstall(entry); markAsNoLongerPendingInstall(entry);
} }

View File

@ -40,7 +40,7 @@ import java.io.IOException;
* and then redeliver the {@link Intent} for us, which includes all of the data needed * and then redeliver the {@link Intent} for us, which includes all of the data needed
* for {@code InstallManagerService} to do its job for the whole lifecycle of an install. * for {@code InstallManagerService} to do its job for the whole lifecycle of an install.
* <p> * <p>
* The full URL for the APK file to download is also used as the unique ID to * The canonical URL for the APK file to download is also used as the unique ID to
* represent the download itself throughout F-Droid. This follows the model * represent the download itself throughout F-Droid. This follows the model
* of {@link Intent#setData(Uri)}, where the core data of an {@code Intent} is * of {@link Intent#setData(Uri)}, where the core data of an {@code Intent} is
* a {@code Uri}. The full download URL is guaranteed to be unique since it * a {@code Uri}. The full download URL is guaranteed to be unique since it