Clean up some redundant or otherwise suspect code

* java/org/gnu/emacs/EmacsOpenActivity.java (onCreate):
Don't check if URI is non-NULL, for instanceof checks this
also.

* java/org/gnu/emacs/EmacsSafThread.java (accessDocument1):
Don't check !writable twice.

* java/org/gnu/emacs/EmacsService.java (documentIdFromName):
Designate this function as public, since it is called
through JNI.
This commit is contained in:
Po Lu 2023-11-29 10:46:42 +08:00
parent 5a0250f766
commit 265ffe59fb
3 changed files with 2 additions and 6 deletions

View file

@ -533,8 +533,7 @@ private class EmacsClientThread extends Thread
else
uri = intent.getParcelableExtra (Intent.EXTRA_STREAM);
if (uri != null
&& (scheme = uri.getScheme ()) != null
if ((scheme = uri.getScheme ()) != null
&& scheme.equals ("content"))
{
tem1 = EmacsService.buildContentName (uri);

View file

@ -1430,9 +1430,6 @@ type is either NULL (in which case id should also be NULL) or
/* If so, don't check for FLAG_SUPPORTS_WRITE.
Check for FLAG_DIR_SUPPORTS_CREATE instead. */
if (!writable)
return 0;
index = cursor.getColumnIndex (Document.COLUMN_FLAGS);
if (index < 0)
return -3;

View file

@ -1413,7 +1413,7 @@ else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
of OperationCanceledException, SecurityException,
FileNotFoundException, or UnsupportedOperationException. */
private int
public int
documentIdFromName (String tree_uri, String name, String[] id_return)
{
/* Start the thread used to run SAF requests if it isn't already