12343 Commits

Author SHA1 Message Date
Eric Laurent
3ee7b6ca84 Add field to set A2DP device volume on connect (1/2)
Add a field to setBluetoothA2dpDeviceConnectionStateInt() to allow
Bluetooth to set a volume for the new device when it connects.

Bug: 79529581
Test: Switch repeatedly between devices and see that the old volume isn't
used on the new device or the new volume isn't used on the old device.
Change-Id: Iea13ca8b5c538c999149baba6e9069745ad9466b
Merged-In: I909fa3f40818c595fc977695fbfa1214f9a4de72

(cherry picked from commit 3e6fb6309033c50081c0789b5905d5cd539b38f6)
2018-06-07 22:32:24 +00:00
Treehugger Robot
c55e1b6f4d Merge "com.android.mediadrm.signer is built with java_sdk_library" 2018-06-07 11:27:25 +00:00
Treehugger Robot
bd83ac0ecc Merge "com.android.media.tv.remoteprovider is built with java_sdk_library" 2018-06-04 04:54:27 +00:00
Sundong Ahn
63bdde81a3 com.android.mediadrm.signer is built with java_sdk_library
The com.android.mediadrm.signer is built with java_sdk_library
and api files are added by running "make update-api".
The com.android.mediadrm.signer is removed in platform.xml
since it will be made auto generation by soong when the library is
built with java_sdk_library.

Bug:77577799
Test: make -j
Test: make checkapi

Merged-In: I0e773615abe6aa8d757e489de2b9d807cd356146
Change-Id: I0e773615abe6aa8d757e489de2b9d807cd356146
(cherry picked from commit 2e1089bae43fe327346c531fcbdd4cc5d1664b14)
2018-06-04 10:23:52 +09:00
Sundong Ahn
d138adfdf6 com.android.media.tv.remoteprovider is built with java_sdk_library
The com.android.media.tv.remoteprovider is built with java_sdk_library
and api files are added by running "make update-api".
The com.android.media.tv.remoteprovider is removed in platform.xml
since it will be made auto generation by soong when the library is
built with java_sdk_library.

Bug:77577799
Test: make -j
      make checkapi

Change-Id: If0f33bbdde42d891471cd7d3d295d433a88affec
2018-05-24 16:17:03 +09:00
Daisuke Teranishi
ce4d67b6d0 Use correct filename when adding to ringtone
If the title of the music file includes "/", it's recognized
as a directory separator.
Use correct filename to select the file properly.

Bug: 80202253
Test: Add mp3 which title includes "/" to ringtone

Change-Id: I9bb05f6fe2d7d4dbbdf4f67db7ac6fde04707979
2018-05-24 11:39:33 +09:00
Dan Willemsen
4888b1f6f0 Convert to Soong
See build/soong/README.md for more information.

Test: m libframeworks_coretests_jni
Test: m FrameworkCoreTests_install
Test: m libshim_jni
Test: m CtsShimPrivUpgrade
Test: m libfilterfw
Test: m PMTest_Java_dual
Test: m libdefcontainer_jni
Test: m libperftestscore_jni
Test: m libpmtest32 libpmtest64
Test: m libprintspooler_jni
Test: m libsmartcamera_jni
Test: m idmap
Test: m libdrmframework_jni
Test: m libdvr_loader com.google.vr.platform com.google.vr.platform.xml
Test: m libfilterpack_imageproc libfilterpack_base
Test: m libwebviewchromium_loader
Test: m shared_mem_test
Test: m test-touchlag
Change-Id: I868561dd237fa28647896d59049ab9260373ada1
2018-05-14 16:47:02 -07:00
Colin Cross
3478ddce8f Fix errors caught by aapt2
Fixes:
frameworks/base/media/tests/NativeMidiDemo/AndroidManifest.xml:11: error: unknown element <uses-feature> found.

Bug: 79481102
Test: m java FORCE_AAPT2=true
Change-Id: Ife9b7c9eb97adfd6525912776f16cb27b5d22677
Merged-In: I7bb02b8926d01090132ce873c785b5323a9fa5f8
2018-05-10 22:16:35 -07:00
Jack He
896e129f5f Bluetooth: Fix HFP SCO logic and documentation
AudioService:
* Call setBtScoActiveDevice and setBluetoothScoOn both in AudioService's
  broadcast receiver so that these two methods must be triggerred in
  the same sequence as ACTIVE_DEVICE_CHANGED and AUDIO_STATE_CHANGED
  intents are sent and we no longer need to handle race condition by
  synchronously checking active device in setBluetoothScoOn
