Skip to content

Commit

Permalink
Heartbeat added
Browse files Browse the repository at this point in the history
  • Loading branch information
snaeji authored Jan 9, 2019
1 parent 4df0548 commit f099468
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public void notificationCancel() {
nManager.cancel(NOTIFICATION_ID);
}

/*

public void closeNotificationIfNotRunning() {
Log.i(TAG, "Gísli's Heartbeat");
//return;
Expand All @@ -247,7 +247,7 @@ public void closeNotificationIfNotRunning() {
notificationCancel();
}
}
*/


public void stopSound() {
requestAudioFocus();
Expand All @@ -259,7 +259,7 @@ public void getWifiLock() {
requestAudioFocus();
requestWifiLock();

/*

// Setup listener
if (t == null) {
t = new Timer();
Expand All @@ -270,27 +270,27 @@ public void run() {
}
}, 1000, 1000);
}
*/

}

public void releaseLocks() {
releaseWakeLock();
releaseAudioFocus();
releaseWifiLock();
/*

if (t != null) {
t.cancel();
t = null;
}
*/

}

@Override
protected void onDestroy() {
Log.i(TAG, "Media Gardina onDestroy");
nManager.cancel(NOTIFICATION_ID);
releaseLocks();
//t.cancel();
t.cancel();
super.onDestroy();
}

Expand All @@ -304,7 +304,7 @@ void select() {
notificationCancel();
}

/*

private boolean isAppRunning(Context context) {
ActivityManager m = (ActivityManager) context.getSystemService( ACTIVITY_SERVICE );
List<ActivityManager.RunningTaskInfo> runningTaskInfoList = m.getRunningTasks(10);
Expand All @@ -319,5 +319,5 @@ private boolean isAppRunning(Context context) {
}
return true; // App is in background or foreground
}
*/

}

0 comments on commit f099468

Please sign in to comment.