use of com.nutomic.syncthingandroid.http.PostConfigRequest in project syncthing-android by syncthing.
the class RestApi method saveConfigAndRestart.
/**
* Sends current config and restarts Syncthing.
*/
public void saveConfigAndRestart() {
String jsonConfig;
synchronized (mConfigLock) {
jsonConfig = new Gson().toJson(mConfig);
}
new PostConfigRequest(mContext, mUrl, mApiKey, jsonConfig, result -> {
Intent intent = new Intent(mContext, SyncthingService.class).setAction(SyncthingService.ACTION_RESTART);
mContext.startService(intent);
});
mOnConfigChangedListener.onConfigChanged();
}
use of com.nutomic.syncthingandroid.http.PostConfigRequest in project syncthing-android by syncthing.
the class RestApi method restart.
/**
* Sends current config and restarts Syncthing.
*/
public void restart() {
new PostConfigRequest(mContext, mUrl, mApiKey, new Gson().toJson(mConfig), result -> {
Intent intent = new Intent(mContext, SyncthingService.class).setAction(SyncthingService.ACTION_RESTART);
mContext.startService(intent);
});
}
Aggregations