Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing pending intent immutable flag in JobProxy14.java #605

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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