On Android 11 we need MANAGE_EXTERNAL_STORAGE to access files without
restrictions on shared storage.
Android 10 we have to opt-out from scoped storage and use WRITE_EXTERNAL_STORAGE.
* Changed the hardcoded cache directory to the android alternative (pointing to /data/user/0 which is a symlink to /data/data).
* Implemented the transparent activity mechanism for downloading multiple apps through the Play Store (which just works as if the intent was added to the back-stack)
* Now we check deliberately check for source (external for ext. repo and play-store for the Play Store).
* Fixed a few bugs.
Re-implementation of https://github.com/termux/termux-app/pull/1029.
If Termux has property "allow-external-apps" set to "true", a third-party
program will be able to send intents for executing custom commands
within Termux environment.
Third-party program must declare permission "com.termux.permission.RUN_COMMAND".
Why:
* During backup process Termux is being killed in most cases.
* Backup data is limited to 25 MB.
* Backup may not be performed/updated in certain cases.
The failsafe activity were infrequently used while confusing users.
Replace it with an app shortcut on Android 7.1+ and a separate app on
earlier versions.
Also enables session autoclosing so no more "annoying" messages
about "process completed - press enter". There autoclosing will be
performed on exit codes '0' and '130'.
On Android TV devices old behaviour will be used - auto close enabled for all
sessions when amount of running sessions >1.
From https://developer.android.com/guide/components/services:
"Apps that target Android 9 (API level 28) or higher and use foreground
services must request the FOREGROUND_SERVICE permission. This is a
normal permission, so the system automatically grants it to the
requesting app.
If an app that targets API level 28 or higher attempts to create a
foreground service without requesting FOREGROUND_SERVICE, the system
throws a SecurityException."
Setting android:resizeableActivity="true" should AFAIK not be needed
as https://developer.android.com/guide/topics/ui/multi-window.html
states that:
If your app targets API level 24, but you do not specify a value
for this attribute, the attribute's value defaults to true.
However, on a Galaxy S8 running Android 7.0 this attribute is needed
in order to have resizeable windows when in Samsung Dex mode.
Fixes#309.
A single meta-data entry is enough to make Termux "Multi Window" aware on supported Samsung devices.
Tested and confirmed working on Samsung Note Pro 12.2 running Android 5.1.1.
This addition should not interfer with Android 6+'s split screen feature.
Tested and confirmed split screen functions as normal on a Nexus 6 running Android 7.0.
This addition should go unnoticed on non-Smasung Android 5 devices.
Tested and confirmed no functionality visible on Nexus 5 running Android 5.1.
As we have a document provider now we can remove ACTION_GET_CONTENT.
"The ACTION_OPEN_DOCUMENT intent is only available on devices running
Android 4.4 and higher. If you want your application to support
ACTION_GET_CONTENT to accommodate devices that are running Android 4.3
and lower, you should disable the ACTION_GET_CONTENT intent filter in
your manifest for devices running Android 4.4 or higher. A document
provider and ACTION_GET_CONTENT should be considered mutually exclusive.
If you support both of them simultaneously, your app will appear twice
in the system picker UI, offering two different ways of accessing your
stored data. This would be confusing for users."
- http://developer.android.com/guide/topics/providers/document-provider.html#43
The files are saved to $HOME/downloads/, after which the user
may choose to open the downloads/ folder or edit the file with
the $HOME/bin/termux-file-editor program.
It's also possible to receive URL:s, in which case the
$HOME/bin/termux-url-opener program will be called.
Starting with Android 6.0 the system may automatically backup app
data when a users installs an app on a new device or reinstalls an
app on one. After this commit this only affects the $HOME/backup/
folder, so that the user may choose what to backup.
See https://developer.android.com/training/backup/autosyncapi.html