Clear notification when service destroyed
This commit is contained in:
parent
a22c0454e4
commit
bb976ba50f
@ -128,9 +128,6 @@ public class DaedalusVpnService extends VpnService implements Runnable {
|
||||
case ACTION_DEACTIVATE:
|
||||
stopThread();
|
||||
|
||||
NotificationManager notificationManager = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
notificationManager.cancel(NOTIFICATION_ACTIVATED);
|
||||
|
||||
notification = null;
|
||||
return START_NOT_STICKY;
|
||||
}
|
||||
@ -156,6 +153,10 @@ public class DaedalusVpnService extends VpnService implements Runnable {
|
||||
Os.close(mBlockFd);
|
||||
this.mThread = null;
|
||||
}
|
||||
if (notification != null) {
|
||||
NotificationManager notificationManager = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
notificationManager.cancel(NOTIFICATION_ACTIVATED);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.d(TAG, e.toString());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user