aboutsummaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothCodecConfig.java
Commit message (Collapse)AuthorAgeFilesLines
* Add support for Opus in BT Java ServiceOmer Osman2022-08-101-2/+10
| | | | | | | | | | | | This CL adds Opus to the BluetoothCodecConfig, and sets the codec as the default low latency codec. Bug: 226441860 Test: A2dpCodecConfigTest BluetoothCodecConfigTest A2dpStateMachineTest Tag: #feature Ignore-AOSP-First: TM QPR1 Feature Change-Id: Id94a7f8fab1a7f5e0199d757a70ff19010694fff
* [API Review] Added Bt spec section for codec specificEtienne Ruffieux2022-03-231-0/+44
| | | | | | | | | | | As requested by API review, added sections of the Bt specification documentation in codec specific get methods. Bug: 220890820 Tag: #feature Test: none Change-Id: I52519aa660cf0a9a9a79fdc5ff3d0b0298dc8db4
* Added documentation on codec specifics.Etienne Ruffieux2022-03-161-0/+8
| | | | | | | Bug: 220890820 Tag: #feature Test: atest Change-Id: Ib91d649a3627c50638805178877731e63099d838
* Merge "Fix after API_review"Treehugger Robot2022-03-101-3/+0
|\
| * Fix after API_reviewWilliam Escande2022-03-081-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * isMandatoryCodec is now public * SCAN_FAILED_OUT_OF_HARDWARE/SCANNING_TOO_FREQUENTLY is now public with a IntDef (method using the value are changed accordingly) * Update doc for EXTRA_BATTERY_LEVEL and EXTRA_PAIRING_INITIATOR and ACTION_CONNECTION_STATE_CHANGED * Add Autoclosable to BluetoothSap to remove the NotCloseable * BluetoothClass.Device.PERI* are now public Bug: 222725037 Fix: 221851154 Test: Build + TH Tag: #refactor CTS-Coverage-Bug: 222539659 Merged-In: Ia6aa778d6bdc0319266c52a84633ee593eaa7eb0 Change-Id: Ia6aa778d6bdc0319266c52a84633ee593eaa7eb0
* | Merge "Hide Bluetooth codec classes constructors"Etienne Ruffieux2022-03-091-0/+1
|\ \ | |/ |/|
| * Hide Bluetooth codec classes constructorsEtienne Ruffieux2022-03-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | Added BluetoothCodecStatus Builder and hid constructor. Hid BluetoothCodecConfig constructor. Bug: 222540543 Bug: 222539659 Test: atest BluetoothCodecsTest Tag: #feature Change-Id: I6836e31ed4a689fb327b3ad94ab5df7d144da06a
* | Merge "Removed getMaxCodecType and made getcodecName static"Etienne Ruffieux2022-02-251-13/+5
|\ \ | |/ |/|
| * Removed getMaxCodecType and made getcodecName staticEtienne Ruffieux2022-02-081-13/+5
| | | | | | | | | | | | | | Bug: 218311980 Test: manual Tag: #feature Change-Id: Ic587d1838bed51bb6d758b14faf0a334ec24e444
* | API Changes needed for apex to buildWilliam Escande2022-02-141-0/+2
|/ | | | | | | | | | | internal cherry-pick Bug: 216476895 Test: Compile Tag: #refactor Change-Id: I09108622038b174104457ca18ac6ec7949978f66 Merged-In: I09108622038b174104457ca18ac6ec7949978f66 CTS-Coverage-Bug: 217352944
* Add framework support of LC3 codecTed Wang2022-01-191-12/+16
| | | | | | Bug: 203621600 Test: atest BluetoothCodecConfigTest Change-Id: Ibacc8b39c4d916f69befca139604ed94c627c103
* Make BluetoothCodecConfig and BluetoothCodecStatus public.Etienne Ruffieux2021-12-031-175/+322
| | | | | | | | | | | | | Made BluetoothCodecConfig and BluetoothCodecStatus public, added Builder to BluetoothCodecConfig, added accessor for SOURCE_CODEC_TYPE_MAX and changed Arrays returns to List. Tag: #feature Bug: 200202780 Bug: 170678351 Test: BluetoothCodecConfigTest & BluetoothCodecStatusTest NoNonSdkCheck: Only user actually requested the changes Change-Id: Ic61b7087f53f45781f7e0eecca8b6d983093a22d
* Add @Nullable annotation to the parameter of Object.equals() methods.Roman Kalukiewicz2020-10-151-1/+2
| | | | | | | | | | | | | | | | | | Those annotations could be inferred by some tools (like Kotlin), but the https://checkerframework.org/ doesn't check inherited annotations complaining about all equals() invocations that get nullable argument. The change was generated by running find . -name \*.java | xargs sed -i 's/public boolean equals(Object /public boolean equals(@Nullable Object /' in the frameworks/base directory and by automatically adding and formatting required imports if needed. No manual edits. Bug: 170883422 Test: Annotation change only. Should have not impact. Exempt-From-Owner-Approval: Mechanical change not specific to any component. Change-Id: I5eedb571c9d78862115dfdc5dae1cf2a35343580
* Merge "Move all BluetoothCodecConfig and BluetoothCodecStatus APIs moved ↵TreeHugger Robot2020-09-221-1/+31
|\ | | | | | | | | | | | | | | from the non-SDK API list to the blocklist in Android 11 back to the non-SDK API list." into rvc-qpr-dev am: 79a1219925 Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12657859 Change-Id: I4533f23095a2546d31d941d721c6766ad9bbdcda
| * Move all BluetoothCodecConfig and BluetoothCodecStatus APIs moved fromRahul Sabnis2020-09-221-1/+31
| | | | | | | | | | | | | | | | | | | | the non-SDK API list to the blocklist in Android 11 back to the non-SDK API list. Tag: #feature Bug: 168812851 Test: atest BluetoothHostTest#testCodecMethodsAccessible Change-Id: I29983284b1a1c271d983c99b286e204604abdc72
| * Add BLUETOOTH_PRIVILEGED permission as a requirement for all new Bluetooth ↵Rahul Sabnis2020-03-211-2/+0
| | | | | | | | | | | | | | | | | | | | SystemApis and for hidden connect/disconnect APIs. Hide some APIs that were previously marked as @UnsupportedAppUsage and re-add annotation as changing the permissions for these SystemApis would break the unsupported app contract that was previously there. Therefore, we're choosing to hide them until we have a good story on how to deal with them next release. Bug: 148689314 Test: Manual Change-Id: I33ee2c7ccd3827db3d23d6447cf82d9ffc36836a
| * Use new UnsupportedAppUsage annotation.Artur Satayev2019-12-181-1/+1
| | | | | | | | | | | | | | | | Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library. Bug: 145132366 Test: m && diff unsupportedappusage_index.csv Change-Id: I6ab53570aca580fbee1fcc927871caa09780f58f
* | Merge "A2DP: Check AAC bitrate mode by its CodecSpecific1"Treehugger Robot2020-06-221-1/+2
|\ \
| * | A2DP: Check AAC bitrate mode by its CodecSpecific1Cheney Ni2020-01-141-1/+2
| |/ | | | | | | | | | | Bug: 112325138 Test: manual Change-Id: Ib00dd08df98f16a5d52df52d395bf1cb4aaf914c
* | Add BLUETOOTH_PRIVILEGED permission as a requirement for all new Bluetooth ↵Rahul Sabnis2020-03-211-2/+0
| | | | | | | | | | | | | | | | | | | | | | SystemApis and for hidden connect/disconnect APIs. Hide some APIs that were previously marked as @UnsupportedAppUsage and re-add annotation as changing the permissions for these SystemApis would break the unsupported app contract that was previously there. Therefore, we're choosing to hide them until we have a good story on how to deal with them next release. Bug: 148689314 Test: Manual Merged-In: I33ee2c7ccd3827db3d23d6447cf82d9ffc36836a Change-Id: I33ee2c7ccd3827db3d23d6447cf82d9ffc36836a
* | Use new UnsupportedAppUsage annotation.Artur Satayev2020-01-101-1/+1
|/ | | | | | | | | Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library. Bug: 145132366 Test: m && diff unsupportedappusage_index.csv Change-Id: I6ab53570aca580fbee1fcc927871caa09780f58f Merged-In: I6ab53570aca580fbee1fcc927871caa09780f58f
* Resolve BluetoothA2dp hidden APIs to resolve dependenciesRahul Sabnis2019-12-061-47/+132
| | | | | | Bug: 143240341 Test: Manual Change-Id: Ib55e0fb106fa7b91ef4d3559da12ea2c048f1ae5
* Merge "Add helpers to check whether the BluetoothCodecConfig instance is ↵Cheney Ni2019-07-291-0/+91
|\ | | | | | | | | | | | | | | selectable" am: ed6755fa55 Change-Id: I7718d3f12541bcbb005f7e1930267a1393f9b19a
| * Add helpers to check whether the BluetoothCodecConfig instance is selectableCheney Ni2019-07-231-0/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There will be a helper in the BluetoothCodecStatus to check whether the codec config is matched the selectable array. It uses 3 smaller helpers to confirm the codec config has none (wildcard matching), or one and only one value for the audio feeding parameters. Besides, this CL also adds a helper to compare whether two codec configs are similar or not, and uses NONE values as wildcard. Bug: 131147224 Bug: 133719424 Test: atest -t BluetoothInstrumentationTests:com.android.bluetooth.a2dp Change-Id: I7d8f1a16b8358c440841801d95471b2d010739ec
| * Add @UnsupportedAppUsage annotationsMathew Inwood2018-08-011-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For packages: android.bluetooth.le android.bluetooth This is an automatically generated CL. See go/UnsupportedAppUsage for more details. Exempted-From-Owner-Approval: Mechanical changes to the codebase which have been approved by Android API council and announced on android-eng@ Bug: 110868826 Test: m Change-Id: Ifcf24c0617acd7facc0e03f30a95c3a6b09b205c Merged-In: I88a1311e27c5f9a5f9d1035db76034f86f650efc
* | All Parcelable CREATOR fields are @NonNull.Jeff Sharkey2019-02-281-1/+1
| | | | | | | | | | | | | | | | | | If they were null, then the Parcelable would fail to work. Bug: 126726802 Test: manual Change-Id: I7929ffa2f20e5de1c8e68e8263cca99496e9d014 Exempt-From-Owner-Approval: Trivial API annotations
* | audio: Add API for BT to query offload A2DP encoding formatsArun Mirpuri2019-01-171-0/+13
| | | | | | | | | | | | | | | | | | | | Add API in AudioManager to query offload A2DP encoding formats supported on primary HAL. This can be used instead of reading from property Bug: 111812273 Test: make Change-Id: I168f288d0bf32d6c9733c9b57934084667e794ee
* | Add @UnsupportedAppUsage annotationsMathew Inwood2018-08-021-0/+36
|/ | | | | | | | | | | | | | | | | For packages: android.bluetooth.le android.bluetooth This is an automatically generated CL. See go/UnsupportedAppUsage for more details. Exempted-From-Owner-Approval: Mechanical changes to the codebase which have been approved by Android API council and announced on android-eng@ Bug: 110868826 Test: m Change-Id: I88a1311e27c5f9a5f9d1035db76034f86f650efc
* Fix checkstyle errors (2/2)Jack He2017-08-241-28/+30
| | | | | | | | | | | | | | | | | | | | | | | | | * Manual style corrections with IDE assistance * Variable name refactors are done through IDE * Corrected general style errors such as: - "final private var" -> "private final var" - "&&", "+", "||" should not be at the end of line - Non-static private variable should be like "mVar" - Private static variable should be like "sVar" - Code file should always end with newline - Inherited methods should be annotated with @Override and no @hide tags - Public methods should always have a JavaDoc entry - "int[] array" is preferred over "int array[]" - private methods should be accessed without "this." when there is no name collisions. - "boolean ? true : false" -> boolean - "boolean ? false : true" -> !boolean - "boolean == true" OR "boolean != false" -> boolean - "boolean != true" OR "boolean == false" -> !boolean Bug: 63596319 Test: make checkbuild, no functional changes Change-Id: Iabdc2be912a32dd63a53213d175cf1bfef268ccd
* Fix checkstyle errors (1/2)Jack He2017-08-241-75/+74
| | | | | | | | * Automatic style corrections through IDE Bug: 63596319 Test: make checkbuild, no manual changes, no functional changes Change-Id: I2397d55abc34c9b7a9b748bec6137778df3421a7
* Add new internal API: enableOptionalCodecs()/disableOptionalCodecs()Pavlin Radoslavov2017-03-291-1/+21
| | | | | | | | | | | | This API can be used to enable the optional codecs, or disable them and use only the mandatory SBC. Internally, it is implemented by raising the SBC priority to highest (so SBC will be used/selected), or reducing the SBC priority to its default value (lowest). Test: A2DP streaming and enabling/disabling/selecting optional codecs Bug: 35873828 Change-Id: Ia82036ac33590a3a402b1f5a36102264d47a9029
* Add a mechanism to configure the default A2DP codec prioritiesPavlin Radoslavov2017-02-061-1/+3
| | | | | | | | | | | | | | | | | | | | Previously, the relative codec priorities were hard-codec internally. The new mechanism uses the following configurable resources in packages/apps/Bluetooth/res/values/config.xml to re-assign the default codec priorities per device, or to explicitly disable a codec. - a2dp_source_codec_priority_sbc - a2dp_source_codec_priority_aac - a2dp_source_codec_priority_aptx - a2dp_source_codec_priority_aptx_hd - a2dp_source_codec_priority_ldac Those values are assigned on startup. Also, they can be changed per device by using an overlay: device/<VENDOR>/<DEVICE>/overlay/packages/apps/Bluetooth/res/values/config.xml Test: Manually streaming to a headset Change-Id: Ic4da3a51ac73f00cbae731156cb7878c8fadee06
* Update the A2DP Codec Config APIPavlin Radoslavov2017-01-311-28/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the JNI upcall would contain only the current codec config. In the new API, the upcall contains: 1. The current codec config 2. The list of codecs containing the local codecs capabilities 3. The list of codecs containing the selectable codecs capabilities. This list is the intersection of the local codecs capabilities and the capabilities of the paired device. Also, refactored the Java internals to accomodate the extra information: * Added new class BluetoothCodecStatus that contains the extra info: current codec config, local codecs capabilities and selectable codecs capabilities * Renamed method getCodecConfig() to getCodecStatus() and return the corresponding BluetoothCodecStatus object. * Updates to class BluetoothCodecConfig: new methods isValid(), getCodecName(), and updated toString() so it is more user friendly * Removed BluetoothCodecConfig.EXTRA_CODEC_CONFIG and EXTRA_PREVIOUS_CODEC_CONFIG. The former is superseded by BluetoothCodecStatus.EXTRA_CODEC_STATUS; the latter is not really used. Test: A2DP streaming with headsets and switching the codecs Change-Id: Ia1af2c22e521e863e28a360610aca49f7e62d31b
* Integration of the AAC codec for A2DP sourcePavlin Radoslavov2017-01-261-3/+4
| | | | | | Test: A2DP streaming to AAC headsets Bug: 30958229 Change-Id: I1b530f1c5c495b8231fd68bed788d4567096683d
* Integration of the LDAC codec for A2DP sourcePavlin Radoslavov2017-01-041-0/+1
| | | | | | | | | | | The codec can be used if the encoding shared library is installed on the device: libldacBT_enc.so Test: A2DP streaming to LDAC headsets Bug: 30958229 Change-Id: I524805fd308b5181427515617eda05625a7c4ae5
* Integration of the aptX and aptX-HD codecs for A2DP sourcePavlin Radoslavov2017-01-041-0/+6
| | | | | | | | | | | Each of the codecs can be used if the corresponding encoding shared library is installed on the device: - aptX: libaptX.so - aptX-HD: libaptXHD.so Test: A2DP streaming to aptX and aptX-HD headsets Bug: 30958229 Change-Id: I24faddc8cd88ae3e1370922c633f30e13124a867
* Add a mechanism for configuring the A2DP Source codecsPavlin Radoslavov2017-01-031-0/+287
* Added a new class BluetoothCodecConfig that contains codec-related configuration or capabilities: codec type, priority, sample rate, bits per sample, channel mode, and codec specific fields. * Extended the Bluetooth A2DP AIDL interface to get/set the current codec configuration * Added new call handleBluetoothA2dpDeviceConfigChange() to the Media Framework that is called when there are changes in the Bluetooth A2DP device configuration - e.g., the A2DP codec is changed. Test: A2DP streaming to headsets, TestPlans/71390 Bug: 30958229 Change-Id: I9a82716cbc2a5efbe77352a031ac80c88f6a2459