Skip to content

Commit

Permalink
Merge pull request #79 from freeflyk/issue_78
Browse files Browse the repository at this point in the history
  • Loading branch information
0xf104a committed May 6, 2024
2 parents b214b6f + 0857f10 commit 8eb7dde
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public class OpenBrowserProcessor implements AbstractNotificationProcessor {
public final int priority = 1;
private static final String TAG = "Notification.Processors.OpenBrowserProcessor";

@SuppressLint("UnspecifiedImmutableFlag")
@Override
public NotificationBuilderResult updateNotification(int id, NotificationBuilderResult builderResult,
NotificationManager manager,
Expand All @@ -52,13 +51,12 @@ public NotificationBuilderResult updateNotification(int id, NotificationBuilderR

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
builderResult.builder = builderResult.builder.setContentIntent(PendingIntent.getActivity(context, 0,
browserIntent.intent, PendingIntent.FLAG_MUTABLE | PendingIntent.FLAG_UPDATE_CURRENT));
return builderResult;
browserIntent.intent, PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_UPDATE_CURRENT));
}else{
builderResult.builder = builderResult.builder.setContentIntent(PendingIntent.getActivity(context, 0,
browserIntent.intent, PendingIntent.FLAG_UPDATE_CURRENT));
return builderResult;
}
return builderResult;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ static private PendingIntent getReplyIntent(Context context,
String[] link = rawNotification.getString("link").split("/"); // use provided link to extract talk chatroom id
intent.putExtra("talk_chatroom", CommonUtil.cleanUpURLParams(link[link.length-1]));
intent.putExtra("talk_link", CommonUtil.cleanUpURLParams(rawNotification.getString("link")));
intent.setPackage(context.getPackageName()); // Issue 78 --> https://developer.android.com/about/versions/14/behavior-changes-14?hl=en#safer-intents

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
return PendingIntent.getBroadcast(
Expand Down

0 comments on commit 8eb7dde

Please sign in to comment.