Prevent crash when requesting storage permissions on Android
* java/org/gnu/emacs/EmacsService.java (requestStorageAccess30): Handle ActivityNotFoundException.
This commit is contained in:
parent
be316dc1c7
commit
1751739152
1 changed files with 10 additions and 1 deletions
|
@ -54,6 +54,7 @@
|
|||
import android.app.PendingIntent;
|
||||
import android.app.Service;
|
||||
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.content.ContentResolver;
|
||||
|
@ -2092,7 +2093,15 @@ In addition, arbitrary runtime exceptions (such as
|
|||
|
||||
/* Now request these permissions. */
|
||||
|
||||
activity.startActivity (intent);
|
||||
try
|
||||
{
|
||||
activity.startActivity (intent);
|
||||
}
|
||||
catch (ActivityNotFoundException exception)
|
||||
{
|
||||
Log.w (TAG, "Failed to request storage access permissions: ");
|
||||
exception.printStackTrace ();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue