History log of /frameworks/base/media/java/android/mtp/MtpDatabase.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
13bb2f4ddadcfee8e82a0eea3cb76a2448bb2ccb 15-Dec-2016 Jerry Zhang <zhangjerry@google.com> Add support for MTP perceived device type property.

Property value is based on the particular device.
This allows some hosts (windows) to apply a device
specific icon in file explorer.

Test: Connect device to windows, verify new icon
Bug: 25360563
Change-Id: I9d3468ca8c01a6f0d42ad543aef11ed265b6c825
/frameworks/base/media/java/android/mtp/MtpDatabase.java
486ad2e73c1c24c0585d414b18bd623c54ac1547 29-Feb-2016 Daichi Hirono <hirono@google.com> Fix argument type in MtpDatabase#getObjectPropertyValue.

In MTP code, we use jint for ID (e.g. object handle) and code (property
code). But getObjectPropertyValue takes jlong and it causes missing
property values in Java code. Previously we passed the long value to
Map<Integer, MtpPropertyGroup>#get(Integer) and the compiler somehow
accepted the code. However it actually takes Long at runtime, so the
properties are never found.

BUG=26437284
Change-Id: I79defd325ea5d20c4dce84d891d984e24abcacc5
/frameworks/base/media/java/android/mtp/MtpDatabase.java
5a8b9627c7fdacc94791fb3024386739f8cf9a56 18-Dec-2015 Jaesung Chung <jaesung@google.com> Extend MediaScanner and MtpDatabase to support RAW image files

Bug: 25871812
Change-Id: Iee92632585dc9020238a9b562defd06d6d2a91dc
/frameworks/base/media/java/android/mtp/MtpDatabase.java
60cfad80bdf61db436643927337c2fb30186e99d 06-Jan-2016 Jeff Sharkey <jsharkey@android.com> Discourage use of "_data" column.

Moving forward, all client file access really needs to be going
through explicit APIs like openFileDescriptor(), since that allows
the provider to better protect its underlying files.

This change also changes several classes to use the AutoClosable
pattern, which enables try-with-resources usage. Older release()
methods are deprecated in favor of close().

Uniformly apply CloseGuard across several classes, using
AtomicBoolean to avoid double-freeing, and fix several resource
leaks and bugs related to MediaScanner allocation. Switch
MediaScanner and friends to use public API instead of raw AIDL calls.

Bug: 22958127
Change-Id: Id722379f72c9e4b80d8b72550d7ce90e5e2bc786
/frameworks/base/media/java/android/mtp/MtpDatabase.java
08c7116ab9cd04ad6dd3c04aa1017237e7f409ac 28-Feb-2015 John Spurlock <jspurlock@google.com> Remove unused imports in frameworks/base.

Change-Id: I031443de83f93eb57a98863001826671b18f3b17
/frameworks/base/media/java/android/mtp/MtpDatabase.java
71827748105252791854b87da8e0e0c66ff0d2cb 23-Jan-2015 Mike Lockwood <lockwood@google.com> MTP: Fix partial implementation of 5 new audio specific properties

In change Ic5b3fb75309893caae1a4f4b56068a543847f1f7, we added partial
support for the MTP properties:

MTP_PROPERTY_AUDIO_WAVE_CODE,
MTP_PROPERTY_BITRATE_TYPE
MTP_PROPERTY_AUDIO_BITRATE
MTP_PROPERTY_NUMBER_OF_CHANNELS
MTP_PROPERTY_SAMPLE_RATE

However we were not returning any values for these properties in the result
of the MTP GetObjectPropList command. Strangely, this triggers a nasty bug
in Windows 7 that results in data loss. When copying a directory containing
several MP3 files from one location on the device to another, Windows will
copy only some of the files to the new location, but delete all of the originals.
Finishing the implementation of these new object properties for some unknown
reason stops this bad behavior in Windows 7.

Bug: 19018427
Change-Id: I5fd3b91a89b31827d3100686445cef6795fe0f3f
/frameworks/base/media/java/android/mtp/MtpDatabase.java
c1fda12823bfac1c2180beddc3f733ea0311b37d 15-Oct-2014 Marco Nelissen <marcone@google.com> Also consider secondary storage when verifying paths

