When converting the MB value MtpReserveSpace value to bytes there is a
possible integer overflow since 3 integer values are multiplied, even
though the result is stored in a long variable. This would be visible when
the value is more than 2 GB. This is solved by making the constants
longs instead of ints.
Change-Id: I799129f7076a6e331cece17b5c05aed210499648
Many media files and source code files were marked as executable in Git.
Remove those.
Also a shell script and python script were not marked as executable.
Change-Id: Ieb51bafb46c895a21d2e83696f5a901ba752b2c5
Fixes problems with file transfer from device to host that can occur
if the database size value is wrong.
Bug: 6954446
Change-Id: I03c3dd4b75267d1f4613f0b588c8899ded9a70be
Signed-off-by: Mike Lockwood <lockwood@google.com>
According to description in frameworks/base/core/res/res/xml/storage_list.xml,
"mtpReserve: (integer) number of megabytes of storage MTP should reserve for free storage".
Mtpstorage class use it directly and doesn't change it to correct size in megabyes.
Mtp initor can not get correct storage information from android.
Change-Id: Icf59eb1eb478e67ea5990be96a9decb41aa55504
Signed-off-by: Bo Huang <bo.b.huang@intel.com>
Signed-off-by: Jack Ren<jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
- use an ID instead of a String for StorageVolume description
- use this ID for getting the correct localized version of the description string
Change-Id: I30f3080fce2c889be38bfdf9f5121dffcf8a99e8
When doing a "like" match on a path, add a second non-like constraint
so that sqlite wildcard characters don't match arbitrary other characters.
b/6501408
Change-Id: I21f9b1c2d8e7c7ef27c0ad5fe24c3e01cd67fb61
Added new API to enable cancelation of SQLite and content provider
queries by means of a CancelationSignal object. The application
creates a CancelationSignal object and passes it as an argument
to the query. The cancelation signal can then be used to cancel
the query while it is executing.
If the cancelation signal is raised before the query is executed,
then it is immediately terminated.
Change-Id: If2c76e9a7e56ea5e98768b6d4f225f0a1ca61c61
Korean characters show up as gabage characters in Music player.
Reason : MTP service does not set the locale for the MediaScanner
Solution : Set locale when MtpDatabase creates MediaScanner.
Bug ID : 5567433
Signed-off-by: dujin.cha <dujin.cha@samsung.com>
Change-Id: I4bfe5f603c113170d45bd57a8709c21c665e260b
These calls did not correctly handle some variants of the arguments,
which showed up when running in PTP mode.
Change-Id: Iedbaefebfa39111c8bcaee7c6cc3820a65d6c98f
Signed-off-by: Mike Lockwood <lockwood@android.com>
PTP mode will be implemented as a separate USB function instead.
Change-Id: I9304c1936c70604ab2ed9704c6b95e11b61f5ba2
Signed-off-by: Mike Lockwood <lockwood@android.com>
This ID is used for MTP as well as per volume querying in the media provider.
Change-Id: Ic4fc986d972bd477730643f7e9450c390c0b3a4b
Signed-off-by: Mike Lockwood <lockwood@android.com>
Applications now get the display size from the window manager. No
behavior should be changed yet, this is just prep for some real
changes.
Change-Id: I47bf8b55ecd4476c25ed6482494a7bcc5fae45d2
- MTP support for multiple storage units
- Add storage_id column to media database for MTP storage ID
- Add framework resource for defining mount points and user visible descriptions
for multiple volumes
- Clean up locking in MtpServer JNI code
Change-Id: Ide6d47bd9aa1698ed2a13d695613e03f2a9b29e3
Signed-off-by: Mike Lockwood <lockwood@android.com>
Fixes an ANR that occurred if we got a USB disconnected event
before the MTP service had started.
Bug: 4118033
Change-Id: I6cad4281a5911a9926cae923f34d3a6bf98346c5
Signed-off-by: Mike Lockwood <lockwood@android.com>
After reviewing this class I decided it would be best not to include it in the public API
since it adds no functionality that cannot be done using MtpDevice and other APIs directly.
So I am moving it to the CameraBrowser sample instead.
Also changed CameraBrowser to build against the SDK to ensure all the necessary APIs for
PTP support have been made public.
Bug: 4067029
Change-Id: I585b06104084953176d018ced08bba0cb4607490
Signed-off-by: Mike Lockwood <lockwood@android.com>
UsbDevice is now just an immutable parcelable object like UsbInterface and
UsbEndpoint.
All IO related functionality is now contained in UsbDeviceConnection
and UsbRequest.
Bug: 4067029
Change-Id: Ia84da0b512a697acc940eee0c3566711c62e1a68
Signed-off-by: Mike Lockwood <lockwood@android.com>
New APIs:
UsbManager.hasPermission returns true if the caller has permission
for the given device or accessory
UsbManager.requestPermission poses a dialog to allow the user to give the caller
permission for the device or accessory.
Result is returned via a PendingIntent.
No dialog is displayed if the caller already has permission.
Also moved UsbResolverActivity to SystemUI package
BUG: 4069037
Change-Id: I93be769501a8776b49ac26e468af19f8fa2114c9
sqlite3 is overkill for what we are doing here, and more fragile.
BUG: 3512856
Change-Id: I83d86127949d894a3887db3456d91b013060e852
Signed-off-by: Mike Lockwood <lockwood@android.com>
These extras are also accessable via the UsbDevice and UsbAccessory classes,
which are also included as extras.
Since you can't filter Intents based on extras there is no point in duplicating
this information as separate extras.
Change-Id: I4c8d1e70d66023a1800b3f8f06118898da6b37af
Signed-off-by: Mike Lockwood <lockwood@android.com>
Note: dependent on external/flac for libFLAC
Implemented and tested:
* FLAC container
* mono and stereo
* standard sample rates
* standard bit depths
* sniffer
* media scanner
* Vorbis comment metadata including album art
* random access seeking with "torture test"
* web browser integration for audio/flac (not audio/x-flac), but
note that most web servers don't correctly report the MIME type
Not implemented:
* 24-bit to 16-bit dither or noise shaping in AudioFlinger
* 96 kHz to 44.1 or 48 kHz downsampling low pass filter in AudioFlinger
* replay gain is better done in AudioFlinger
* multi-channel, would need AudioFlinger support
* Ogg container, does not seem to be very popular yet
Change-Id: I300873e8c0cfc2e95403d9adb5064d16a2923f17
Make sure previous MtpThread has exited before starting another to avoid
EBUSY opening MTP kernel driver.
BUG: 3317803
Change-Id: I81dcbac42bcf5f680ed1b1469839bc0b0e49d53d
Signed-off-by: Mike Lockwood <lockwood@android.com>
This replaces the previous ContentProvider based interface
Change-Id: I4cea2544854adb9fdcc04345e4d73d8ef05380f3
Signed-off-by: Mike Lockwood <lockwood@android.com>