Problem description
When I try to save a downloaded file, using termux-download with -p to a Termux internal path, nothing happens. No error are throw to the console and no notification on the android interface.
It works to /storage/emulated/0/Download/ however it wont work to $HOME/storage/downloads, even with it pointing to the first path.
Steps to reproduce
Step 1 - Run:
termux-download -d 'some picture' -t 'hyperbola' -p $HOME/gnu.jpg http://www.gnu.org/distros/screenshots/hyperbola-i3-thumb.jpg
Step 2 - no step two... that fails without log
Expected behavior
It must show the download on the Android notification and save the file on the destination set with -p parameter.
If it really can't download to $HOME, it must throw an error. It must write to STDERR and exit with a non zero status.
Paths like $HOME/storage/downloads must be translated with realpath by termux-download itself.
Additional information
All tests were made in a emulated device.
If you are rooted or have access to adb then capture a logcat with logcat -d "*:W", from a adb or root shell.
01-14 00:20:24.387 3763 16209 E memtrack: Couldn't load memtrack module
01-14 00:20:24.387 3763 16209 W android.os.Debug: failed to get memory consumption info: -1
01-14 00:20:40.927 6605 6605 E DecorView[]: Destroying unexpected ActionMode instance of TYPE_FLOATING; com.android.internal.view.FloatingActionMode@202ff60 was not the current floating action mode! Expected null
01-14 00:20:41.154 16213 16213 W /system/bin/app_process: Unexpected CPU variant for X86 using defaults: x86
01-14 00:20:41.156 16213 16213 W /system/bin/app_process: Could not create mount namespace.
01-14 00:20:41.156 16213 16213 W nativebridge: Failed to bind-mount /system/lib/x86/cpuinfo as /proc/cpuinfo: Operation not permitted
01-14 00:20:41.185 13608 13626 W DownloadManager: Path appears to be invalid: /data/data/com.termux/files/home/storage/downloads/gnu.jpg
01-14 00:20:41.185 13608 13626 W DownloadManager: Path appears to be invalid: /data/data/com.termux/files/home/storage/downloads/gnu.jpg
01-14 00:20:41.185 13608 13626 E DatabaseUtils: Writing exception to parcel
01-14 00:20:41.185 13608 13626 E DatabaseUtils: java.lang.SecurityException: Unsupported path /data/data/com.termux/files/home/storage/downloads/gnu.jpg
01-14 00:20:41.185 13608 13626 E DatabaseUtils: at com.android.providers.downloads.DownloadProvider.checkFileUriDestination(DownloadProvider.java:808)
01-14 00:20:41.185 13608 13626 E DatabaseUtils: at com.android.providers.downloads.DownloadProvider.insert(DownloadProvider.java:599)
01-14 00:20:41.185 13608 13626 E DatabaseUtils: at android.content.ContentProvider$Transport.insert(ContentProvider.java:267)
01-14 00:20:41.185 13608 13626 E DatabaseUtils: at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:152)
01-14 00:20:41.185 13608 13626 E DatabaseUtils: at android.os.Binder.execTransact(Binder.java:674)
01-14 00:20:41.186 12485 16222 E termux-api: Error in ResultReturner
01-14 00:20:41.186 12485 16222 E termux-api: java.lang.SecurityException: Unsupported path /data/data/com.termux/files/home/storage/downloads/gnu.jpg
01-14 00:20:41.186 12485 16222 E termux-api: at android.os.Parcel.readException(Parcel.java:1942)
01-14 00:20:41.186 12485 16222 E termux-api: at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:183)
01-14 00:20:41.186 12485 16222 E termux-api: at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135)
01-14 00:20:41.186 12485 16222 E termux-api: at android.content.ContentProviderProxy.insert(ContentProviderNative.java:476)
01-14 00:20:41.186 12485 16222 E termux-api: at android.content.ContentResolver.insert(ContentResolver.java:1539)
01-14 00:20:41.186 12485 16222 E termux-api: at android.app.DownloadManager.enqueue(DownloadManager.java:1041)
01-14 00:20:41.186 12485 16222 E termux-api: at com.termux.api.DownloadAPI.lambda$onReceive$0(DownloadAPI.java:41)
01-14 00:20:41.186 12485 16222 E termux-api: at com.termux.api.-$$Lambda$DownloadAPI$4YhREMVDJjtX4lY26y4bbDIrLiw.writeResult(Unknown Source:4)
01-14 00:20:41.186 12485 16222 E termux-api: at com.termux.api.util.ResultReturner.lambda$returnData$0(ResultReturner.java:133)
01-14 00:20:41.186 12485 16222 E termux-api: at com.termux.api.util.-$$Lambda$ResultReturner$oCU8JqHW5HLMrNZa40ThjAWcwzo.run(Unknown Source:8)
01-14 00:20:41.186 12485 16222 E termux-api: at java.lang.Thread.run(Thread.java:764)
01-14 00:20:45.441 656 6451 W MessageQueue: Handler (android.media.MediaPlayer$EventHandler) {24659ce} sending message to a Handler on a dead thread
01-14 00:20:45.441 656 6451 W MessageQueue: java.lang.IllegalStateException: Handler (android.media.MediaPlayer$EventHandler) {24659ce} sending message to a Handler on a dead thread
01-14 00:20:45.441 656 6451 W MessageQueue: at android.os.MessageQueue.enqueueMessage(MessageQueue.java:545)
01-14 00:20:45.441 656 6451 W MessageQueue: at android.os.Handler.enqueueMessage(Handler.java:661)
01-14 00:20:45.441 656 6451 W MessageQueue: at android.os.Handler.sendMessageAtTime(Handler.java:630)
01-14 00:20:45.441 656 6451 W MessageQueue: at android.os.Handler.sendMessageDelayed(Handler.java:600)
01-14 00:20:45.441 656 6451 W MessageQueue: at android.os.Handler.sendMessage(Handler.java:537)
01-14 00:20:45.441 656 6451 W MessageQueue: at android.media.MediaPlayer.postEventFromNative(MediaPlayer.java:3436)
Problem description When I try to save a downloaded file, using
termux-download
with-p
to a Termux internal path, nothing happens. No error are throw to the console and no notification on the android interface.It works to
/storage/emulated/0/Download/
however it wont work to$HOME/storage/downloads
, even with it pointing to the first path.Steps to reproduce Step 1 - Run:
termux-download -d 'some picture' -t 'hyperbola' -p $HOME/gnu.jpg http://www.gnu.org/distros/screenshots/hyperbola-i3-thumb.jpg
Step 2 - no step two... that fails without logExpected behavior It must show the download on the Android notification and save the file on the destination set with
-p
parameter.If it really can't download to
$HOME
, it must throw an error. It must write to STDERR and exit with a non zero status.Paths like
$HOME/storage/downloads
must be translated withrealpath
by termux-download itself.Additional information All tests were made in a emulated device.
Post output of command
termux-info
.If you are rooted or have access to adb then capture a logcat with
logcat -d "*:W"
, from a adb or root shell.