mirror of
https://github.com/Docile-Alligator/Infinity-For-Reddit.git
synced 2025-10-29 19:44:40 +00:00
Fix an error that prevents the error message from showing in DownloadMediaService. More detailed error messages when the download location cannot be accessed.
This commit is contained in:
parent
c9537826da
commit
1b7342cde9
@ -666,6 +666,7 @@ public class DownloadMediaService extends JobService {
|
|||||||
}
|
}
|
||||||
if (contentStringResId != 0) {
|
if (contentStringResId != 0) {
|
||||||
builder.setContentText(getString(contentStringResId));
|
builder.setContentText(getString(contentStringResId));
|
||||||
|
builder.setStyle(new NotificationCompat.BigTextStyle().bigText(getString(contentStringResId)));
|
||||||
}
|
}
|
||||||
if (mediaUri != null) {
|
if (mediaUri != null) {
|
||||||
int pendingIntentFlags = Build.VERSION.SDK_INT >= Build.VERSION_CODES.M ? PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE : PendingIntent.FLAG_CANCEL_CURRENT;
|
int pendingIntentFlags = Build.VERSION.SDK_INT >= Build.VERSION_CODES.M ? PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE : PendingIntent.FLAG_CANCEL_CURRENT;
|
||||||
@ -834,7 +835,7 @@ public class DownloadMediaService extends JobService {
|
|||||||
int randomNotificationIdOffset, String mimeType, Uri destinationFileUri,
|
int randomNotificationIdOffset, String mimeType, Uri destinationFileUri,
|
||||||
int errorCode, boolean multipleDownloads) {
|
int errorCode, boolean multipleDownloads) {
|
||||||
if (errorCode != NO_ERROR) {
|
if (errorCode != NO_ERROR) {
|
||||||
if (multipleDownloads) {
|
if (!multipleDownloads) {
|
||||||
switch (errorCode) {
|
switch (errorCode) {
|
||||||
case ERROR_CANNOT_GET_DESTINATION_DIRECTORY:
|
case ERROR_CANNOT_GET_DESTINATION_DIRECTORY:
|
||||||
updateNotification(builder, mediaType, R.string.downloading_image_or_gif_failed_cannot_get_destination_directory,
|
updateNotification(builder, mediaType, R.string.downloading_image_or_gif_failed_cannot_get_destination_directory,
|
||||||
|
|||||||
@ -638,6 +638,7 @@ public class DownloadRedditVideoService extends JobService {
|
|||||||
}
|
}
|
||||||
if (contentStringResId != 0) {
|
if (contentStringResId != 0) {
|
||||||
builder.setContentText(getString(contentStringResId));
|
builder.setContentText(getString(contentStringResId));
|
||||||
|
builder.setStyle(new NotificationCompat.BigTextStyle().bigText(getString(contentStringResId)));
|
||||||
}
|
}
|
||||||
if (mediaUri != null) {
|
if (mediaUri != null) {
|
||||||
int pendingIntentFlags = Build.VERSION.SDK_INT >= Build.VERSION_CODES.M ? PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE : PendingIntent.FLAG_CANCEL_CURRENT;
|
int pendingIntentFlags = Build.VERSION.SDK_INT >= Build.VERSION_CODES.M ? PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE : PendingIntent.FLAG_CANCEL_CURRENT;
|
||||||
|
|||||||
@ -1065,9 +1065,9 @@
|
|||||||
|
|
||||||
<string name="downloading">Downloading</string>
|
<string name="downloading">Downloading</string>
|
||||||
<string name="downloading_media_finished">Downloaded</string>
|
<string name="downloading_media_finished">Downloaded</string>
|
||||||
<string name="downloading_image_or_gif_failed_cannot_get_destination_directory">Download failed: cannot access destination directory</string>
|
<string name="downloading_image_or_gif_failed_cannot_get_destination_directory">Download failed: cannot access destination directory. Please reselect your preferred download location in Settings->Download Location.</string>
|
||||||
<string name="downloading_media_failed_cannot_download_media">Download failed</string>
|
<string name="downloading_media_failed_cannot_download_media">Download failed</string>
|
||||||
<string name="downloading_media_failed_cannot_save_to_destination_directory">Download failed: cannot save the file to destination directory</string>
|
<string name="downloading_media_failed_cannot_save_to_destination_directory">Download failed: cannot save the file to destination directory. Please reselect your preferred download location in Settings->Download Location.</string>
|
||||||
<string name="download_media_failed_cannot_fetch_redgifs_url">Download failed: cannot fetch Redgifs video url</string>
|
<string name="download_media_failed_cannot_fetch_redgifs_url">Download failed: cannot fetch Redgifs video url</string>
|
||||||
<string name="download_media_failed_cannot_fetch_streamable_url">Download failed: cannot fetch Streamable video url</string>
|
<string name="download_media_failed_cannot_fetch_streamable_url">Download failed: cannot fetch Streamable video url</string>
|
||||||
<string name="download_media_failed_invalid_argument">Invalid argument</string>
|
<string name="download_media_failed_invalid_argument">Invalid argument</string>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user