mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-07 03:05:18 +08:00
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:
@@ -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"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -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);
|
||||||
|
Reference in New Issue
Block a user