Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b9dac8a5 authored by Łukasz Rymanowski's avatar Łukasz Rymanowski
Browse files

HapClientService: Don't use cache for PTS

PTS wants us to do operations on remote device, so when enabled, call
native.

Bug: 238171211
Test: atest BluetoothInstrumentationTests
Test: PTS
Tag: #feature
Change-Id: I14f8eda50321f941b69fa1cd37403b131dc5938d
parent 1e07461b
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -696,6 +696,12 @@ public class HapClientService extends ProfileService {
        BluetoothHapPresetInfo defaultValue = null;
        if (presetIndex == BluetoothHapClient.PRESET_INDEX_UNAVAILABLE) return defaultValue;

        if (Utils.isPtsTestMode()) {
            /* We want native to be called for PTS testing even we have all
             * the data in the cache here
             */
            mHapClientNativeInterface.getPresetInfo(device, presetIndex);
        }
        List<BluetoothHapPresetInfo> current_presets = mPresetsMap.get(device);
        if (current_presets != null) {
            for (BluetoothHapPresetInfo preset : current_presets) {