Recently in I830717428e72ac37c5ecd1f23d915aa878ef3744, we greatly improved the underlying file-extension-to-MIME-type mappings defined in libcore and used across the OS. Instead of maintaining divergent mappings here in MediaFile, this change delegates all file extension logic down to libcore, and standardizes all MediaScanner internals on using MIME types. To register new file types in the future: 1. Add the MIME-to-extension registration in libcore. 2. Add the MIME-to-MTP mapping here in MediaFile. This change also ensures that unknown MIME types are surfaced across MTP, using constants like FORMAT_UNDEFINED_AUDIO for audio/* until an explicit format is defined. We now surface WMA/WMV file formats, even if the device can't natively play them back, since we still want to offer the ability for users to copy them around, and the user may have a third-party app capable of playing them. Keeps @UnsupportedAppUsage intact for now. Bug: 111268862, 112162449 Test: atest frameworks/base/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaFileTest.java Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore* Change-Id: I2f6a5411bc215f776f00e0f9a4b7d825b10b377d
28 lines
1.2 KiB
XML
28 lines
1.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- Copyright (C) 2018 The Android Open Source Project
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
-->
|
|
<configuration description="Runs Media Framework Tests">
|
|
<target_preparer class="com.android.tradefed.targetprep.TestAppInstallSetup">
|
|
<option name="test-file-name" value="mediaframeworktest.apk" />
|
|
</target_preparer>
|
|
|
|
<option name="test-tag" value="MediaFrameworkTest" />
|
|
<test class="com.android.tradefed.testtype.AndroidJUnitTest" >
|
|
<option name="package" value="com.android.mediaframeworktest" />
|
|
<option name="runner" value="android.support.test.runner.AndroidJUnitRunner" />
|
|
<option name="hidden-api-checks" value="false"/>
|
|
</test>
|
|
</configuration>
|