Skip to content

Commit

Permalink
1. upgrade version to 5.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Justson committed May 9, 2022
1 parent d452489 commit 235db73
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/src/main/java/com/download/sample/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ public void onClick(View v) {
/**
* URI 数据协议下载
*/
DownloadImpl.getInstance(MainActivity.this).url("data:application/vnd.ms-excel;base64,PGh0bWwgeG1sbnM6bz0idXJuOnNjaGVtYXMtbWljcm9zb2Z0LWNvbTpvZmZpY2U6b2ZmaWNlIiAKICB4bWxuczp4PSJ1cm46c2NoZW1hcy1taWNyb3NvZnQtY29tOm9mZmljZTpleGNlbCIgCiAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnL1RSL1JFQy1odG1sNDAiPgogIDxoZWFkPjxtZXRhIGNoYXJzZXQ9IlVURi04Ij48IS0tW2lmIGd0ZSBtc28gOV0+PHhtbD48eDpFeGNlbFdvcmtib29rPjx4OkV4Y2VsV29ya3NoZWV0cz48eDpFeGNlbFdvcmtzaGVldD4KICAgIDx4Ok5hbWU+MjAyMeW5tDEy5pyIMTXml6XlupPlrZjpooTorablr7zlh7rmlbDmja48L3g6TmFtZT4KICAgIDx4OldvcmtzaGVldE9wdGlvbnM+PHg6RGlzcGxheUdyaWRsaW5lcy8+PC94OldvcmtzaGVldE9wdGlvbnM+PC94OkV4Y2VsV29ya3NoZWV0PgogICAgPC94OkV4Y2VsV29ya3NoZWV0cz48L3g6RXhjZWxXb3JrYm9vaz48L3htbD48IVtlbmRpZl0tLT4KICAgIDwvaGVhZD48Ym9keT48dGFibGU+PHRyPjx0ZD7lkI3np7AJPC90ZD48dGQ+5bqT5a2YCTwvdGQ+PHRkPuWNleS9jQk8L3RkPjx0ZD7liIbnsbsJPC90ZD48dGQ+5bqT5a2Y5LiK6ZmQCTwvdGQ+PHRkPuW6k+WtmOS4i+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lPSJtc28tbnVtYmVyLWZvcm1hdDonQCc7Ij43MC4wMAk8L3RkPjx0ZCBzdHlsZT0ibXNvLW51bWJlci1mb3JtYXQ6J0AnOyI+5YyFCTwvdGQ+PHRkIHN0eWxlPSJtc28tbnVtYmVyLWZvcm1hdDonQCc7Ij7mlaPnp7Dpo5/lk4EJPC90ZD48dGQgc3R5bGU9Im1zby1udW1iZXItZm9ybWF0OidAJzsiPjUwLjAwMAk8L3RkPjx0ZCBzdHlsZT0ibXNvLW51bWJlci1mb3JtYXQ6J0AnOyI+MC4wMDAJPC90ZD48dGQgc3R5bGU9Im1zby1udW1iZXItZm9ybWF0OidAJzsiPuiHquiQpQk8L3RkPjx0ZCBzdHlsZT0ibXNvLW51bWJlci1mb3JtYXQ6J0AnOyI+5bqT5a2Y6L+H5YmpCTwvdGQ+PHRkIHN0eWxlPSJtc28tbnVtYmVyLWZvcm1hdDonQCc7Ij4yMC4wMDAJPC90ZD48L3RyPjwvdGFibGU+PC9ib2R5PjwvaHRtbD4=")
.autoOpenIgnoreMD5()
.setEnableIndicator(true)
.enqueue(new DownloadListenerAdapter(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public final class DownloadImpl {
private static volatile DownloadImpl sInstance;
private final ConcurrentHashMap<String, DownloadTask> mTasks = new ConcurrentHashMap<>();
private volatile static Context mContext;
public static final String TAG = Runtime.PREFIX + DownloadImpl.class.getSimpleName();
private static final String TAG = Runtime.PREFIX + DownloadImpl.class.getSimpleName();

private DownloadImpl(@NonNull Context context) {
Context current = mContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ private static DispatchThread getNotificationUpdateQueue() {
void initBuilder(DownloadTask downloadTask) {
String title = getTitle(downloadTask);
this.mDownloadTask = downloadTask;
mBuilder.setContentIntent(PendingIntent.getActivity(mContext, 200, new Intent(), PendingIntent.FLAG_UPDATE_CURRENT));
int flags = PendingIntent.FLAG_UPDATE_CURRENT;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
flags |= PendingIntent.FLAG_IMMUTABLE;
}
mBuilder.setContentIntent(PendingIntent.getActivity(mContext, 200, new Intent(), flags));
mBuilder.setSmallIcon(mDownloadTask.getDownloadIcon());
mBuilder.setTicker(mContext.getString(R.string.download_trickter));
mBuilder.setContentTitle(title);
Expand Down

0 comments on commit 235db73

Please sign in to comment.