File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
app/src/main/java/org/leyfer/thesis/touchlogger_dirty/notification Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,8 @@ public class ControlNotification {
2929 private final NotificationCompat .Action resumeAction ;
3030 private final NotificationManager notificationManager ;
3131
32+ private StatusEvent .Status currentStatus = StatusEvent .Status .STATUS_OFFLINE ;
33+
3234 public ControlNotification (Context context ) {
3335 this .context = context ;
3436
@@ -114,9 +116,13 @@ public void onResumed() {
114116 @ Subscribe (threadMode = ThreadMode .MAIN )
115117 public void onStatusEvent (StatusEvent statusEvent ) {
116118 if (statusEvent .getStatus () == StatusEvent .Status .STATUS_ONLINE ) {
117- setOnline (statusEvent .getStatusString ());
119+ if (currentStatus != StatusEvent .Status .STATUS_ONLINE ) {
120+ setOnline (statusEvent .getStatusString ());
121+ }
118122 } else if (statusEvent .getStatus () == StatusEvent .Status .STATUS_OFFLINE ) {
119- setOffline (statusEvent .getStatusString ());
123+ if (currentStatus != StatusEvent .Status .STATUS_OFFLINE ) {
124+ setOffline (statusEvent .getStatusString ());
125+ }
120126 }
121127 }
122128
You can’t perform that action at this time.
0 commit comments