Skip to content

Commit

Permalink
Fix foreground notification
Browse files Browse the repository at this point in the history
  • Loading branch information
nonlin-lin-chaos-order-etc-etal committed Jun 5, 2024
1 parent e6f903e commit 2af095f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/src/main/java/org/purplei2p/i2pd/ForegroundService.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
public class ForegroundService extends Service {
private static final String TAG = "FgService";
private volatile boolean shown;

public static ForegroundService getInstance() {
return instance;
}

private static ForegroundService instance;
private static volatile DaemonWrapper daemon;
private static final Object initDeinitLock = new Object();
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/java/org/purplei2p/i2pd/appscope/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ public void onTerminate() {
} catch (Throwable tr) {
Log.e(TAG, "throwable caught and ignored", tr);
}
try{
ForegroundService fs = ForegroundService.getInstance();
if(fs!=null)fs.onDestroy();
}catch(Throwable tr) {
Log.e(TAG, "", tr);
}
super.onTerminate();
}

Expand Down

0 comments on commit 2af095f

Please sign in to comment.