Update TermuxConstants

The `TermuxConstants` classes has been updated to `v0.6.0`. Check its Changelog sections for info on changes.
This commit is contained in:
agnostic-apollo
2021-03-16 21:29:25 +05:00
parent 9e82561804
commit 2e7fd480f4
2 changed files with 11 additions and 4 deletions

View File

@@ -5,7 +5,7 @@ import android.annotation.SuppressLint;
import java.io.File; import java.io.File;
/* /*
* Version: v0.5.0 * Version: v0.6.0
* *
* Changelog * Changelog
* *
@@ -42,7 +42,10 @@ import java.io.File;
* `TERMUX_WIDGET_DEFAULT_PREFERENCES_FILE_BASENAME_WITHOUT_EXTENSION`. * `TERMUX_WIDGET_DEFAULT_PREFERENCES_FILE_BASENAME_WITHOUT_EXTENSION`.
* *
* - 0.5.0 (2021-03-16) * - 0.5.0 (2021-03-16)
* - Renamed "Termux Plugin app" to "Termux Tasker app" * - Renamed "Termux Plugin app" labels to "Termux Tasker app"
*
* - 0.6.0 (2021-03-16)
* - Added `TERMUX_FILE_SHARE_URI_AUTHORITY`
*/ */
/** /**
@@ -332,9 +335,13 @@ public final class TermuxConstants {
/* Default value for {@link #PROP_ALLOW_EXTERNAL_APPS} */ /* Default value for {@link #PROP_ALLOW_EXTERNAL_APPS} */
public static final String PROP_DEFAULT_VALUE_ALLOW_EXTERNAL_APPS = "false"; // Default: "false" public static final String PROP_DEFAULT_VALUE_ALLOW_EXTERNAL_APPS = "false"; // Default: "false"
/* The broadcast action sent when Termux App opens */
public static final String BROADCAST_TERMUX_OPENED = TERMUX_PACKAGE_NAME + ".app.OPENED"; public static final String BROADCAST_TERMUX_OPENED = TERMUX_PACKAGE_NAME + ".app.OPENED";
/* The Uri authority for Termux app file shares */
public static final String TERMUX_FILE_SHARE_URI_AUTHORITY = TERMUX_PACKAGE_NAME + ".files"; // Default: "com.termux.files"

View File

@@ -88,7 +88,7 @@ public class TermuxOpenReceiver extends BroadcastReceiver {
contentTypeToUse = contentTypeExtra; contentTypeToUse = contentTypeExtra;
} }
Uri uriToShare = Uri.parse("content://com.termux.files" + fileToShare.getAbsolutePath()); Uri uriToShare = Uri.parse("content://" + TermuxConstants.TERMUX_FILE_SHARE_URI_AUTHORITY + fileToShare.getAbsolutePath());
if (Intent.ACTION_SEND.equals(intentAction)) { if (Intent.ACTION_SEND.equals(intentAction)) {
sendIntent.putExtra(Intent.EXTRA_STREAM, uriToShare); sendIntent.putExtra(Intent.EXTRA_STREAM, uriToShare);