Skip to content

Commit

Permalink
update target to sdk 31 and update notification IMMUTABLE flag
Browse files Browse the repository at this point in the history
  • Loading branch information
n8fr8 committed Jan 3, 2022
1 parent 6c16564 commit 7db9759
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ android {

minSdkVersion 16
applicationId 'org.torproject.android'
targetSdkVersion 30
targetSdkVersion 31
versionCode 1652200400

versionName getVersionName()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ private void createNotificationChannel() {
protected void showToolbarNotification(String notifyMsg, int notifyType, int icon) {
PackageManager pm = getPackageManager();
Intent intent = pm.getLaunchIntentForPackage(getPackageName());
PendingIntent pendIntent = PendingIntent.getActivity(OrbotService.this, 0, intent, 0);
PendingIntent pendIntent = PendingIntent.getActivity(OrbotService.this, 0, intent, PendingIntent.FLAG_IMMUTABLE);

if (mNotifyBuilder == null) {
mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
Expand All @@ -216,7 +216,7 @@ protected void showToolbarNotification(String notifyMsg, int notifyType, int ico
mNotifyBuilder.mActions.clear(); // clear out NEWNYM action
if (conn != null) { // only add new identity action when there is a connection
Intent intentRefresh = new Intent(TorControlCommands.SIGNAL_NEWNYM);
PendingIntent pendingIntentNewNym = PendingIntent.getBroadcast(this, 0, intentRefresh, PendingIntent.FLAG_UPDATE_CURRENT);
PendingIntent pendingIntentNewNym = PendingIntent.getBroadcast(this, 0, intentRefresh, PendingIntent.FLAG_UPDATE_CURRENT|PendingIntent.FLAG_IMMUTABLE);
mNotifyBuilder.addAction(R.drawable.ic_refresh_white_24dp, getString(R.string.menu_new_identity), pendingIntentNewNym);
}

Expand Down

0 comments on commit 7db9759

Please sign in to comment.