Skip to content

Commit

Permalink
1. upgrade gradle version
Browse files Browse the repository at this point in the history
2. fix flag_immutable tag crash issue
  • Loading branch information
Justson committed Sep 3, 2022
1 parent d365620 commit d192d1b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion COMPILE_SDK_VERSION.toInteger()
buildToolsVersion BUILD_TOOL_VERSION
compileSdk 32
buildToolsVersion '32.0.0'
defaultConfig {
applicationId "com.download.sample"
minSdkVersion 16
targetSdkVersion TARGET_SDK_VERSION.toInteger()
targetSdkVersion 32
versionCode 4
versionName "5.0.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
maven { url 'https://jitpack.io' }
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.2'
classpath "com.android.tools.build:gradle:7.0.4"
}
}

Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ org.gradle.jvmargs=-Xmx1536m
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
COMPILE_SDK_VERSION=28
BUILD_TOOL_VERSION=28.0.3
SUPPORT_LIB_VERSION=28.0.0
TARGET_SDK_VERSION=30
COMPILE_SDK_VERSION=32
BUILD_TOOL_VERSION=32.0.0
SUPPORT_LIB_VERSION=32.0.0
TARGET_SDK_VERSION=32
android.injected.testOnly=false
android.useAndroidX=true
6 changes: 3 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Feb 12 22:52:11 CST 2019
#Sat Sep 03 18:41:27 CST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
zipStoreBase=GRADLE_USER_HOME
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,11 @@ private String getTitle(DownloadTask downloadTask) {
private PendingIntent buildCancelContent(Context context, int id, String url) {
Intent intentCancel = new Intent(Runtime.getInstance().append(context, NotificationCancelReceiver.ACTION));
intentCancel.putExtra("TAG", url);
PendingIntent pendingIntentCancel = PendingIntent.getBroadcast(context, id * 1000, intentCancel, PendingIntent.FLAG_UPDATE_CURRENT);
int flags = PendingIntent.FLAG_UPDATE_CURRENT;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
flags |= PendingIntent.FLAG_IMMUTABLE;
}
PendingIntent pendingIntentCancel = PendingIntent.getBroadcast(context, id * 1000, intentCancel, flags);
Runtime.getInstance().log(TAG, "buildCancelContent id:" + (id * 1000) + " cancal action:" + Runtime.getInstance().append(context, NotificationCancelReceiver.ACTION));
return pendingIntentCancel;
}
Expand Down

0 comments on commit d192d1b

Please sign in to comment.