* Default sco audio mode when no headset is active should be virtual
  voice call, as many HFP devices do not accept SCO audio without an
  ongoing call
* Synchronize checkScoAudioState() method with mScoClients
* Add helper functions connectBluetoothScoHelper and
  disconnectBluetoothScoHelper to call various SCO setup and tear down
  methods based on sco audio mode
* Try raw, virtual call, and voice recognition mode when disconnecting
  externally started SCO
* Add new sco state SCO_STATE_DEACTIVATING to allow back to back calling
  of startBluetoothSco and stopBluetoothSco

Audio Manager:
* Modified AudioManager logic so that removed devices callback is called
  before newly added devices

BluetoothHeadset:
* Modified BluetoothHeadset so that start and stop SCO using virtual
  voice call no longer need a parameter and will use active device by
  default
* Modified documentation around various sco mangement APIs to match
  their expected behaviors

Bug: 76114959
Test: VoIP calls sanity test cases
Change-Id: Id50db88f4ff36069b0f392c81dd9d90c24cd2206
(cherry picked from commit 89f979849a5cf2fa4e16d4f24ab41409f16a9956)
2018-05-07 12:57:26 -07:00
Jean-Michel Trivi
ec4f10df90 Source of deadlock between PlayerBase.mLock and
PlaybackActivityMonitor.mPlayerLock:

android.media.MediaPlayer.release()
> android.media.PlayerBase.baseRelease()
  > synchronized (mLock)
    > com.android.server.audio.PlaybackActivityMonitor.releasePlayer()
       > synchronized(mPlayerLock)
and:

com.android.server.audio.PlaybackActivityMonitor.unmutePlayersForCall()
> synchronized (mPlayerLock)
  > android.media.PlayerProxy.setVolume()
    > android.media.PlayerBase$IPlayerWrapper.setVolume()
      > android.media.PlayerBase.baseSetVolume()
        > synchronized (mLock)
          playerSetVolume()

Since system_server can have its own players, the calls to
 AudioService from PlayerBase can be synchronous, hence the
 deadlock.
The fix consists in never holding the lock in PlayerBase
 while calling into AudioService.
Refactor the playstate update into a method used for
 start / stop / pause.

Bug: 72294559
Test: see bug
Change-Id: Ib41045de124683a7484184cf63577bd2412d1362
2018-04-12 17:27:30 -07:00
Jean-Michel Trivi
ab2e956360 New intent for microphone mute change notification
AudioManager: define ACTION_MICROPHONE_MUTE_CHANGED.
AudioService:
 - broadcast intent when setMicrophoneMute() is called
   with FLAG_RECEIVER_REGISTERED_ONLY.
 - remove outdated (invalid) comments.

Bug: 70857126
Test: m -j ; make -j offline-sdk-docs ; make -j cts ; \
      cts-tradefed run cts-dev -m CtsMediaTestCases -t android.media.cts.AudioManagerTest#testMicrophoneMuteIntent

Change-Id: I7391522f0195d06592e4f853e9b672fdec66d37a
Merged-In: I7391522f0195d06592e4f853e9b672fdec66d37a
2018-03-08 22:04:21 +00:00
Anton Hansson
a3e79fbb8c frameworks/base: Set LOCAL_SDK_VERSION where possible.
This change sets LOCAL_SDK_VERSION for all packages where
this is possible without breaking the build, and
LOCAL_PRIVATE_PLATFORM_APIS := true otherwise.

Setting one of these two will be made required soon, and this
is a change in preparation for that. Not setting LOCAL_SDK_VERSION
makes the app implicitly depend on the bootclasspath, which is
often not required. This change effectively makes depending on
private apis opt-in rather than opt-out.

Test: make relevant packages
Bug: 73535841
Change-Id: Ibcffec873a693d1c792ca210fb597d2bf37e9068
Merged-In: I4233b9091d9066c4fa69f3d24aaf367ea500f760
2018-02-28 17:15:21 +00:00
Jakub Pawlowski
10c906121b Add AudioManager.setHearingAidDeviceConnectionState
This will be used by Bluetooth to notify audio framework when Hearing
Aid is connected or disconnected.

