Show 'download cancelled' message when dismissing downloading app

This commit is contained in:
Peter Serwylo 2017-09-27 23:56:38 +10:00
parent b5ae78cf4d
commit 784733cd76
2 changed files with 6 additions and 1 deletions

View File

@ -56,20 +56,24 @@ public class AppStatusListItemController extends AppListItemController {
@Override
protected DismissResult onDismissApp(@NonNull App app) {
AppUpdateStatus status = getCurrentStatus();
CharSequence message = null;
if (status != null) {
AppUpdateStatusManager manager = AppUpdateStatusManager.getInstance(activity);
manager.removeApk(status.getUniqueKey());
switch (status.status) {
case ReadyToInstall:
manager.markAsNoLongerPendingInstall(status);
// Do this silently, because it should be pretty obvious based on the context
// of a "Ready to install" app being dismissed.
break;
case Downloading:
cancelDownload();
message = activity.getString(R.string.app_list__dismiss_downloading_app);
break;
}
}
return new DismissResult(true);
return new DismissResult(message, true);
}
}

View File

@ -89,6 +89,7 @@ This often occurs with apps installed via Google Play or other sources, if they
<string name="app_list_download_ready">Downloaded, ready to install</string>
<string name="app_list__dismiss_app_update">Update ignored</string>
<string name="app_list__dismiss_vulnerable_app">Vulnerability ignored</string>
<string name="app_list__dismiss_downloading_app">Download canceled</string>
<string name="installed_apps__activity_title">Installed Apps</string>
<string name="installed_app__updates_ignored">Updates ignored</string>