mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-11-22 12:21:15 +00:00
Update Syncthing URL on restart if it was changed (fixes #442).
This commit is contained in:
parent
6a686cdb95
commit
f4c15a98e6
2 changed files with 8 additions and 2 deletions
|
@ -150,7 +150,7 @@ public class RestApi implements SyncthingService.OnWebGuiAvailableListener,
|
||||||
|
|
||||||
private String mVersion;
|
private String mVersion;
|
||||||
|
|
||||||
private final String mUrl;
|
private String mUrl;
|
||||||
|
|
||||||
private final String mApiKey;
|
private final String mApiKey;
|
||||||
|
|
||||||
|
@ -200,6 +200,10 @@ public class RestApi implements SyncthingService.OnWebGuiAvailableListener,
|
||||||
mOnConfigChangedListener = configListener;
|
mOnConfigChangedListener = configListener;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setWebGuiUrl(String newUrl) {
|
||||||
|
mUrl = newUrl;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Number of previous calls to {@link #tryIsAvailable()}.
|
* Number of previous calls to {@link #tryIsAvailable()}.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -227,8 +227,10 @@ public class SyncthingService extends Service implements
|
||||||
if (mConfig != null) {
|
if (mConfig != null) {
|
||||||
mCurrentState = State.STARTING;
|
mCurrentState = State.STARTING;
|
||||||
|
|
||||||
if (mApi != null)
|
if (mApi != null) {
|
||||||
registerOnWebGuiAvailableListener(mApi);
|
registerOnWebGuiAvailableListener(mApi);
|
||||||
|
mApi.setWebGuiUrl(mConfig.getWebGuiUrl());
|
||||||
|
}
|
||||||
if (mEventProcessor != null)
|
if (mEventProcessor != null)
|
||||||
registerOnWebGuiAvailableListener(mEventProcessor);
|
registerOnWebGuiAvailableListener(mEventProcessor);
|
||||||
new PollWebGuiAvailableTaskImpl(getFilesDir() + "/" + HTTPS_CERT_FILE)
|
new PollWebGuiAvailableTaskImpl(getFilesDir() + "/" + HTTPS_CERT_FILE)
|
||||||
|
|
Loading…
Reference in a new issue