mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Fix exit "race", add persistable permissions
This commit is contained in:
parent
54c9e28444
commit
2364c1c5e6
1 changed files with 4 additions and 2 deletions
|
@ -784,8 +784,8 @@ public abstract class NativeActivity extends Activity {
|
|||
// I've seen crashes that seem to indicate that sometimes it hasn't...
|
||||
NativeApp.audioShutdown();
|
||||
if (shuttingDown || isFinishing()) {
|
||||
unregisterCallbacks();
|
||||
NativeApp.shutdown();
|
||||
unregisterCallbacks();
|
||||
initialized = false;
|
||||
}
|
||||
navigationCallbackView = null;
|
||||
|
@ -1144,7 +1144,8 @@ public abstract class NativeActivity extends Activity {
|
|||
} else if (requestCode == RESULT_BROWSE_FILE) {
|
||||
Uri selectedFile = data.getData();
|
||||
if (selectedFile != null) {
|
||||
// NativeApp.sendMessage("br");
|
||||
// Grab permanent permission so we can show it in recents list etc.
|
||||
getContentResolver().takePersistableUriPermission(selectedFile, Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||
Log.i(TAG, "Browse file finished:" + selectedFile.toString());
|
||||
NativeApp.sendMessage("browse_fileSelect", selectedFile.toString());
|
||||
}
|
||||
|
@ -1292,6 +1293,7 @@ public abstract class NativeActivity extends Activity {
|
|||
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
|
||||
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
intent.setType("application/octet-stream");
|
||||
intent.addFlags(Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION);
|
||||
//intent.putExtra(DocumentsContract.EXTRA_INITIAL_URI, pickerInitialUri);
|
||||
startActivityForResult(intent, RESULT_BROWSE_FILE);
|
||||
} catch (Exception e) {
|
||||
|
|
Loading…
Add table
Reference in a new issue