Skip to content

Commit 3adb847

Browse files
committed
- exposed username and password to changes after initial configuration
1 parent f094b69 commit 3adb847

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

SweLib/src/main/java/org/sofwerx/ogc/sos/SosService.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ public SosService(Context context, SosSensor sosSensor, String sosServerURL, Str
5050
if (context instanceof SosMessageListener)
5151
listener = (SosMessageListener)context;
5252
this.serverURL = sosServerURL;
53-
this.username = username;
54-
this.password = password;
53+
setSosServerUsername(username);
54+
setSosServerPassword(password);
5555
sosThread = new HandlerThread("SosService") {
5656
@Override
5757
protected void onLooperPrepared() {
@@ -201,6 +201,18 @@ public void registerSensor() {
201201
public void setListener(SosMessageListener listener) { this.listener = listener; }
202202
public SosSensor getSosSensor() { return sosSensor; }
203203
public void setSosServerUrl(String serverUrl) { this.serverURL = serverUrl; }
204+
public void setSosServerUsername(String username) {
205+
if ((username != null) && (username.length() == 0))
206+
this.username = null;
207+
else
208+
this.username = username;
209+
}
210+
public void setSosServerPassword(String password) {
211+
if ((password != null) && (password.length() == 0))
212+
this.password = null;
213+
else
214+
this.password = password;
215+
}
204216

205217
/**
206218
* Sets the current sosSensor; if the sosSensor already has enough information

0 commit comments

Comments
 (0)