Loading android/app/src/com/android/bluetooth/btservice/AdapterService.java +5 −6 Original line number Diff line number Diff line Loading @@ -278,6 +278,10 @@ public class AdapterService extends Service { private final BluetoothHciVendorSpecificDispatcher mBluetoothHciVendorSpecificDispatcher = new BluetoothHciVendorSpecificDispatcher(); private final BluetoothHciVendorSpecificNativeInterface mBluetoothHciVendorSpecificNativeInterface = new BluetoothHciVendorSpecificNativeInterface( mBluetoothHciVendorSpecificDispatcher); private final Looper mLooper; private final AdapterServiceHandler mHandler; Loading Loading @@ -342,7 +346,6 @@ public class AdapterService extends Service { private BassClientService mBassClientService; private BatteryService mBatteryService; private BluetoothQualityReportNativeInterface mBluetoothQualityReportNativeInterface; private BluetoothHciVendorSpecificNativeInterface mBluetoothHciVendorSpecificNativeInterface; private GattService mGattService; private ScanController mScanController; Loading Loading @@ -693,11 +696,7 @@ public class AdapterService extends Service { mBluetoothQualityReportNativeInterface.init(); if (Flags.hciVendorSpecificExtension()) { mBluetoothHciVendorSpecificNativeInterface = requireNonNull( mBluetoothHciVendorSpecificNativeInterface.getInstance(), "mBluetoothHciVendorSpecificNativeInterface cannot be null"); mBluetoothHciVendorSpecificNativeInterface.init(mBluetoothHciVendorSpecificDispatcher); mBluetoothHciVendorSpecificNativeInterface.init(); } mSdpManager = new SdpManager(this, mLooper); Loading android/app/src/com/android/bluetooth/btservice/BluetoothHciVendorSpecificNativeInterface.java +6 −29 Original line number Diff line number Diff line Loading @@ -16,39 +16,16 @@ package com.android.bluetooth.btservice; import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.VisibleForTesting; public class BluetoothHciVendorSpecificNativeInterface { class BluetoothHciVendorSpecificNativeInterface { private static final String TAG = "BluetoothHciVendorSpecificNativeInterface"; private final BluetoothHciVendorSpecificDispatcher mDispatcher; @GuardedBy("INSTANCE_LOCK") private static BluetoothHciVendorSpecificNativeInterface sInstance; private static final Object INSTANCE_LOCK = new Object(); /** Get singleton instance. */ public static BluetoothHciVendorSpecificNativeInterface getInstance() { synchronized (INSTANCE_LOCK) { if (sInstance == null) { sInstance = new BluetoothHciVendorSpecificNativeInterface(); } return sInstance; } } /** Set singleton instance. */ @VisibleForTesting static void setInstance(BluetoothHciVendorSpecificNativeInterface instance) { synchronized (INSTANCE_LOCK) { sInstance = instance; } public BluetoothHciVendorSpecificNativeInterface( BluetoothHciVendorSpecificDispatcher dispatcher) { mDispatcher = dispatcher; } private BluetoothHciVendorSpecificDispatcher mDispatcher; void init(BluetoothHciVendorSpecificDispatcher dispatcher) { mDispatcher = dispatcher; void init() { initNative(); } Loading android/app/tests/unit/src/com/android/bluetooth/btservice/AdapterServiceTest.java +0 −3 Original line number Diff line number Diff line Loading @@ -155,7 +155,6 @@ public class AdapterServiceTest { private @Mock AdapterNativeInterface mNativeInterface; private @Mock BluetoothKeystoreNativeInterface mKeystoreNativeInterface; private @Mock BluetoothQualityReportNativeInterface mQualityNativeInterface; private @Mock BluetoothHciVendorSpecificNativeInterface mHciVendorSpecificNativeInterface; private @Mock SdpManagerNativeInterface mSdpNativeInterface; private @Mock AdvertiseManagerNativeInterface mAdvertiseNativeInterface; private @Mock DistanceMeasurementNativeInterface mDistanceNativeInterface; Loading Loading @@ -227,7 +226,6 @@ public class AdapterServiceTest { AdapterNativeInterface.setInstance(mNativeInterface); BluetoothKeystoreNativeInterface.setInstance(mKeystoreNativeInterface); BluetoothQualityReportNativeInterface.setInstance(mQualityNativeInterface); BluetoothHciVendorSpecificNativeInterface.setInstance(mHciVendorSpecificNativeInterface); SdpManagerNativeInterface.setInstance(mSdpNativeInterface); AdvertiseManagerNativeInterface.setInstance(mAdvertiseNativeInterface); DistanceMeasurementNativeInterface.setInstance(mDistanceNativeInterface); Loading Loading @@ -356,7 +354,6 @@ public class AdapterServiceTest { AdapterNativeInterface.setInstance(null); BluetoothKeystoreNativeInterface.setInstance(null); BluetoothQualityReportNativeInterface.setInstance(null); BluetoothHciVendorSpecificNativeInterface.setInstance(null); SdpManagerNativeInterface.setInstance(null); AdvertiseManagerNativeInterface.setInstance(null); DistanceMeasurementNativeInterface.setInstance(null); Loading Loading
android/app/src/com/android/bluetooth/btservice/AdapterService.java +5 −6 Original line number Diff line number Diff line Loading @@ -278,6 +278,10 @@ public class AdapterService extends Service { private final BluetoothHciVendorSpecificDispatcher mBluetoothHciVendorSpecificDispatcher = new BluetoothHciVendorSpecificDispatcher(); private final BluetoothHciVendorSpecificNativeInterface mBluetoothHciVendorSpecificNativeInterface = new BluetoothHciVendorSpecificNativeInterface( mBluetoothHciVendorSpecificDispatcher); private final Looper mLooper; private final AdapterServiceHandler mHandler; Loading Loading @@ -342,7 +346,6 @@ public class AdapterService extends Service { private BassClientService mBassClientService; private BatteryService mBatteryService; private BluetoothQualityReportNativeInterface mBluetoothQualityReportNativeInterface; private BluetoothHciVendorSpecificNativeInterface mBluetoothHciVendorSpecificNativeInterface; private GattService mGattService; private ScanController mScanController; Loading Loading @@ -693,11 +696,7 @@ public class AdapterService extends Service { mBluetoothQualityReportNativeInterface.init(); if (Flags.hciVendorSpecificExtension()) { mBluetoothHciVendorSpecificNativeInterface = requireNonNull( mBluetoothHciVendorSpecificNativeInterface.getInstance(), "mBluetoothHciVendorSpecificNativeInterface cannot be null"); mBluetoothHciVendorSpecificNativeInterface.init(mBluetoothHciVendorSpecificDispatcher); mBluetoothHciVendorSpecificNativeInterface.init(); } mSdpManager = new SdpManager(this, mLooper); Loading
android/app/src/com/android/bluetooth/btservice/BluetoothHciVendorSpecificNativeInterface.java +6 −29 Original line number Diff line number Diff line Loading @@ -16,39 +16,16 @@ package com.android.bluetooth.btservice; import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.VisibleForTesting; public class BluetoothHciVendorSpecificNativeInterface { class BluetoothHciVendorSpecificNativeInterface { private static final String TAG = "BluetoothHciVendorSpecificNativeInterface"; private final BluetoothHciVendorSpecificDispatcher mDispatcher; @GuardedBy("INSTANCE_LOCK") private static BluetoothHciVendorSpecificNativeInterface sInstance; private static final Object INSTANCE_LOCK = new Object(); /** Get singleton instance. */ public static BluetoothHciVendorSpecificNativeInterface getInstance() { synchronized (INSTANCE_LOCK) { if (sInstance == null) { sInstance = new BluetoothHciVendorSpecificNativeInterface(); } return sInstance; } } /** Set singleton instance. */ @VisibleForTesting static void setInstance(BluetoothHciVendorSpecificNativeInterface instance) { synchronized (INSTANCE_LOCK) { sInstance = instance; } public BluetoothHciVendorSpecificNativeInterface( BluetoothHciVendorSpecificDispatcher dispatcher) { mDispatcher = dispatcher; } private BluetoothHciVendorSpecificDispatcher mDispatcher; void init(BluetoothHciVendorSpecificDispatcher dispatcher) { mDispatcher = dispatcher; void init() { initNative(); } Loading
android/app/tests/unit/src/com/android/bluetooth/btservice/AdapterServiceTest.java +0 −3 Original line number Diff line number Diff line Loading @@ -155,7 +155,6 @@ public class AdapterServiceTest { private @Mock AdapterNativeInterface mNativeInterface; private @Mock BluetoothKeystoreNativeInterface mKeystoreNativeInterface; private @Mock BluetoothQualityReportNativeInterface mQualityNativeInterface; private @Mock BluetoothHciVendorSpecificNativeInterface mHciVendorSpecificNativeInterface; private @Mock SdpManagerNativeInterface mSdpNativeInterface; private @Mock AdvertiseManagerNativeInterface mAdvertiseNativeInterface; private @Mock DistanceMeasurementNativeInterface mDistanceNativeInterface; Loading Loading @@ -227,7 +226,6 @@ public class AdapterServiceTest { AdapterNativeInterface.setInstance(mNativeInterface); BluetoothKeystoreNativeInterface.setInstance(mKeystoreNativeInterface); BluetoothQualityReportNativeInterface.setInstance(mQualityNativeInterface); BluetoothHciVendorSpecificNativeInterface.setInstance(mHciVendorSpecificNativeInterface); SdpManagerNativeInterface.setInstance(mSdpNativeInterface); AdvertiseManagerNativeInterface.setInstance(mAdvertiseNativeInterface); DistanceMeasurementNativeInterface.setInstance(mDistanceNativeInterface); Loading Loading @@ -356,7 +354,6 @@ public class AdapterServiceTest { AdapterNativeInterface.setInstance(null); BluetoothKeystoreNativeInterface.setInstance(null); BluetoothQualityReportNativeInterface.setInstance(null); BluetoothHciVendorSpecificNativeInterface.setInstance(null); SdpManagerNativeInterface.setInstance(null); AdvertiseManagerNativeInterface.setInstance(null); DistanceMeasurementNativeInterface.setInstance(null); Loading