This opens the door to the same consistent logic being shared by
anyone across the OS who wants to enforce storage permissions.
Bug: 126788266
Test: atest --test-mapping packages/apps/MediaProvider
Exempted-From-Owner-Approval: Trivial permissions refactoring
Change-Id: I3107425f8dafa6ba05918bb67c3c0cb5d3899657
We're now enforcing the public API schema, so clients like MTP need
to query specific collections when asking for properties that are
specific to those media types.
Also refactor MediaScanner calls to go through MediaProvider, so
they can be handled by ModernMediaScanner. We no longer directly
try inserting items, and instead rely completely on the scanner.
Bug: 127625964, 122263824
Test: atest MediaProviderTests
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Change-Id: Ic86982766606a619afafe725f9c60013a5671840
The platform media scanner has served faithfully for many years, but
it's become tedious to test and maintain, mainly due to the way it
weaves obscurely between managed and native code.
Bug: 128243527
Test: none
Change-Id: I44c5e9840acc0afde4aeaf9a44a21e0f8939b44b
AudioAttributes can influence offload support, add them in
method to check for support
Bug: 86837964
Test: cts-tradefed run cts -m CtsMediaTestCases -t android.media.cts.AudioTrackOffloadTest#testAudioTrackOffload
Change-Id: If4037d0611ec1264d23d1779b9ac6efd9fd1244c
(Note there is no @TestApi for @SystemApi, so rely
on javadoc to document that the new method is
for testing purposes only)
Add method to flag a focus policy as a test policy for
devices that run their own focus policy to customize
audio focus management. When a test policy is installed
it will replace the current one, and will restore it
when it is unregistered.
Add nullability annotations in Builder.
Bug: 123717363
Test: make system-api-stubs-docs-update-current-api
Test: gts-tradefed run gts --skip-device-info --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -m GtsGmscoreHostTestCases -t 'com.google.android.gts.audiopolicy.AudioPolicyHostTest#testFocusPolicy'
Change-Id: I572487bb53f85aade22da8529db9491a542ef0db
As requested by the API concil.
Test: atest android.media.cts.AudioPlaybackCaptureTest
Bug: 128454287
Change-Id: I205fe03d1d23d67ecf3e4590b62bde24f56e4e83
Signed-off-by: Kevin Rocard <krocard@google.com>
That would lead to NullPointerException as some fields of
AudioMixMatchCriterion are null in some type but not others.
When first registering a UID rule, the register criterion had a null
mAttr. If a USAGE criterion was then added, it would be compared to the
exsting rule as if it was an USAGE rule. As mAttr was null, a
NullPointerException was thrown.
Test: first register a UID rule, then a USAGE rule.
Test: atest android.media.cts.AudioPlaybackCaptureTest#testCaptureMediaUsage
Bug: 111453086
Change-Id: Iece913b87a627171c0a1f872aa57c5125d0ba782
Signed-off-by: Kevin Rocard <krocard@google.com>
The query will go to AudioService in case the app itself does not have
the permission to access the files.
Test: test with files (not) containing haptic channels.
Bug: 128012181
Change-Id: I0a3410161e9718197276dc9d6abecada81cf0ee4
The API too closely resembled the underlying system API, in forcing the
client to construct a full AudioAttribute when only the usage was
useful.
Test: atest android.media.cts.AudioPlaybackCaptureTest#testCaptureMediaUsage
Bug: 111453086
Change-Id: Ic3944120ab4d5dc7b85e5baf7718a39a171a4333
Signed-off-by: Kevin Rocard <krocard@google.com>
New intent action ACTION_SPEAKERPHONE_STATE_CHANGED to indicate
speakerphone state changed.
Bug: 74541410
Test: m -j ; make -j api-stubs-docs-update-current-api ; m -j ; atest android.media.cts.AudioManagerTest#testSpeakerphoneIntent
Change-Id: I01963493001e31b1edf1f1ba85b5744eb924d887