Bug: 17673184
Bug: 17982103
Change-Id: Ief14c7776b02983191c46774fa7e4c76380de58d
/frameworks/base/media/java/android/mtp/MtpDatabase.java
5f411696a62b7f0fb95ba3519aa127c09f155eed 27-Sep-2014 Marco Nelissen <marcone@google.com> Validate MTP path

Bug: 17673184
Change-Id: I51a64f065d9b3609557af81e596ebeb8720ab6c5
/frameworks/base/media/java/android/mtp/MtpDatabase.java
1632fae376eb460cf992e543b13c8690b71fe8d5 27-Mar-2014 Marco Nelissen <marcone@google.com> Make setServer() safe to call multiple times

This makes it safe to call setServer() multiple times with the same
server, different servers, or null.

b/13622801

Change-Id: Id04440df720f830e67106eb543653ace42430d97
/frameworks/base/media/java/android/mtp/MtpDatabase.java
92b53bc2dd42a3c1d2d7708145099da2a5fe541e 13-Mar-2014 Mike Lockwood <lockwood@google.com> MTP: Add support for some audio specific object properties

This stops Windows 7 from putting up the
"Your device might not be able to play or view this file" dialog
when copying MP3 files to the device.

Bug: 3195286
Change-Id: Ic5b3fb75309893caae1a4f4b56068a543847f1f7
/frameworks/base/media/java/android/mtp/MtpDatabase.java
56c85244b9be0fc6f6c2baf5f9a53f2364d5ec5e 07-Mar-2014 Mike Lockwood <lockwood@google.com> MTP: Add support for battery level device property

Bug: 7342482

Change-Id: I810e55fe9695e2206816f57334ad14f65e9c641d
/frameworks/base/media/java/android/mtp/MtpDatabase.java
c975437ef3338ba38b76b1a07594ccfd6e089709 07-Jan-2014 Narayan Kamath <narayan@google.com> am 1e3395c7: am 105b545e: am 0dce19ca: am 79ceb53a: am c58abeea: Merge "AArch64: Use long for pointers in MTP classes"

* commit '1e3395c7378a7dd293a2e8a8ac8fbf239adbad0c':
AArch64: Use long for pointers in MTP classes
e2e59326f13cf291bf5b37989390fd2a55a94f0c 17-Dec-2013 Ashok Bhat <ashok.bhat@arm.com> AArch64: Use long for pointers in MTP classes

For storing pointers, long is used in MTP classes,
as native pointers can be 64-bit.

In addition, some minor changes have been done
to conform with standard JNI practice (e.g. use
of jint instead of int in JNI function prototypes)

Change-Id: I67805547251722e7b77611d47d0bb632a64d3e6d
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
/frameworks/base/media/java/android/mtp/MtpDatabase.java
6090995951c6e2e4dcf38102f01793f8a94166e1 19-Nov-2013 John Spurlock <jspurlock@google.com> Remove unused imports from frameworks/base.

Change-Id: Ia1f99bd2c1105b0b0f70aa614f1f4a67b2840906
/frameworks/base/media/java/android/mtp/MtpDatabase.java
e8acd367acb82bd80deed31467adcdd9ab83248b 07-Aug-2013 Marco Nelissen <marcone@google.com> Merge "When deleting a db file, Context.deleteDatabase() has to be called instead of File.delete() to guarantee all db related files like journal, wal, shm, etc are deleted together."
3ed02535fdc3c752346c40b57962905b7072e693 22-Jul-2013 jangwon.lee <jangwon.lee@lge.com> When deleting a db file,
Context.deleteDatabase() has to be called instead of File.delete()
to guarantee all db related files
like journal, wal, shm, etc are deleted together.

Signed-off-by: jangwon.lee<jangwon.lee@lge.com>

Change-Id: I3c3d7dfa13ffbe709ab7d8a5c7cfe6cfa2864fea
/frameworks/base/media/java/android/mtp/MtpDatabase.java
1341f1eee3493fc5e263494acb8adebb6f0180b6 01-Apr-2013 Mike Lockwood <lockwood@google.com> MTP: Implement date created field in GetObjectInfo

Bug: 8293874

