mirror of
https://github.com/strongswan/strongswan.git
synced 2025-10-05 00:00:45 -04:00
android: Add disconnect button to notification
This commit is contained in:
parent
aea901bbbe
commit
d0ed8ee89e
@ -365,6 +365,11 @@ public class CharonVpnService extends VpnService implements Runnable, VpnStateSe
|
|||||||
builder.setContentTitle(getString(s));
|
builder.setContentTitle(getString(s));
|
||||||
if (!publicVersion)
|
if (!publicVersion)
|
||||||
{
|
{
|
||||||
|
Intent intent = new Intent(getApplicationContext(), CharonVpnService.class);
|
||||||
|
intent.setAction(CharonVpnService.DISCONNECT_ACTION);
|
||||||
|
PendingIntent pending = PendingIntent.getService(getApplicationContext(), 0, intent,
|
||||||
|
PendingIntent.FLAG_ONE_SHOT);
|
||||||
|
builder.addAction(R.drawable.ic_notification_disconnect, getString(R.string.disconnect), pending);
|
||||||
builder.setContentText(name);
|
builder.setContentText(name);
|
||||||
builder.setPublicVersion(buildNotification(true));
|
builder.setPublicVersion(buildNotification(true));
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
After Width: | Height: | Size: 584 B |
Binary file not shown.
After Width: | Height: | Size: 390 B |
Binary file not shown.
After Width: | Height: | Size: 794 B |
Loading…
x
Reference in New Issue
Block a user