45 Commits

Author SHA1 Message Date
Marco Nelissen
f3a3b9ec9c Merge "Handle adding/removing/renaming nomedia paths" 2012-01-30 08:27:57 -08:00
Jeff Brown
75ea64fc54 Implement a cancelation mechanism for queries.
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
2012-01-27 17:33:21 -08:00
Marco Nelissen
ca78f3d9af Handle adding/removing/renaming nomedia paths
b/5849015
Change-Id: I3ec7419498d1ecc83db6d4605b3d7610349231f7
2012-01-27 15:10:14 -08:00
Mike Lockwood
73e56d935e MTP: Add support for restricting PTP to only certain subdirectories of the storage
Bug: 5527220

Change-Id: If68e7481617ecb62abd24e2d89e6b7dfdf95ba2b
Signed-off-by: Mike Lockwood <lockwood@google.com>
2011-12-02 11:08:39 -05:00
dujin.cha
fe464a76d8 [Prime K] Fix gabage character issue
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
2011-11-22 10:28:21 -08:00
Mike Lockwood
dcc31946f2 MTP: Clean up MtpServer initialization and threading:
Move thread from native to Java code
Remove the stop() method (the thread will exit on its own)

Change-Id: Ib897c3630162f82669a4ee8c187e8172da50b29d
2011-07-13 09:44:42 -04:00
Mike Lockwood
7a59dd2ce3 MTP: Return error if user tries to copy a file >= 4GB to a FAT32 file system
Bug: 4561836

Change-Id: I2bffb93b032038f6c220c24c752ccd7ca66c23a0
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-07-11 13:40:02 -04:00
Mike Lockwood
7d40d42a36 MTP: Add support for PTP variant of GetDeviceInfo result.
Change-Id: I09f86fda768b7697665e401adb9516588859bf59
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-21 08:27:06 -04:00
Mike Lockwood
6acc90fc21 MTP: Fix some problems with GetObjectHandles and GetNumObjects commands
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>
2011-06-17 19:49:05 -04:00
Mike Lockwood
aa48835ce9 MTP: Remove obsolete setPtpMode support
PTP mode will be implemented as a separate USB function instead.

Change-Id: I9304c1936c70604ab2ed9704c6b95e11b61f5ba2
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-08 09:19:23 -07:00
Mike Lockwood
fbfe555125 StorageVolume: Add getStorageId() accessor
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>
2011-05-17 17:19:37 -04:00
Dianne Hackborn
1e662c3294 Merge "DO NOT MERGE. Integrate from master: Rework display size access." into honeycomb-mr2 2011-05-16 12:54:22 -07:00
Dianne Hackborn
ac8dea12c1 DO NOT MERGE. Integrate from master: Rework display size access.
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
2011-05-16 11:58:27 -07:00
Mike Lockwood
51690544aa MTP: Have GetStorageInfo command return correct storage type for removable storage
Change-Id: I09b548483c12080e7d77970babcae2eef379f2f4
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-05-16 14:29:45 -04:00
The Android Automerger
158e3582c0 Merge remote branch 'goog/honeycomb-mr1' into honeycomb-mr2 2011-05-08 22:11:52 -07:00
Scott Main
0cdd9f7def docs: add package description for mtp and a little more info to MtpDevice
Change-Id: I44b3926c4a286f624de525a7f0cc896879582bf5
2011-05-05 15:53:44 -07:00
Mike Lockwood
7ae938be1b DO NOT MERGE MTP and media provider support for multiple storage devices:
- 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>
2011-05-03 21:03:56 -04:00
Mike Lockwood
11dd5ae97b Improve Javadoc for USB Manager and MTP/PTP support.
Bug: 4091519

Change-Id: Ida79593d5a984f7ffd0934ae7bded23b8faf9eef
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-04-01 14:11:50 -04:00
Mike Lockwood
a3f8514492 MtpServer: Do not attempt to stop MTP if it has not been started
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>
2011-03-17 09:43:50 -04:00
Mike Lockwood
62cfeeb821 USB: minor cleanup work
Bug: 4067029

Change-Id: Icd8f912ab8732b5f770a217b9b3731092597ce02
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-03-11 18:51:29 -05:00
Mike Lockwood
c72eb9113a Remove MtpClient class from framework and public API
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>
2011-03-11 10:55:44 -05:00
Mike Lockwood
acc29cc91b UsbDevice: Move IO related methods to new UsbDeviceConnection class
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>
2011-03-11 10:24:21 -05:00
Mike Lockwood
3a68b8338b USB: Add API and dialog for apps to request permissions for USB devices and accessories
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
2011-03-08 21:22:19 -05:00
Mike Lockwood
823f5bf3db Merge "MTP: Use SharedPreferences for MTP device properties rather than sqlite3" into honeycomb-mr1 2011-03-07 20:04:23 -08:00
Mike Lockwood
2b8a1ee057 MtpClient: Fix problem with getDeviceList() returning empty result in some cases
BUG: 3503128

