]> git.eshelyaron.com Git - emacs.git/commitdiff
Clean up some redundant or otherwise suspect code
authorPo Lu <luangruo@yahoo.com>
Wed, 29 Nov 2023 02:46:42 +0000 (10:46 +0800)
committerPo Lu <luangruo@yahoo.com>
Wed, 29 Nov 2023 02:51:49 +0000 (10:51 +0800)
* 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.

java/org/gnu/emacs/EmacsOpenActivity.java
java/org/gnu/emacs/EmacsSafThread.java
java/org/gnu/emacs/EmacsService.java

index 5cca6cfcdffd4c510d4d3a990bb67718274c5d8d..32a79d1a797daf76ab45bc59420eca6773e0aa3e 100644 (file)
@@ -533,8 +533,7 @@ public final class EmacsOpenActivity extends Activity
                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);
index 1b62662b4fcaacd0985d572ddf8c81903e36d0de..7917e2d48800c03d6c38ee312365ab5028357f27 100644 (file)
@@ -1430,9 +1430,6 @@ public final class EmacsSafThread extends HandlerThread
            /* 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;
index 3cc37dd992dabc6efce86cb6d46aab4b5f46562a..33832505333eabde702683c3240462a22107e927 100644 (file)
@@ -1413,7 +1413,7 @@ public final class EmacsService extends Service
      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