MainApplication: oom fixes upd

This commit is contained in:
Yuriy Liskov
2026-03-09 00:00:53 +02:00
parent 24e28559a0
commit 5dc73fcf92
2 changed files with 2 additions and 2 deletions

View File

@@ -158,7 +158,7 @@ public class BackupAndRestoreManager implements MotherActivity.OnPermissions {
if (mDataDir.isDirectory() && !FileHelpers.isEmpty(mDataDir)) {
File destination = new File(currentBackup, mDataDir.getName());
FileHelpers.copy(mDataDir, destination);
FileHelpers.copy(mDataDir, destination, fileName -> Helpers.endsWithAny(fileName.toString(), mBackupPatterns));
// Don't store unique id
FileHelpers.delete(new File(destination, HiddenPrefs.SHARED_PREFERENCES_NAME + ".xml"));

View File

@@ -105,7 +105,7 @@ public class MainApplication extends MultiDexApplication { // fix: Didn't find c
}
private void applyCrashFixes(Throwable e) {
if (e instanceof OutOfMemoryError) {
if (e instanceof OutOfMemoryError || e.getCause() instanceof OutOfMemoryError) {
Class<?> view = ViewManager.instance(getApplicationContext()).getTopView();
if (view == PlaybackView.class) {
PlayerTweaksData tweaksData = PlayerTweaksData.instance(getApplicationContext());