Bug: 69623109
Test: mm
Change-Id: I5664d8bd20e36601eea815c0d6e55c3b1d49e4ea
2018-02-22 20:31:07 +00:00
Dan Willemsen
a56e4df08d Remove undefined all-aidl-files-under
This is not a defined function, and there are no aidl files under these
directories anyways.

Bug: 72661763
Test: find location/lib -name '*.aidl'
Test: find media/lib -name '*.aidl'
Change-Id: I000d8febd54a50d4c07b910fa374ac8019f696be
2018-01-29 16:41:43 -08:00
Pavlin Radoslavov
be4fb893a0 Multi-A2DP support - add a new internal API to suppress Audio Noisy intent
The new API setBluetoothA2dpDeviceConnectionStateSuppressNoisyIntent()
is similar to the existing setBluetoothA2dpDeviceConnectionState()
except that it takes one extra argument that indicates whether the
AudioManager.ACTION_AUDIO_BECOMING_NOISY intent will be sent:

  setBluetoothA2dpDeviceConnectionStateSuppressNoisyIntent(
      ..., boolean suppressNoisyIntent)

This API is needed so the Active A2DP Sink device can be changed
while audio is streaming, and the audio continues playing on the new
Active Device.

Bug: 69269748
Test: Manual: multiple connected A2DP devices, and selecting each as
      the Active Device.

Change-Id: I75766a58d9e6b42b3ce68bd9ad3a7a72ca5a1023
(cherry picked from commit 82e06463f2571a06286f9da0bf3ad5a0e58461a2)
2018-01-20 11:50:37 -08:00
Philip P. Moltmann
a0f5136faf Switch to modern ArgumentMatchers
Test: - adb shell am instrument -w -e class com.android.mediaframeworktest.unit.MediaInserterTest com.android.mediaframeworktest/android.support.test.runner.AndroidJUnitRunner
      - atest com.android.settingslib.users.AppRestrictionsHelperTest
      - atest com.android.server.NetworkScorerAppManagerTest com.android.server.accessibility.MotionEventInjectorTest com.android.server.webkit.WebViewUpdateServiceTest
Change-Id: I6d4c543541d3bebcd65e5aa9e3f4d9a0152d5583
2017-12-14 09:45:16 -08:00
Jeff Sharkey
2337aec921 Deeper sanity checking of emitted types.
When emitting a method or field, verify that we're able to reference
all mentioned types.  This ensures that we don't accidentally
reference undefined classes/interfaces.

Test: manual inspection of API files
Bug: 69791141
Change-Id: I84e0c87fe83daa118661f61dbdf17b58ea5282d4
Merged-In: I84e0c87fe83daa118661f61dbdf17b58ea5282d4
2017-12-07 00:22:25 -07:00
kyle_tso
34be883ebd Merge "Support scanDirectories with JNI callback function"
am: 5747c2b81c

Change-Id: I8996fb568c4024ccf76a5643049de8cee6f811c6
2017-12-06 03:22:30 +00:00
Treehugger Robot
5747c2b81c Merge "Support scanDirectories with JNI callback function" 2017-12-06 02:06:49 +00:00
Chih-hung Hsieh
cba4979a6a Merge "Use -Werror in frameworks/base/media/mca/filterfw"
am: 171fce8377

Change-Id: I698ee4b4d6c884469253238795d23bdb21a54542
2017-11-30 02:19:13 +00:00
Chih-Hung Hsieh
a7ea11e316 Use -Werror in frameworks/base/media/mca/filterfw
Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I12137a0b40357954af63bac3771332773b03da9a
2017-11-29 14:52:36 -08:00
kyle_tso
b4aa69fd11 Support scanDirectories with JNI callback function
MtpServer needs this function to update the database for directory
copy operation.

Test: Call this function from MtpServer and database is updated in
directory copy scenario.

Change-Id: I9b316f4dbf7f35922292c33ab02f9efebc867aa8
Signed-off-by: kyle_tso <kyle_tso@htc.com>
2017-11-22 20:30:42 +08:00
Ajay Panicker
171dec7468 Merge "Add MediaMetadata equals to make metadata comparisons easier"
am: 12bc5b6289