Change-Id: I3e50ea1049f63e2ed3a1f849fef74a2fbf206fe8
/frameworks/base/media/java/android/mtp/MtpDatabase.java
35654b61e8fe7bc85afcb076ddbb590d51c5865f 15-Jan-2013 Dianne Hackborn <hackbod@google.com> More work on App Ops service.

Implemented reading and writing state to retain information
across boots, API to retrieve state from it, improved location
manager interaction to monitor both coarse and fine access
and only note operations when location data is being delivered
back to app (not when it is just registering to get the data at
some time in the future).

Also implement tracking of read/write ops on contacts and the
call log. This involved tweaking the content provider protocol
to pass over the name of the calling package, and some
infrastructure in the ContentProvider transport to note incoming
calls with the app ops service. The contacts provider and call
log provider turn this on for themselves.

This also implements some of the mechanics of being able to ignore
incoming provider calls... all that is left are some new APIs for
the real content provider implementation to be involved with
providing the correct behavior for query() (return an empty
cursor with the right columns) and insert() (need to figure out
what URI to return).

Change-Id: I36ebbcd63dee58264a480f3d3786891ca7cbdb4c
/frameworks/base/media/java/android/mtp/MtpDatabase.java
58ed5d748c0b9b64845975ef5844ad313de7c3f6 07-Nov-2012 Kenny Root <kroot@google.com> am 768d9e1a: Merge "Correct executable bit for source files"

* commit '768d9e1a72ceee7d4a5f608776b87b62d6ce4a04':
Correct executable bit for source files
3a084af2e90849aaa8beb3a610189e3399c63ea0 07-Nov-2012 Kenny Root <kroot@google.com> Correct executable bit for source files

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
/frameworks/base/media/java/android/mtp/MtpDatabase.java
465d72073c6d47a27b51d384bd9e019faa7957c1 18-Sep-2012 Mike Lockwood <lockwood@google.com> am ad23333f: am 945080b5: am 1e86994c: Merge "MtpData bmp format file can\'t recognize when copy bmp into DUT"

* commit 'ad23333f728471a7f2c49cd1c9575f1cea2503f6':
MtpData bmp format file can't recognize when copy bmp into DUT
f6f16614574767263fcd0073f72c099edaca0607 13-Sep-2012 Mike Lockwood <lockwood@google.com> MtpDatabase: Use actual file size instead of media database size column

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>
/frameworks/base/media/java/android/mtp/MtpDatabase.java
58e6831ccb54b33a914115e88ebb67e720615fb8 11-Sep-2012 Mike Lockwood <lockwood@google.com> MtpDatabase: Fix typo affecting parent and format queries

Bug: 7114350

Change-Id: I80269cfcebf521ea13cae30c1c9bd477d76adbd1
Signed-off-by: Mike Lockwood <lockwood@google.com>
/frameworks/base/media/java/android/mtp/MtpDatabase.java
240582eabee56d55751b85e220811d48fabe839a 27-Feb-2012 bo huang <bo.b.huang@intel.com> MtpData bmp format file can't recognize when copy bmp into DUT

add support for bmp format.

Change-Id: I67d4703b43cd32abad638bae57bbceb65b4be6de
Author: bo huang <bo.b.huang@intel.com>
Signed-off-by: bo huang <bo.b.huang@intel.com>
Signed-off-by: Wu, Hao <hao.wu@intel.com>
Singed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 24555
/frameworks/base/media/java/android/mtp/MtpDatabase.java
1e855d98aa979b30cee9e096cf6a1cb54df0367b 27-Jun-2012 Mike Lockwood <lockwood@google.com> MtpDatabase: Fix sqlite3 pattern matching for MTP directory deletes

Bug: 6684451

