mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-11-29 15:51:17 +00:00
Move notificationHandler shutdown from RestApi to SyncthingService
This commit is contained in:
parent
e468f5a29c
commit
cf94716059
2 changed files with 4 additions and 7 deletions
|
@ -147,8 +147,6 @@ public class RestApi {
|
||||||
|
|
||||||
private Gson mGson;
|
private Gson mGson;
|
||||||
|
|
||||||
@Inject NotificationHandler mNotificationHandler;
|
|
||||||
|
|
||||||
public RestApi(Context context, URL url, String apiKey, OnApiAvailableListener apiListener,
|
public RestApi(Context context, URL url, String apiKey, OnApiAvailableListener apiListener,
|
||||||
OnConfigChangedListener configListener) {
|
OnConfigChangedListener configListener) {
|
||||||
((SyncthingApp) context.getApplicationContext()).component().inject(this);
|
((SyncthingApp) context.getApplicationContext()).component().inject(this);
|
||||||
|
@ -412,10 +410,6 @@ public class RestApi {
|
||||||
mOnConfigChangedListener.onConfigChanged();
|
mOnConfigChangedListener.onConfigChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void shutdown() {
|
|
||||||
mNotificationHandler.cancelRestartNotification();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the version name, or a (text) error message on failure.
|
* Returns the version name, or a (text) error message on failure.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -653,8 +653,11 @@ public class SyncthingService extends Service {
|
||||||
mEventProcessor = null;
|
mEventProcessor = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mNotificationHandler != null) {
|
||||||
|
mNotificationHandler.cancelRestartNotification();
|
||||||
|
}
|
||||||
|
|
||||||
if (mRestApi != null) {
|
if (mRestApi != null) {
|
||||||
mRestApi.shutdown();
|
|
||||||
mRestApi = null;
|
mRestApi = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue