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:
|
case ACTION_DEACTIVATE:
|
||||||
stopThread();
|
stopThread();
|
||||||
|
|
||||||
NotificationManager notificationManager = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);
|
|
||||||
notificationManager.cancel(NOTIFICATION_ACTIVATED);
|
|
||||||
|
|
||||||
notification = null;
|
notification = null;
|
||||||
return START_NOT_STICKY;
|
return START_NOT_STICKY;
|
||||||
}
|
}
|
||||||
@ -156,6 +153,10 @@ public class DaedalusVpnService extends VpnService implements Runnable {
|
|||||||
Os.close(mBlockFd);
|
Os.close(mBlockFd);
|
||||||
this.mThread = null;
|
this.mThread = null;
|
||||||
}
|
}
|
||||||
|
if (notification != null) {
|
||||||
|
NotificationManager notificationManager = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
|
notificationManager.cancel(NOTIFICATION_ACTIVATED);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.d(TAG, e.toString());
|
Log.d(TAG, e.toString());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user