Change-Id: I2263437d6018848e316ae4096eb07305fc4dc486
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-03-07 14:19:06 -05:00
Mike Lockwood
775de951a8 MTP: Use SharedPreferences for MTP device properties rather than sqlite3
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>
2011-03-05 17:34:11 -05:00
Mike Lockwood
1bdeef34ef MtpClient: remove finalize override to avoid multiple calls to unregisterReceiver
BUG: 3497801

Change-Id: I4ed0166efcc509a18361287c5816bc4844089025
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-03-02 16:59:53 -08:00
Mike Lockwood
c4308f01c9 Move USB framework support from android.hardware to android.hardware.usb package
Change-Id: I00fd4f0caaa4aebe48f71c576bb211b5f38bf88d
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-03-01 08:07:20 -08:00
Mike Lockwood
188d00b07e UsbManager: Remove redundant Intent extras from USB device and accessory broadcasts
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>
2011-02-23 13:14:33 -08:00
Mike Lockwood
66e57f6aa9 MTP: Disable MTP when the keyguard is locked and secure
BUG:  3402847

Change-Id: I6c77efe18f525cd0af37911c8b6aac4f17352552
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-02-22 13:57:23 -08:00
Mike Lockwood
540380fb0a Add MTP/PTP host support to the public API
Needed for unbundling the Gallery app

Change-Id: I57e6b76ee5c9e57cb8c055329ac13251879baafd
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-02-11 09:09:11 -05:00
Mike Lockwood
fd22edc668 MTP: Fix NPE in MtpPropertyGroup
Change-Id: I65fbd3f2f62724434136c6ae310e6647884902d2
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-02-08 21:45:22 -05:00
Mike Lockwood
4356d81b34 MTP: Add support for querying all objects in GetObjectPropList
Change-Id: I1f31971c4c777462f485e52fac016dc0fff48ad9
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-02-07 13:58:08 -05:00
Glenn Kasten
f9f223edb4 Bug 1804058 FLAC extractor
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
2011-02-03 13:39:10 -08:00
Mike Lockwood
501e52f09d am 7fadb5e7: am 2b3da7ab: Merge "MTP: Fix race conditions in MtpServer JNI code" into honeycomb
* commit '7fadb5e77fd079c3a6c5eeae1ae81a487864b129':
  MTP: Fix race conditions in MtpServer JNI code
2011-01-25 16:20:50 -08:00
Mike Lockwood
071b2b6739 MTP: Fix race conditions in MtpServer JNI code
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>
2011-01-25 15:10:31 -08:00
Mike Lockwood
47063a859a Merge "New APIs for MTP and PTP host support" 2011-01-22 15:59:28 -08:00
Mike Lockwood
8182e72479 New APIs for MTP and PTP host support
This replaces the previous ContentProvider based interface

Change-Id: I4cea2544854adb9fdcc04345e4d73d8ef05380f3
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-01-22 15:56:09 -08:00
Mike Lockwood
f26a586c86 Remove MTP related log spam
Change-Id: I9de1792cbeec07fa5ab42ff9a10813f0c3d30fc1
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-01-21 21:00:54 -08:00
Mike Lockwood
8ed67acf38 MTP: Set modification date for abstract playlists
BUG: 3224269

Change-Id: I96ae8e6d2f7e28860e9217ceb911331b333e1391
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-01-18 13:27:25 -08:00
Mike Lockwood
8cc6eb1e4c MTP: Strip ".pla" file extension from name field for WMP playlists
BUG: 3309324

Change-Id: Ia136f94406496f971819f4f805f742f2a6829007
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-01-18 13:13:05 -08:00
Mike Lockwood
7a0bd17bce MTP: Fix problems with modification dates for folders and non-media files
Also removed an unnecessary parameter to MtpDatabase.endSendobject()

BUG: 3352142

Change-Id: I6fd812dcba4814956bc8bc1cbd6bd5c868197790
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-01-18 11:07:11 -08:00
Mike Lockwood
1c4e88d0b0 Media Provider and MTP now use emulated /mnt/sdcard instead of /data/media
This rips out some complicated code that was added since gingerbread
that is no longer necessary.

Change-Id: Iab5ecb7314c06221475ce01ef483f34f17003b06
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-01-12 12:48:13 -05:00
Mike Lockwood
27480cd494 Remove support for obsolete PTP content provider
This will be replaced by a new PTP host API in an upcoming commit.

Change-Id: Ib914194e332b5c090cb8e34ed35bd691bc9f85d1
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-01-06 11:47:56 -05:00
Mike Lockwood
0cd0136d44 Move MTP Java classes to android.mtp.* package.
Change-Id: Ib18bcaabf314241a95e517d0b93be5845d988e2c
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-12-30 11:54:33 -05:00