intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setAction(VpnProfileControlActivity.START_PROFILE);
intent.putExtra(VpnProfileControlActivity.EXTRA_VPN_PROFILE_ID, profile.getUUID().toString());
+ int flags = PendingIntent.FLAG_UPDATE_CURRENT;
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
+ {
+ flags |= PendingIntent.FLAG_IMMUTABLE;
+ }
PendingIntent pending = PendingIntent.getActivity(getApplicationContext(), 0, intent,
- PendingIntent.FLAG_UPDATE_CURRENT);
+ flags);
builder.addAction(R.drawable.ic_notification_connecting, getString(R.string.retry), pending);
add_action = true;
}
}
}
builder.setContentTitle(getString(s));
+
+ int flags = PendingIntent.FLAG_UPDATE_CURRENT;
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
+ {
+ flags |= PendingIntent.FLAG_IMMUTABLE;
+ }
if (!publicVersion)
{
if (add_action)
Intent intent = new Intent(getApplicationContext(), VpnProfileControlActivity.class);
intent.setAction(VpnProfileControlActivity.DISCONNECT);
PendingIntent pending = PendingIntent.getActivity(getApplicationContext(), 0, intent,
- PendingIntent.FLAG_UPDATE_CURRENT);
+ flags);
builder.addAction(R.drawable.ic_notification_disconnect, getString(R.string.disconnect), pending);
}
if (error == ErrorState.NO_ERROR)
Intent intent = new Intent(getApplicationContext(), MainActivity.class);
PendingIntent pending = PendingIntent.getActivity(getApplicationContext(), 0, intent,
- PendingIntent.FLAG_UPDATE_CURRENT);
+ flags);
builder.setContentIntent(pending);
return builder.build();
}
* we just use our main Activity */
Context context = getApplicationContext();
Intent intent = new Intent(context, MainActivity.class);
- PendingIntent pending = PendingIntent.getActivity(context, 0, intent,
- PendingIntent.FLAG_UPDATE_CURRENT);
+ int flags = PendingIntent.FLAG_UPDATE_CURRENT;
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
+ {
+ flags |= PendingIntent.FLAG_IMMUTABLE;
+ }
+ PendingIntent pending = PendingIntent.getActivity(context, 0, intent, flags);
builder.setConfigureIntent(pending);
/* mark all VPN connections as unmetered (default changed for Android 10) */