Skip to content

Commit

Permalink
Add missing pending intent immutable flag in JobProxy14.java
Browse files Browse the repository at this point in the history
  • Loading branch information
RationalRank committed Apr 28, 2022
1 parent adec0ae commit a515c91
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 1.4.4 (2022-04-28)
* Fixes to 1.4.3 - Added missing `PendingIntent`s immutable flags

## 1.4.3 (2022-04-27)
* Make `PendingIntent`s immutable, what is required for Target SDK 31, see #600

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Download [the latest version](http://search.maven.org/#search|gav|1|g:"com.evern

```groovy
dependencies {
implementation 'com.evernote:android-job:1.4.3'
implementation 'com.evernote:android-job:1.4.4'
}
```

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ android.useAndroidX=true
android.enableJetifier=true

GROUP=com.evernote
VERSION_NAME=1.4.3
VERSION_NAME=1.4.4
VERSION_CODE=1

POM_DESCRIPTION=Android library to handle jobs in the background.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
package com.evernote.android.job.v14;

import static com.evernote.android.job.PendingIntentUtil.flagImmutable;

import android.annotation.SuppressLint;
import android.app.AlarmManager;
import android.app.PendingIntent;
Expand Down Expand Up @@ -173,12 +175,12 @@ public void cancel(int jobId) {

@Override
public boolean isPlatformJobScheduled(JobRequest request) {
PendingIntent pendingIntent = getPendingIntent(request, PendingIntent.FLAG_NO_CREATE);
PendingIntent pendingIntent = getPendingIntent(request, PendingIntent.FLAG_NO_CREATE | flagImmutable());
return pendingIntent != null;
}

protected int createPendingIntentFlags(boolean repeating) {
int flags = PendingIntent.FLAG_UPDATE_CURRENT;
int flags = PendingIntent.FLAG_UPDATE_CURRENT | flagImmutable();
if (!repeating) {
flags |= PendingIntent.FLAG_ONE_SHOT;
}
Expand Down

0 comments on commit a515c91

Please sign in to comment.