android: Add disconnect button to notification

This commit is contained in:
Tobias Brunner
2017-07-03 10:39:23 +02:00
parent aea901bbbe
commit d0ed8ee89e
4 changed files with 5 additions and 0 deletions
@@ -365,6 +365,11 @@ public class CharonVpnService extends VpnService implements Runnable, VpnStateSe
builder.setContentTitle(getString(s));
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.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