Skip to content
Snippets Groups Projects
Commit a62a52de authored by Shunkai Yao's avatar Shunkai Yao
Browse files

HalVersionManager: make instance_ptr after static versions init

BluetoothAudioHalVersion::VERSION* needs to be initialized before
instance_ptr.

Bug: 326888178
Test: m
Test: Build and test A2DP on Pixel 5a
Test: atest BluetoothAudioHalVersionTest
Change-Id: I0832b91dc13644b30ad32a0ad071cc531916838a
parent 92a4c663
No related branches found
No related tags found
No related merge requests found
...@@ -36,10 +36,6 @@ using ::aidl::android::hardware::bluetooth::audio:: ...@@ -36,10 +36,6 @@ using ::aidl::android::hardware::bluetooth::audio::
static const std::string kDefaultAudioProviderFactoryInterface = static const std::string kDefaultAudioProviderFactoryInterface =
std::string() + IBluetoothAudioProviderFactory::descriptor + "/default"; std::string() + IBluetoothAudioProviderFactory::descriptor + "/default";
// Ideally HalVersionManager can be a singleton class
std::unique_ptr<HalVersionManager> HalVersionManager::instance_ptr =
std::make_unique<HalVersionManager>();
std::string toString(BluetoothAudioHalTransport transport) { std::string toString(BluetoothAudioHalTransport transport) {
switch (transport) { switch (transport) {
case BluetoothAudioHalTransport::UNKNOWN: case BluetoothAudioHalTransport::UNKNOWN:
...@@ -68,6 +64,10 @@ const BluetoothAudioHalVersion BluetoothAudioHalVersion::VERSION_AIDL_V3 = ...@@ -68,6 +64,10 @@ const BluetoothAudioHalVersion BluetoothAudioHalVersion::VERSION_AIDL_V3 =
const BluetoothAudioHalVersion BluetoothAudioHalVersion::VERSION_AIDL_V4 = const BluetoothAudioHalVersion BluetoothAudioHalVersion::VERSION_AIDL_V4 =
BluetoothAudioHalVersion(BluetoothAudioHalTransport::AIDL, 4, 0); BluetoothAudioHalVersion(BluetoothAudioHalTransport::AIDL, 4, 0);
// Ideally HalVersionManager can be a singleton class
std::unique_ptr<HalVersionManager> HalVersionManager::instance_ptr =
std::make_unique<HalVersionManager>();
/** /**
* A singleton implementation to get the AIDL interface version. * A singleton implementation to get the AIDL interface version.
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment