Skip to content

Commit

Permalink
Merge pull request #995 from dimagi/hotfix/login-dialog-and-form-save…
Browse files Browse the repository at this point in the history
…-on-expire

2.25.3 hotfix: persist login dialog and save form on session expiration
  • Loading branch information
ctsims committed Jan 21, 2016
2 parents c3bdb11 + b84949a commit 41f41cd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/src/org/commcare/dalvik/activities/LoginActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ public void onGlobalLayout() {

@Override
public void onSaveInstanceState(Bundle savedInstanceState) {
super.onSaveInstanceState(savedInstanceState);

String enteredUsername = username.getText().toString();
if (!"".equals(enteredUsername) && enteredUsername != null) {
savedInstanceState.putString(KEY_ENTERED_USER, enteredUsername);
Expand Down
12 changes: 10 additions & 2 deletions app/src/org/odk/collect/android/tasks/SaveToDiskTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ public SaveToDiskTask(Uri mUri, Boolean saveAndExit, Boolean markCompleted, Stri
this.instanceContentUri = instanceContentUri;
this.symetricKey = symetricKey;
this.headless = headless;
this.taskId = SAVING_TASK_ID;
if (headless) {
this.taskId = -1;
} else {
this.taskId = SAVING_TASK_ID;
}
}

/**
Expand Down Expand Up @@ -346,13 +350,17 @@ private boolean exportXmlFile(ByteArrayPayload payload, OutputStream output) {


@Override
protected void deliverResult(R receiver, Integer result) {
protected void onPostExecute(Integer result) {
synchronized (this) {
if (mSavedListener != null)
mSavedListener.savingComplete(result, headless);
}
}

@Override
protected void deliverResult(R receiver, Integer result) {
}

@Override
protected void deliverUpdate(R receiver, String... update) {
}
Expand Down

0 comments on commit 41f41cd

Please sign in to comment.