Skip to content

Commit

Permalink
Merge pull request #45 from livefront/fix-rotation-clearing-issue
Browse files Browse the repository at this point in the history
Don't ignore writing to disk on configuration changes
  • Loading branch information
brian-livefront committed May 30, 2019
2 parents 9fd999b + eca30e7 commit 4aff8cb
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ private String getSavedUuid(@NonNull Object target,
}

private boolean isAppInForeground() {
return mActivityCount > 0;
return mActivityCount > 0 || mIsConfigChange;
}

/**
Expand All @@ -150,15 +150,9 @@ private boolean isAppInForeground() {
* for this task (and any others currently running in the background) to complete before
* proceeding in order to prevent the app from becoming fully "stopped" (and therefore killable
* by the OS before the data is saved).
*
* Note that if there is a configuration change taking place, no action will be taken.
*/
private void queueDiskWritingIfNecessary(@NonNull final String uuid,
@NonNull final Bundle bundle) {
if (mIsConfigChange) {
// Don't process the Bundle or write it to disk during a config change
return;
}
Runnable runnable = new Runnable() {
@Override
public void run() {
Expand Down

0 comments on commit 4aff8cb

Please sign in to comment.