1
0
mirror of https://github.com/danog/termux-api.git synced 2024-12-12 09:29:46 +01:00
Commit Graph

214 Commits

Author SHA1 Message Date
Cem
4de411b720 Fixed notifications not displaying on Oreo (#173) 2018-06-05 23:14:11 +02:00
Fredrik Fornwall
50230df060 Bump version from 0.20 to 0.21 2018-04-12 01:38:29 +02:00
tomty89
6b5122c2ba MediaPlayerAPI: Some more minor improvements (#160)
* MediaPlayerAPI: revert commit 299d557

The error message won't be displayed anyway:

$ touch empty
$ dd if=/dev/urandom of=random count=2048
2048+0 records in
2048+0 records out
1048576 bytes (1.0MB) copied, 0.190185 seconds, 5.3MB/s
$ termux-media-player play empty

setDataSourceFD failed.: status=0x80000000
$ termux-media-player play random

Prepare failed.: status=0x1
$

* MediaPlayerAPI: catch NullPointerException for -a play

* MediaPlayerAPI: use getCanonicalPath() instead

* MediaPlayerAPI: use proper values for setVolume()

* MediaPlayerAPI: fix play and stop from pause

* MediaPlayerAPI: add trackName for info and resume

Suggested by Auxilus (#162)
2018-04-12 01:36:41 +02:00
David Kramer
fa9373ab1e Fix possible crash in NotificationAPI from invalid LED color value (#164) 2018-04-12 01:21:06 +02:00
Fredrik Fornwall
19acd1d54a Bump version from 0.19 to 0.20 2018-04-09 01:12:53 +02:00
David Kramer
efcafdf579 Fixes incorrect error message being displayed when playing track / (#157)
possible crash when playing another track after other finished
2018-04-09 01:04:45 +02:00
David Kramer
0aeb960680 Add MicRecorderAPI (#158) 2018-04-09 01:04:37 +02:00
David Kramer
e7fa1d2498 Add WallpaperAPI 2018-04-09 01:03:10 +02:00
Fredrik Fornwall
56b5e9a935 Bump version from 0.18 to 0.19 2018-04-07 01:54:10 +02:00
landfillbaby
d4660a3ce9 MediaPlayerApi playHandler: prepare synchronously, don't always print failure
the isPlaying() call was completing before the prepareAsync() call, always returning "Failed to play: "
2018-04-07 01:53:26 +02:00
Fredrik Fornwall
a5b2a01d96 Bump version from 0.17 to 0.18 2018-04-07 00:42:31 +02:00
Tom Yan
34c6841a05 AudioAPI: updates for AudioTrack methods
There are several changes in the commit:

1. Use instance methods to get sample rate and buffer size info
on Android N or above only instead of Android M, since both
AudioAttributes.FLAG_LOW_LATENCY (256) and the implicitly used
AudioFormat.SAMPLE_RATE_UNSPECIFIED (0) are available only since
API 24 (N).

2. Use setPerformanceMode() on Android O, as FLAG_LOW_LATENCY is
deprecated since API 26 (O).

3. Create AudioTrack instance of both the fast (LOW_LATENCY) and
deep buffer (POWER_SAVING) mixer path. The two paths can be using
different subdevices on different rate and buffer size (or same
subdevice on same rate but different buffer size). For example on
my phone:

AUDIOTRACK_SAMPLE_RATE: 192000
AUDIOTRACK_BUFFER_SIZE_IN_FRAMES: 23046
AUDIOTRACK_SAMPLE_RATE_LOW_LATENCY: 48000
AUDIOTRACK_BUFFER_SIZE_IN_FRAMES_LOW_LATENCY: 192

4. Get info on sample rate with the getNativeOutputSampleRate()
static method (static in Java's sense; the value is still sink-
based) on builds older than N only. The rate appears to be of the
fast (LOW_LATENCY) mixer path if it is available.

5. A note on the static method getMinBufferSize(). The reason it
is not used even for older devices is, it returns buffer size info
of the deep buffer (POWER_SAVING) mixer path, while NOSR is the
rate of the fast (LOW_LATENCY) mixer path, so the value we can get
with it is not always sensical.
2018-04-07 00:41:37 +02:00
Tom Yan
299d55789b MediaPlayerAPI: check whether playback has been successfully started 2018-04-07 00:38:55 +02:00
Tom Yan
7bdd53008a MediaPlayerAPI: eliminate pointless toUpperCase()
Fixes #154.
2018-04-07 00:38:55 +02:00
Tom Yan
9c104aac36 MediaPlayerAPI: prevent NullPointerException
Fixes #154.
2018-04-07 00:38:55 +02:00
Tom Yan
1be62a5c91 MediaPlayerAPI: remove extension pattern check
There are way more possibilities and extension doesn't guarantee
anything about the file.
2018-04-07 00:38:55 +02:00
David Kramer
89e2b1ed95 Add MediaPlayerAPI (#146) 2018-04-02 01:27:13 +02:00
Fredrik Fornwall
bf9577e23a Bump version to 0.17 2018-04-02 00:59:10 +02:00
Fredrik Fornwall
b7cc2a3dd1 Update gradle configuration 2018-04-02 00:58:32 +02:00
Fredrik Fornwall
efc06c4a32 Remove unused import 2018-04-02 00:55:13 +02:00
David Kramer
eab70c318f Add SensorAPI (#147) 2018-04-02 00:51:14 +02:00
tomty89
11b84d9f9c AudioAPI: fix build-time error (#145) 2018-04-02 00:49:35 +02:00
tomty89
9552c418ba AudioAPI: avoid redundant code (#134) 2018-03-23 00:41:42 +01:00
David Kramer
91b8ed4249 Adds TorchAPI implementation (#137) 2018-03-23 00:22:43 +01:00
Fredrik Fornwall
adfc184011 Fix typo 2018-02-05 01:03:35 +01:00
Fredrik Fornwall
46201ae981 Bump version to 0.16 2018-02-05 01:01:03 +01:00
Fredrik Fornwall
1f3eee8e2e Format code 2018-02-05 00:53:01 +01:00
its-pointless
7d54c4d629 Update Audiotrack API (#129) 2018-02-05 00:46:01 +01:00
Ian Brunelli
32c2781664 Add MediaScannerAPI (#123) 2018-02-05 00:41:27 +01:00
Fredrik Fornwall
720daae952 Update build tools version 2018-02-01 22:23:12 +01:00
its-pointless
a544de8c1b gets info for fast_mixer (#126) 2018-02-01 22:22:07 +01:00
Fredrik Fornwall
d57169a97a Update gradle configuration 2017-11-26 23:27:07 +01:00
Fredrik Fornwall
bace70c37d Update gradle configuration 2017-10-31 19:26:33 +01:00
Fredrik Fornwall
21d6b973f9 Update gradle configuration 2017-09-24 22:54:15 +02:00
Fredrik Fornwall
e4bf7b94c0 Bump version to 0.15 2017-04-09 23:27:03 +02:00
Fredrik Fornwall
9e67ca2a57 termux-dialog: Make sure to close client 2017-04-09 23:26:12 +02:00
Fredrik Fornwall
ee5ed49fd7 Suport termux-telephony-call 2017-04-09 19:36:33 +02:00
Fredrik Fornwall
b72a223b4c termux-notification: Support --on-delete action
This makes it possible to act on the notification being dismissed.

Server side part of https://github.com/termux/termux-api/issues/81
2017-04-09 19:13:24 +02:00
Fredrik Fornwall
d4a91451cb Bump version to 0.14 2017-04-07 00:18:35 +02:00
Fredrik Fornwall
3e1bbea265 termux-dialog: Exit when back is pressed
This treats pressing the back button the same as pressing cancel.

Fixes #78.
2017-04-07 00:17:43 +02:00
Fredrik Fornwall
2c62ab229a Update gradle 2017-04-06 10:45:34 +02:00
Fredrik Fornwall
d6b176ccbb Bump version to 0.13 2017-02-20 03:23:49 +01:00
Fredrik Fornwall
341e5f395a Add comment about default tts audio stream 2017-02-20 02:03:48 +01:00
Alain Kalker
56b5a1257c termux-tts-speak: Use STREAM_MUSIC as default stream (#67)
This fixes #66.
2017-02-20 01:59:02 +01:00
Wetitpig
cff02a5614 Correct Typo (#57)
"Overhead" changed to "Overheat"
2017-01-26 07:54:19 +01:00
Fredrik Fornwall
3d2ff5fe60 Hack to make led work without vibrating
It seems that led coloring does not work without vibration. So if
the led color has been specified but not vibration, default to a
dummy vibrate={0}.
2017-01-10 00:39:52 +01:00
Fredrik Fornwall
25e6f00bef Bump version to 0.12 2017-01-06 02:16:05 +01:00
Fredrik Fornwall
adc9b4eccc Update the NotificationAPI 2017-01-05 03:47:52 +01:00
Fredrik Fornwall
fe51705dde Add WifiAPI 2017-01-05 03:46:46 +01:00
Fredrik Fornwall
79a2c03676 Update to new Termux icon 2017-01-05 02:33:20 +01:00
Fredrik Fornwall
41341bd0ca Clean up log calls 2016-12-04 17:36:33 +01:00
Fredrik Fornwall
85180038e3 Add the roundIcon to the manifest 2016-12-04 04:27:53 +01:00
Fredrik Fornwall
6e532522aa Use the new vector icon 2016-12-04 04:26:18 +01:00
Fredrik Fornwall
899a7e353c Add options to control notifictions 2016-12-04 04:24:29 +01:00
Fredrik Fornwall
8927dd540b Start a command to request a file from the system
Using the Storage Access Framework through something like

	termux-storage-get output-file

will allow one to get files from e.g. usb memory sticks.
2016-12-04 02:42:55 +01:00
Fredrik Fornwall
407681550a Update gradle 2016-11-29 23:25:12 +01:00
Fredrik Fornwall
378d4f19d5 Better flow for requesting permissions 2016-11-29 22:36:10 +01:00
Fredrik Fornwall
cfd0d52c38 Update gradle config 2016-10-26 02:11:33 +02:00
Fredrik Fornwall
fb1ccb8683 Merge pull request #45 from ZeppLu/long-message
now able to send message longer than the maximum size
2016-09-26 23:12:16 +02:00
Fredrik Fornwall
d85a3f9a29 Update gradle and Android Studio 2016-09-26 22:43:16 +02:00
Zepp Lu
05a9ad60bd now able to send message longer than the maximum size 2016-09-26 00:15:12 +08:00
Fredrik Fornwall
fbf628fefd Bump version to 0.11 2016-09-04 16:45:48 +02:00
garwiz
50672b0d51 Added optional region and variant params to TTS intent 2016-09-04 15:07:34 +02:00
Fredrik Fornwall
1f57769116 Manifest file cleanup 2016-08-22 14:43:06 +02:00
Fredrik Fornwall
fb58a71f99 Merge pull request #36 from edupsousa/master
Fixed unended JSON object for TelephonyDeviceInfo
2016-08-10 22:41:31 +02:00
Fredrik Fornwall
c09dc9ca67 Update gradle configuration 2016-08-10 22:39:24 +02:00
Eduardo Pereira de Sousa
c927b7d5a5 Fixed unended JSON object for TelephonyDeviceInfo 2016-08-09 23:39:29 -03:00
Fredrik Fornwall
1a85aeffb5 Format code (mostly tab -> whitespace diff) 2016-06-06 00:23:00 +02:00
Fredrik Fornwall
b52856b44e Bump build tools version 2016-06-06 00:19:04 +02:00
Fredrik Fornwall
c8b6bb67d2 Mark used hardware features as optional 2016-04-26 03:11:00 +02:00
Fredrik Fornwall
551bcd066f Bump version to 0.10 2016-04-26 03:06:12 +02:00
Fredrik Fornwall
6be2b473af Add infrared and telephony api:s 2016-04-26 03:05:39 +02:00
Fredrik Fornwall
a83a77c508 Support multiple recipients when sending SMS 2016-04-24 23:52:55 +02:00
Fredrik Fornwall
151717e2fb TextToSpeechAPI: Make stream configurable 2016-04-23 15:14:02 +02:00
Fredrik Fornwall
0fd66d37e3 termux-tts-speak: Use STREAM_NOTIFICATION 2016-04-20 11:24:02 +02:00
Fredrik Fornwall
6563446522 termux-tts-speak: Use STREAM_ALARM (fixes #13) 2016-04-20 00:31:01 +02:00
Fredrik Fornwall
0efb8bc1ee termux-camera-photo: Drop attempt to use previews
This doesn't work reliable across devices and is of questionable
value. Fixes #11. Fixes #15.
2016-04-20 00:18:40 +02:00
Fredrik Fornwall
7f050bded3 Request runtime permissions as necessary on 6.0+
Fixes #19.
2016-04-20 00:16:57 +02:00
Fredrik Fornwall
355fd21433 Bump version to 0.9 2016-01-12 14:17:09 +01:00
Fredrik Fornwall
bf5dec5c0d termux-vibrate: Do not vibrate when in silent mode
Do not vibrate when in silent mode unless the -f/--force option is
given.
2016-01-12 14:13:59 +01:00
Fredrik Fornwall
7170f8dcde Remove unused annotations 2016-01-12 14:13:59 +01:00
Fredrik Fornwall
631401f1fb Add a v2 of termux-clipboard for using stdin 2016-01-12 14:13:59 +01:00
Fredrik Fornwall
153fd6354c Update gradle config 2016-01-12 14:13:59 +01:00
Fredrik Fornwall
6945c069cd Bump version to 0.8 2015-11-29 23:22:34 +01:00
Fredrik Fornwall
e81c0dd2f0 Update version to 0.7 2015-11-29 23:17:33 +01:00
Ted Stein
4b3a1528b0 PhotoAPI: Take sensor orientation into account.
On a Nexus 5X, the old code would take pictures that were upside-down.
Apparently, the Android device standards require that the long edge of the
sensor must align with the long edge of the device, but doesn't say which of the
two ways to satisfy this manufacturers should pick. This change makes PhotoAPI
generate right-side-up pictures in both conditions.

Tested on a Nexus 7 (second-gen) and a Nexus 5X.
2015-11-29 01:27:21 -08:00
Fredrik Fornwall
f9f439feb0 Improve ShareAPI to work in more cases 2015-11-28 23:38:34 +01:00
Fredrik Fornwall
d5549938df Cleanup build.gradle 2015-11-28 11:56:37 +01:00
Fredrik Fornwall
1fb834ca98 Improve termux-dialog to support password and titles
Also bump version to 0.5.

See https://github.com/termux/termux-app/issues/3
2015-10-27 02:16:01 +01:00
Fredrik Fornwall
7719bd7c59 Remove stray char 2015-10-27 01:45:33 +01:00
Fredrik Fornwall
d5768dc4e5 Add support for password input dialogs 2015-10-27 00:13:06 +01:00
Fredrik Fornwall
2880427dfe Improve PhotoAPI 2015-09-20 22:35:02 +02:00
Fredrik Fornwall
b3e5882bc6 Compare against correct variable 2015-09-20 22:21:51 +02:00
Fredrik Fornwall
26801a68cf termux-share: Default to application/octet-stream
Also expose the file name in query().
2015-09-20 22:09:54 +02:00
Fredrik Fornwall
fe98a42faa Bump version to 0.4 2015-09-04 16:43:37 +02:00
Fredrik Fornwall
0ea0f250ba Update camera photo API
Try to warmup the camera sensor and focus machinery before
saving JPEG. Should hopefully fix problems with black/empty
images.
2015-09-04 16:42:10 +02:00
Fredrik Fornwall
ead1b8d168 Add information about camera jpeg output size 2015-09-04 15:59:47 +02:00
Fredrik Fornwall
7b32995f9f Lower case file extension before mimetype lookup 2015-09-04 15:46:14 +02:00
Fredrik Fornwall
20252cf9a7 Minor formatting changes only 2015-09-04 14:40:00 +02:00
Fredrik Fornwall
749e68b6f2 Gradle config update 2015-09-04 11:54:17 +02:00
Fredrik Fornwall
48120fa559 Gradle config tweaking 2015-08-01 03:50:36 +02:00
Fredrik Fornwall
5515c401ce Remove PhotoActivity 2015-08-01 02:43:56 +02:00
Fredrik Fornwall
5880d40624 Android Studio warnings cleanups 2015-08-01 02:43:20 +02:00
Fredrik Fornwall
2d6babcc29 Android Studio warnings cleanups 2015-08-01 02:39:22 +02:00
Fredrik Fornwall
ab1af8b244 Remove unused variables 2015-08-01 02:34:39 +02:00
Fredrik Fornwall
8305dc73a8 Add android:supportsRtl="true" 2015-08-01 02:31:21 +02:00
Fredrik Fornwall
9f90f6fc10 Secure the sharedfiles content provider 2015-08-01 02:26:19 +02:00
Fredrik Fornwall
a107af7568 Project config fixes 2015-08-01 01:56:34 +02:00
Fredrik Fornwall
05c80a16d7 Update gradle 2015-08-01 01:45:27 +02:00
Fredrik Fornwall
f510b39d74 Remove log spam 2015-07-31 03:10:23 +02:00
Fredrik Fornwall
9f5d2b37b7 Center toasts 2015-07-31 01:14:18 +02:00
Fredrik Fornwall
9d1a918d03 Add PhotoAPI, ShareAPI and ToastAPI 2015-07-29 04:19:45 +02:00
Fredrik Fornwall
c4ef079206 Bump version to 0.3 2015-07-26 02:26:33 +02:00
Fredrik Fornwall
1f2e562ac7 Initial push
The project was just converted from Eclipse to Android Studio, so
there may be some glitches.
2015-07-26 02:23:21 +02:00