diff options
| author | Po Lu | 2023-11-29 10:46:42 +0800 |
|---|---|---|
| committer | Po Lu | 2023-11-29 10:51:49 +0800 |
| commit | 265ffe59fbd7c01e2bd5a8c6dcac9035c00de004 (patch) | |
| tree | e92142455855fc2c7317cb143e53991c8740deee /java | |
| parent | 5a0250f76676d8750f42bbca1af5c4553846949b (diff) | |
| download | emacs-265ffe59fbd7c01e2bd5a8c6dcac9035c00de004.tar.gz emacs-265ffe59fbd7c01e2bd5a8c6dcac9035c00de004.zip | |
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.
Diffstat (limited to 'java')
| -rw-r--r-- | java/org/gnu/emacs/EmacsOpenActivity.java | 3 | ||||
| -rw-r--r-- | java/org/gnu/emacs/EmacsSafThread.java | 3 | ||||
| -rw-r--r-- | java/org/gnu/emacs/EmacsService.java | 2 |
3 files changed, 2 insertions, 6 deletions
diff --git a/java/org/gnu/emacs/EmacsOpenActivity.java b/java/org/gnu/emacs/EmacsOpenActivity.java index 5cca6cfcdff..32a79d1a797 100644 --- a/java/org/gnu/emacs/EmacsOpenActivity.java +++ b/java/org/gnu/emacs/EmacsOpenActivity.java | |||
| @@ -533,8 +533,7 @@ public final class EmacsOpenActivity extends Activity | |||
| 533 | else | 533 | else |
| 534 | uri = intent.getParcelableExtra (Intent.EXTRA_STREAM); | 534 | uri = intent.getParcelableExtra (Intent.EXTRA_STREAM); |
| 535 | 535 | ||
| 536 | if (uri != null | 536 | if ((scheme = uri.getScheme ()) != null |
| 537 | && (scheme = uri.getScheme ()) != null | ||
| 538 | && scheme.equals ("content")) | 537 | && scheme.equals ("content")) |
| 539 | { | 538 | { |
| 540 | tem1 = EmacsService.buildContentName (uri); | 539 | tem1 = EmacsService.buildContentName (uri); |
diff --git a/java/org/gnu/emacs/EmacsSafThread.java b/java/org/gnu/emacs/EmacsSafThread.java index 1b62662b4fc..7917e2d4880 100644 --- a/java/org/gnu/emacs/EmacsSafThread.java +++ b/java/org/gnu/emacs/EmacsSafThread.java | |||
| @@ -1430,9 +1430,6 @@ public final class EmacsSafThread extends HandlerThread | |||
| 1430 | /* If so, don't check for FLAG_SUPPORTS_WRITE. | 1430 | /* If so, don't check for FLAG_SUPPORTS_WRITE. |
| 1431 | Check for FLAG_DIR_SUPPORTS_CREATE instead. */ | 1431 | Check for FLAG_DIR_SUPPORTS_CREATE instead. */ |
| 1432 | 1432 | ||
| 1433 | if (!writable) | ||
| 1434 | return 0; | ||
| 1435 | |||
| 1436 | index = cursor.getColumnIndex (Document.COLUMN_FLAGS); | 1433 | index = cursor.getColumnIndex (Document.COLUMN_FLAGS); |
| 1437 | if (index < 0) | 1434 | if (index < 0) |
| 1438 | return -3; | 1435 | return -3; |
diff --git a/java/org/gnu/emacs/EmacsService.java b/java/org/gnu/emacs/EmacsService.java index 3cc37dd992d..33832505333 100644 --- a/java/org/gnu/emacs/EmacsService.java +++ b/java/org/gnu/emacs/EmacsService.java | |||
| @@ -1413,7 +1413,7 @@ public final class EmacsService extends Service | |||
| 1413 | of OperationCanceledException, SecurityException, | 1413 | of OperationCanceledException, SecurityException, |
| 1414 | FileNotFoundException, or UnsupportedOperationException. */ | 1414 | FileNotFoundException, or UnsupportedOperationException. */ |
| 1415 | 1415 | ||
| 1416 | private int | 1416 | public int |
| 1417 | documentIdFromName (String tree_uri, String name, String[] id_return) | 1417 | documentIdFromName (String tree_uri, String name, String[] id_return) |
| 1418 | { | 1418 | { |
| 1419 | /* Start the thread used to run SAF requests if it isn't already | 1419 | /* Start the thread used to run SAF requests if it isn't already |