Add a system to improve app foreground observation.

There was previously a crash that occurred when multiple threads tried to use ProcessLifecycleOwner, and this will hopefully resolve that.
This commit is contained in:
Greyson Parrelli
2021-02-08 15:37:45 -05:00
committed by GitHub
parent a160af2d11
commit 3bdf2e7e2c
13 changed files with 147 additions and 49 deletions

View File

@@ -91,8 +91,8 @@ public abstract class PassphraseRequiredActivity extends BaseActivity implements
@Override
public void onMasterSecretCleared() {
Log.d(TAG, "onMasterSecretCleared()");
if (ApplicationContext.getInstance(this).isAppVisible()) routeApplicationState(true);
else finish();
if (ApplicationDependencies.getAppForegroundObserver().isForegrounded()) routeApplicationState(true);
else finish();
}
protected <T extends Fragment> T initFragment(@IdRes int target,