Merge pull request #10589 from JosJuice/android-more-init-checks

Android: Use AfterDirectoryInitializationRunner more comprehensively
This commit is contained in:
Mai M 2022-04-17 05:43:06 -04:00 committed by GitHub
commit 3ed9d5a3c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 8 deletions

View File

@ -26,6 +26,7 @@ import org.dolphinemu.dolphinemu.utils.AfterDirectoryInitializationRunner;
import org.dolphinemu.dolphinemu.utils.BooleanSupplier;
import org.dolphinemu.dolphinemu.utils.CompletableFuture;
import org.dolphinemu.dolphinemu.utils.ContentHandler;
import org.dolphinemu.dolphinemu.utils.DirectoryInitialization;
import org.dolphinemu.dolphinemu.utils.FileBrowserHelper;
import org.dolphinemu.dolphinemu.utils.ThreadUtil;
import org.dolphinemu.dolphinemu.utils.WiiUtils;
@ -92,7 +93,8 @@ public final class MainPresenter
return true;
case R.id.button_add_directory:
mView.launchFileListActivity();
new AfterDirectoryInitializationRunner().runWithLifecycle(activity, true,
mView::launchFileListActivity);
return true;
case R.id.menu_open_file:
@ -104,7 +106,8 @@ public final class MainPresenter
return true;
case R.id.menu_online_system_update:
launchOnlineUpdate();
new AfterDirectoryInitializationRunner().runWithLifecycle(activity, true,
this::launchOnlineUpdate);
return true;
case R.id.menu_install_wad:
@ -310,18 +313,20 @@ public final class MainPresenter
private void launchWiiSystemMenu()
{
WiiUtils.isSystemMenuInstalled();
if (WiiUtils.isSystemMenuInstalled())
{
EmulationActivity.launchSystemMenu(mActivity);
}
else
{
SystemMenuNotInstalledDialogFragment dialogFragment =
new SystemMenuNotInstalledDialogFragment();
dialogFragment
.show(mActivity.getSupportFragmentManager(), "SystemMenuNotInstalledDialogFragment");
new AfterDirectoryInitializationRunner().runWithLifecycle(mActivity, true, () ->
{
SystemMenuNotInstalledDialogFragment dialogFragment =
new SystemMenuNotInstalledDialogFragment();
dialogFragment
.show(mActivity.getSupportFragmentManager(),
"SystemMenuNotInstalledDialogFragment");
});
}
}
}