Change-Id: Ie622564ba02ec7a39d8f3574ea8885b225596c67
2017-11-16 22:53:19 +00:00
Ajay Panicker
6e1d2307a8 Add MediaMetadata equals to make metadata comparisons easier
Bug: 68854188
Test: Compare two metadata objects with the same title, album, and
artist
Change-Id: I89d1944bf237f8f3f1c52ccdb8ff385422b19070
2017-11-16 20:04:37 +00:00
Xin Li
220871a697 Merge commit '98e12851336b7db16e583f9afac63ecc97465980' from
oc-mr1-dev-plus-aosp-without-vendor into stage-aosp-master.

Change-Id: Ia7b8da4a00d215160e4a4fa40f6044208d1297b7
Merged-In: I19846d2a3ee27aecbae2367a74ee49082eea154d
2017-11-14 12:31:11 -08:00
Jerry Zhang
18abf57e99 Merge "Add storageId to moveObjects"
am: 1f4f6d2a18

Change-Id: Id4f53fc283850d8f93cde7e67581355dc50e595e
2017-10-19 18:11:49 +00:00
Jerry Zhang
1f4f6d2a18 Merge "Add storageId to moveObjects" 2017-10-19 17:55:34 +00:00
Tobias Thierer
07efe116b1 Merge "Framework: Prefer android.system.Os over libcore.io.Libcore.os"
am: 5f04db96b3

Change-Id: If85216d03022708787a7218e494434453d5548e3
2017-10-19 14:25:12 +00:00
Tobias Thierer
6217e37d30 Framework: Prefer android.system.Os over libcore.io.Libcore.os
This is a pure refactoring with no a behavior change other than
that these calls now go through android.system.Os, which immediately
delegates to Libcore.os.

This is a first step towards separating framework (via
android.system.Os) vs. libcore (via Libcore.os) clients of these
low level APIs. Separating these is a prerequisite towards moving
the API parts of android.system into framework, and moving the
rest into a different package in libcore.

Test: Treehugger
Bug: 67901714

Change-Id: Ifd8349ec5416e5693f40dba48fdf2bef651b7d81
Merged-In: Ifd8349ec5416e5693f40dba48fdf2bef651b7d81
2017-10-18 14:53:57 +01:00
Jerry Zhang
def7b19300 Add storageId to moveObjects
When moving between different storages, the storageId
must be changed as well.

Bug: 67028892
Test: Move between storages with virtual sdcard.
Change-Id: Ie82aa8d53686bfffb7c26b46a49524a00f2f0214
2017-10-17 15:27:03 -07:00
Chong Zhang
0764ce28cf Merge "Use rotation from MediaMetadataRetriever directly" into oc-mr1-dev
am: 106aeb324d

Change-Id: I5d7bbd0a3fb5f291f79a2e9009319eb4e57848a4
2017-10-06 05:29:43 +00:00
TreeHugger Robot
106aeb324d Merge "Use rotation from MediaMetadataRetriever directly" into oc-mr1-dev 2017-10-06 05:20:14 +00:00
Chong Zhang
9af92dadc9 Use rotation from MediaMetadataRetriever directly
MediaMetadataRetriever now reports rotation in clockwise,
no longer need to translate.

bug: 67470228

Test: verified rotation using test app attached in bug
Change-Id: Ifebcf25ea302477818e2e03db1e55525db985e67
2017-10-05 15:13:54 -07:00
Eric Laurent
8916db215f Merge "Fix Cell broadcast sound in total silence" into oc-mr1-dev
am: 77ee4f2ff2

Change-Id: Ib39341f455b82750ef357dbf41d8815fb303844d
2017-10-04 14:56:26 +00:00
Eric Laurent
77ee4f2ff2 Merge "Fix Cell broadcast sound in total silence" into oc-mr1-dev 2017-10-04 14:45:01 +00:00
Wonsik Kim
ce29a4c77a Merge "fix AmrInputStream.read() hang" am: 5b6a02eb8b am: 4c2bbbf552
am: b7079d6381

Change-Id: Ia0627f67855e56487818043b974953a33baf701f
2017-10-03 21:42:14 +00:00
Wonsik Kim
4c2bbbf552 Merge "fix AmrInputStream.read() hang"
am: 5b6a02eb8b