Change-Id: I90204550ccfcd1b7a5b1973bed2a88e934aae053
Signed-off-by: Mike Lockwood <lockwood@google.com>
/frameworks/base/media/java/android/mtp/MtpDatabase.java
b4b847866fbee31ba146ba7ebca2d2346a3a0b8f 23-May-2012 Marco Nelissen <marcone@google.com> Handle _ and % in paths

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
/frameworks/base/media/java/android/mtp/MtpDatabase.java
f3a3b9ec9ce6cb087dd3f4358684c00be23feec1 30-Jan-2012 Marco Nelissen <marcone@google.com> Merge "Handle adding/removing/renaming nomedia paths"
75ea64fc54f328d37b115cfb1ded1e45c30380ed 26-Jan-2012 Jeff Brown <jeffbrown@google.com> 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
/frameworks/base/media/java/android/mtp/MtpDatabase.java
ca78f3d9aff78c35bc065b0c35a0b3c917f56435 27-Jan-2012 Marco Nelissen <marcone@google.com> Handle adding/removing/renaming nomedia paths

b/5849015
Change-Id: I3ec7419498d1ecc83db6d4605b3d7610349231f7
/frameworks/base/media/java/android/mtp/MtpDatabase.java
73e56d935e7c9b8a06e4781c4995e407e118f93d 01-Dec-2011 Mike Lockwood <lockwood@google.com> 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>
/frameworks/base/media/java/android/mtp/MtpDatabase.java
fe464a76d8fc858be971dbb5e67b1d22fd925347 21-Nov-2011 dujin.cha <dujin.cha@samsung.com> [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
/frameworks/base/media/java/android/mtp/MtpDatabase.java
6acc90fc216530f0a5bbf7339066af9b415cbb02 17-Jun-2011 Mike Lockwood <lockwood@android.com> 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>
/frameworks/base/media/java/android/mtp/MtpDatabase.java
44bc17c6b517aef35a390c81b5aa79c4f284f744 21-Apr-2011 Dianne Hackborn <hackbod@google.com> 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: I2958a6660895c1cba2b670509600014e55ee9273
/frameworks/base/media/java/android/mtp/MtpDatabase.java
b239b683765f63d79e74b8ba2a8cc2855f236536 05-Apr-2011 Mike Lockwood <lockwood@android.com> 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: Iffb66ed156ef5bc80b14228af78fbacee7734360
/frameworks/base/media/java/android/mtp/MtpDatabase.java
775de951a8d4f4fe58c849efd9ef7b92c4ade907 05-Mar-2011 Mike Lockwood <lockwood@android.com> 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>
/frameworks/base/media/java/android/mtp/MtpDatabase.java
f9f223edb408cdc9fd946dc099a86857079a639f 13-Jan-2011 Glenn Kasten <gkasten@google.com> 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
/frameworks/base/media/java/android/mtp/MtpDatabase.java
f26a586c86b097f975e26fe526ead564ad011bd0 22-Jan-2011 Mike Lockwood <lockwood@android.com> Remove MTP related log spam

Change-Id: I9de1792cbeec07fa5ab42ff9a10813f0c3d30fc1
Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/media/java/android/mtp/MtpDatabase.java
8ed67acf38ccdfdb89553ed58620a135f2100e10 18-Jan-2011 Mike Lockwood <lockwood@android.com> MTP: Set modification date for abstract playlists

BUG: 3224269

Change-Id: I96ae8e6d2f7e28860e9217ceb911331b333e1391
Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/media/java/android/mtp/MtpDatabase.java
8cc6eb1e4c708fb4398292ba30aa80ad5770d7ce 18-Jan-2011 Mike Lockwood <lockwood@android.com> MTP: Strip ".pla" file extension from name field for WMP playlists

BUG: 3309324

Change-Id: Ia136f94406496f971819f4f805f742f2a6829007
Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/media/java/android/mtp/MtpDatabase.java
7a0bd17bceaf3efc3732e30c538fae420d3b742c 18-Jan-2011 Mike Lockwood <lockwood@android.com> 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>
/frameworks/base/media/java/android/mtp/MtpDatabase.java
1c4e88d0b0a8deede0415183739478b5ebc12bfd 12-Jan-2011 Mike Lockwood <lockwood@android.com> 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>
/frameworks/base/media/java/android/mtp/MtpDatabase.java
0cd0136d440cf6ad9d5fab430269116786e671ec 30-Dec-2010 Mike Lockwood <lockwood@android.com> Move MTP Java classes to android.mtp.* package.

Change-Id: Ib18bcaabf314241a95e517d0b93be5845d988e2c
Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/media/java/android/mtp/MtpDatabase.java