summaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothCodecConfig.java
AgeCommit message (Collapse)Author
2022-04-02Merge TP1A.220328.001Rob Seymour
Change-Id: I5f07094ba2fb3991da03673f97d2957b1f68018b
2022-03-25Merge TP1A.220321.002Scott Lobdell
Change-Id: Ie8206e8b9c11c3fd55b7adddac5c782ad92c9da4
2022-03-23[API Review] Added Bt spec section for codec specificEtienne Ruffieux
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
2022-03-17Merge TP1A.220310.002Daniel Norman
Change-Id: If2f3a2a6833c45ec4c0cba7c7e668a487938cb92
2022-03-16Added documentation on codec specifics.Etienne Ruffieux
Bug: 220890820 Tag: #feature Test: atest Change-Id: Ib91d649a3627c50638805178877731e63099d838
2022-03-10Merge "Fix after API_review"Treehugger Robot
2022-03-09Merge "Fix after API_review" into tm-devTreeHugger Robot
2022-03-09Merge "Hide Bluetooth codec classes constructors"Etienne Ruffieux
2022-03-08Fix after API_reviewWilliam Escande
* 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
2022-03-08Fix after API_reviewWilliam Escande
* 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 Ignore-AOSP-First: merge conflict resolution Change-Id: Ia6aa778d6bdc0319266c52a84633ee593eaa7eb0
2022-03-08Hide Bluetooth codec classes constructorsEtienne Ruffieux
Added BluetoothCodecStatus Builder and hid constructor. Hid BluetoothCodecConfig constructor. Bug: 222540543 Bug: 222539659 Test: atest BluetoothCodecsTest Tag: #feature Change-Id: I6836e31ed4a689fb327b3ad94ab5df7d144da06a
2022-03-07Merge TP1A.220209.001Deyao Ren
Change-Id: Id0e2895d3220831d2c617a243047e8229af8acc9
2022-02-25Merge "Removed getMaxCodecType and made getcodecName static"Etienne Ruffieux
2022-02-14API Changes needed for apex to buildWilliam Escande
internal cherry-pick Bug: 216476895 Test: Compile Tag: #refactor Change-Id: I09108622038b174104457ca18ac6ec7949978f66 Merged-In: I09108622038b174104457ca18ac6ec7949978f66 CTS-Coverage-Bug: 217352944
2022-02-09Merge TP1A.220126.001Haamed Gheibi
Change-Id: Ibe4916c42b096976ac917991cf0c73f02512f3d4
2022-02-08Removed getMaxCodecType and made getcodecName staticEtienne Ruffieux
Bug: 218311980 Test: manual Tag: #feature Change-Id: Ic587d1838bed51bb6d758b14faf0a334ec24e444
2022-02-04Merge TP1A.220120.003Haamed Gheibi
Change-Id: I202f5093bbd13b381ea11f969fee6154ba91fa11
2022-02-01API Changes needed for apex to buildWilliam Escande
Bug: 216476895 Test: Compile Tag: #refactor Ignore-AOSP-First: AOSP will be updated later Change-Id: I09108622038b174104457ca18ac6ec7949978f66 CTS-Coverage-Bug: 217352944
2022-01-19Add framework support of LC3 codecTed Wang
Bug: 203621600 Test: atest BluetoothCodecConfigTest Change-Id: Ibacc8b39c4d916f69befca139604ed94c627c103
2021-12-03Make BluetoothCodecConfig and BluetoothCodecStatus public.Etienne Ruffieux
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
2020-10-15Add @Nullable annotation to the parameter of Object.equals() methods.Roman Kalukiewicz
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
2020-09-22Merge "Move all BluetoothCodecConfig and BluetoothCodecStatus APIs moved ↵TreeHugger Robot
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
2020-09-22Move all BluetoothCodecConfig and BluetoothCodecStatus APIs moved fromRahul Sabnis
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
2020-06-22Merge "A2DP: Check AAC bitrate mode by its CodecSpecific1"Treehugger Robot
2020-03-21Add BLUETOOTH_PRIVILEGED permission as a requirement for all new Bluetooth ↵Rahul Sabnis
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
2020-03-21Add BLUETOOTH_PRIVILEGED permission as a requirement for all new Bluetooth ↵Rahul Sabnis
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
2020-01-14A2DP: Check AAC bitrate mode by its CodecSpecific1Cheney Ni
Bug: 112325138 Test: manual Change-Id: Ib00dd08df98f16a5d52df52d395bf1cb4aaf914c
2020-01-10Use new UnsupportedAppUsage annotation.Artur Satayev
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
2019-12-18Use new UnsupportedAppUsage annotation.Artur Satayev
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
2019-12-06Resolve BluetoothA2dp hidden APIs to resolve dependenciesRahul Sabnis
Bug: 143240341 Test: Manual Change-Id: Ib55e0fb106fa7b91ef4d3559da12ea2c048f1ae5
2019-07-29Merge "Add helpers to check whether the BluetoothCodecConfig instance is ↵Cheney Ni
selectable" am: ed6755fa55 Change-Id: I7718d3f12541bcbb005f7e1930267a1393f9b19a
2019-07-23Add helpers to check whether the BluetoothCodecConfig instance is selectableCheney Ni
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
2019-02-28All Parcelable CREATOR fields are @NonNull.Jeff Sharkey
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
2019-01-17audio: Add API for BT to query offload A2DP encoding formatsArun Mirpuri
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
2018-08-02Add @UnsupportedAppUsage annotationsMathew Inwood
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
2018-08-01Add @UnsupportedAppUsage annotationsMathew Inwood
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
2017-08-24Fix checkstyle errors (2/2)Jack He
* 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
2017-08-24Fix checkstyle errors (1/2)Jack He
* Automatic style corrections through IDE Bug: 63596319 Test: make checkbuild, no manual changes, no functional changes Change-Id: I2397d55abc34c9b7a9b748bec6137778df3421a7
2017-03-29Add new internal API: enableOptionalCodecs()/disableOptionalCodecs()Pavlin Radoslavov
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
2017-02-06Add a mechanism to configure the default A2DP codec prioritiesPavlin Radoslavov
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
2017-01-31Update the A2DP Codec Config APIPavlin Radoslavov
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
2017-01-26Integration of the AAC codec for A2DP sourcePavlin Radoslavov
Test: A2DP streaming to AAC headsets Bug: 30958229 Change-Id: I1b530f1c5c495b8231fd68bed788d4567096683d
2017-01-04Integration of the LDAC codec for A2DP sourcePavlin Radoslavov
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
2017-01-04Integration of the aptX and aptX-HD codecs for A2DP sourcePavlin Radoslavov
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
2017-01-03Add a mechanism for configuring the A2DP Source codecsPavlin Radoslavov
* 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