Change-Id: I7aff9043ec95d2f41e5d3301b01707f5dff4bef2
2017-10-03 21:18:10 +00:00
Treehugger Robot
5b6a02eb8b Merge "fix AmrInputStream.read() hang" 2017-10-03 20:37:36 +00:00
Wonsik Kim
e1b8b7bf0f fix AmrInputStream.read() hang
Test: AmrInputStream.read() no longer hangs
Change-Id: I5b3e1c7667891ce250e447c32213511077c5b5df
2017-10-02 17:44:02 -07:00
Jerry Zhang
3a13ab1fd3 Merge "Add moveObject method to change object's path and parent." am: 33a200e572 am: 0f09ac317d
am: f9696617bd

Change-Id: Ia6ba6d0cf89879914894d35a0dbf110d905966ac
2017-10-03 00:33:02 +00:00
Jerry Zhang
0f09ac317d Merge "Add moveObject method to change object's path and parent."
am: 33a200e572

Change-Id: Iabb8c9989ad35140ab1c752fb70741f52e56c04d
2017-10-03 00:04:03 +00:00
Jerry Zhang
952558d4e5 Add moveObject method to change object's path and parent.
This is needed to implement the MTP MOVE_OBJECT operation.

Bug: 66679910
Test: Move objects and folders, verify mediastore is consistent
Change-Id: I2f4f0c43134fb3ff82745166c051712cc1736b7f
2017-10-02 11:48:38 -07:00
Marco Nelissen
14d8ba7736 Merge "AmrInputStream is not a public API" am: c3b1442d52 am: fa55320f5d
am: 9bda8fddf2

Change-Id: Ib6e7f401af259e422aee6ca7d18703f380ef08f6
2017-09-29 20:21:30 +00:00
Marco Nelissen
fa55320f5d Merge "AmrInputStream is not a public API"
am: c3b1442d52

Change-Id: Iee0e6dfa9907dc70fcf5dae7fcbcf14b8bcb9ffb
2017-09-29 20:04:54 +00:00
Marco Nelissen
323d2a56ec AmrInputStream is not a public API
and nobody should be using it. Add some warnings to that effect.

Change-Id: I8029ccd665fd147b4708a68f61c6aa055004a5c1
2017-09-29 10:15:34 -07:00
Sungsoo Lim
aee660bb47 Merge "Make RoutInfo.select() called in app's main thread" into oc-mr1-dev
am: 6e326268c1

Change-Id: I91a4e5422a92f3e7571a1ffc7fb19d0594f116e2
2017-09-29 08:43:07 +00:00
Sungsoo Lim
133a24e095 Make RoutInfo.select() called in app's main thread
Bug: 66995486
Test: passed MediaRouter test
Test: Checked theat IllegalStateException doesn't happen
Change-Id: Idb75998cd7910a430e68ea928d28c9908260d5fc
2017-09-29 14:25:15 +09:00
Eric Laurent
e5a351cb92 Fix Cell broadcast sound in total silence
PlayerBase:
 Update player volume when the audio attributes are updated in case
we need to unmute
PlaybackActivityMonitor:
 Unmute alarm stream if needed when an alarm with flag
 FLAG_BYPASS_INTERRUPTION_POLICY starts from an app with
 privileged permission MODIFY_PHONE_STATE.

Bug: 63617557
Test: check sound with cell broadcast in total silence
Change-Id: Ifacb1d96a2d8d44047d9f9642d1e672fcf756cda
2017-09-28 18:00:01 -07:00
Sungsoo Lim
a8a1e989eb Merge "Select correct system audio route in updateAudioRoutes" into oc-mr1-dev
am: 43d5d86cda

Change-Id: I5bab35f229bbedeba548a43e078a500f5cd2a4b0
2017-09-25 07:16:48 +00:00
Sungsoo Lim
0e43c503ab Select correct system audio route in updateAudioRoutes
While update audio routes, MediaRouter had an access to the variable
of MediaRouterService.mGlobalBluetoothA2dpOn, which was updated in
the callback of AudioRoutesObserver.dispatchAudioRoutesChanged().
However, since updateAudioRoutes() was also called by the same
callback, mGlobalBluetoothA2dpOn could be used in updateAudioRoutes()
before its value was updated.

Bug: 65629167
Test: passed MediaRouterTest
Test: Manually confirmed that the issue is fixed with this CL
Change-Id: Id0034996a51a6d8d1e8bd9d2c6ca386aabbb8baf
Merged-In: Id0034996a51a6d8d1e8bd9d2c6ca386aabbb8baf
2017-09-25 10:15:49 +09:00