Skip to content

Commit

Permalink
Merge pull request dolphin-emu#10974 from t895/permissions-fix
Browse files Browse the repository at this point in the history
Android: Prevent app lockup when revoking write access
  • Loading branch information
JosJuice authored Aug 10, 2022
2 parents 6fbc1cb + a91e478 commit 3f794bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
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.PermissionsHandler;
import org.dolphinemu.dolphinemu.utils.ThreadUtil;
import org.dolphinemu.dolphinemu.utils.WiiUtils;

Expand Down Expand Up @@ -56,6 +58,10 @@ public MainPresenter(MainView view, FragmentActivity activity)

public void onCreate()
{
// Ask the user to grant write permission if relevant and not already granted
if (DirectoryInitialization.isWaitingForWriteAccess(mActivity))
PermissionsHandler.requestWritePermission(mActivity);

String versionName = BuildConfig.VERSION_NAME;
mView.setVersionString(versionName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ public final class StartupHandler

public static void HandleInit(FragmentActivity parent)
{
// Ask the user to grant write permission if relevant and not already granted
if (DirectoryInitialization.isWaitingForWriteAccess(parent))
PermissionsHandler.requestWritePermission(parent);

// Ask the user if he wants to enable analytics if we haven't yet.
Analytics.checkAnalyticsInit(parent);

Expand Down

0 comments on commit 3f794bf

Please sign in to comment.