Loading android/app/res/values/config.xml +0 −1 Original line number Original line Diff line number Diff line Loading @@ -31,7 +31,6 @@ <bool name="profile_supported_pbapclient">false</bool> <bool name="profile_supported_pbapclient">false</bool> <bool name="profile_supported_mapmce">false</bool> <bool name="profile_supported_mapmce">false</bool> <bool name="profile_supported_hid_device">true</bool> <bool name="profile_supported_hid_device">true</bool> <bool name="profile_supported_hearing_aid">true</bool> <!-- If true, we will require location to be enabled on the device to <!-- If true, we will require location to be enabled on the device to fire Bluetooth LE scan result callbacks in addition to having one fire Bluetooth LE scan result callbacks in addition to having one Loading android/app/src/com/android/bluetooth/btservice/Config.java +2 −1 Original line number Original line Diff line number Diff line Loading @@ -97,7 +97,8 @@ public class Config { (1 << BluetoothProfile.OPP)), (1 << BluetoothProfile.OPP)), new ProfileConfig(BluetoothPbapService.class, R.bool.profile_supported_pbap, new ProfileConfig(BluetoothPbapService.class, R.bool.profile_supported_pbap, (1 << BluetoothProfile.PBAP)), (1 << BluetoothProfile.PBAP)), new ProfileConfig(HearingAidService.class, R.bool.profile_supported_hearing_aid, new ProfileConfig(HearingAidService.class, com.android.internal.R.bool.config_hearing_aid_profile_supported, (1 << BluetoothProfile.HEARING_AID)) (1 << BluetoothProfile.HEARING_AID)) }; }; Loading android/app/tests/unit/src/com/android/bluetooth/btservice/ActiveDeviceManagerTest.java +8 −4 Original line number Original line Diff line number Diff line Loading @@ -216,7 +216,8 @@ public class ActiveDeviceManagerTest { @Test @Test public void hearingAidActive_clearA2dpAndHeadsetActive() { public void hearingAidActive_clearA2dpAndHeadsetActive() { Assume.assumeTrue("Ignore test when HearingAidService is not enabled", Assume.assumeTrue("Ignore test when HearingAidService is not enabled", mContext.getResources().getBoolean(R.bool.profile_supported_hearing_aid)); mContext.getResources().getBoolean( com.android.internal.R.bool.config_hearing_aid_profile_supported)); a2dpConnected(mA2dpHeadsetDevice); a2dpConnected(mA2dpHeadsetDevice); headsetConnected(mA2dpHeadsetDevice); headsetConnected(mA2dpHeadsetDevice); Loading @@ -234,7 +235,8 @@ public class ActiveDeviceManagerTest { @Test @Test public void hearingAidActive_dontSetA2dpAndHeadsetActive() { public void hearingAidActive_dontSetA2dpAndHeadsetActive() { Assume.assumeTrue("Ignore test when HearingAidService is not enabled", Assume.assumeTrue("Ignore test when HearingAidService is not enabled", mContext.getResources().getBoolean(R.bool.profile_supported_hearing_aid)); mContext.getResources().getBoolean( com.android.internal.R.bool.config_hearing_aid_profile_supported)); hearingAidActiveDeviceChanged(mHearingAidDevice); hearingAidActiveDeviceChanged(mHearingAidDevice); a2dpConnected(mA2dpHeadsetDevice); a2dpConnected(mA2dpHeadsetDevice); Loading @@ -251,7 +253,8 @@ public class ActiveDeviceManagerTest { @Test @Test public void hearingAidActive_setA2dpActiveExplicitly() { public void hearingAidActive_setA2dpActiveExplicitly() { Assume.assumeTrue("Ignore test when HearingAidService is not enabled", Assume.assumeTrue("Ignore test when HearingAidService is not enabled", mContext.getResources().getBoolean(R.bool.profile_supported_hearing_aid)); mContext.getResources().getBoolean( com.android.internal.R.bool.config_hearing_aid_profile_supported)); hearingAidActiveDeviceChanged(mHearingAidDevice); hearingAidActiveDeviceChanged(mHearingAidDevice); a2dpConnected(mA2dpHeadsetDevice); a2dpConnected(mA2dpHeadsetDevice); Loading @@ -271,7 +274,8 @@ public class ActiveDeviceManagerTest { @Test @Test public void hearingAidActive_setHeadsetActiveExplicitly() { public void hearingAidActive_setHeadsetActiveExplicitly() { Assume.assumeTrue("Ignore test when HearingAidService is not enabled", Assume.assumeTrue("Ignore test when HearingAidService is not enabled", mContext.getResources().getBoolean(R.bool.profile_supported_hearing_aid)); mContext.getResources().getBoolean( com.android.internal.R.bool.config_hearing_aid_profile_supported)); hearingAidActiveDeviceChanged(mHearingAidDevice); hearingAidActiveDeviceChanged(mHearingAidDevice); headsetConnected(mA2dpHeadsetDevice); headsetConnected(mA2dpHeadsetDevice); Loading android/app/tests/unit/src/com/android/bluetooth/hearingaid/HearingAidServiceTest.java +5 −3 Original line number Original line Diff line number Diff line Loading @@ -35,10 +35,10 @@ import android.support.test.filters.MediumTest; import android.support.test.rule.ServiceTestRule; import android.support.test.rule.ServiceTestRule; import android.support.test.runner.AndroidJUnit4; import android.support.test.runner.AndroidJUnit4; import com.android.bluetooth.R; import com.android.bluetooth.TestUtils; import com.android.bluetooth.TestUtils; import com.android.bluetooth.btservice.AdapterService; import com.android.bluetooth.btservice.AdapterService; import com.android.bluetooth.btservice.DatabaseManager; import com.android.bluetooth.btservice.DatabaseManager; import com.android.internal.R; import org.junit.After; import org.junit.After; import org.junit.Assert; import org.junit.Assert; Loading Loading @@ -80,7 +80,8 @@ public class HearingAidServiceTest { public void setUp() throws Exception { public void setUp() throws Exception { mTargetContext = InstrumentationRegistry.getTargetContext(); mTargetContext = InstrumentationRegistry.getTargetContext(); Assume.assumeTrue("Ignore test when HearingAidService is not enabled", Assume.assumeTrue("Ignore test when HearingAidService is not enabled", mTargetContext.getResources().getBoolean(R.bool.profile_supported_hearing_aid)); mTargetContext.getResources().getBoolean( R.bool.config_hearing_aid_profile_supported)); // Set up mocks and test assets // Set up mocks and test assets MockitoAnnotations.initMocks(this); MockitoAnnotations.initMocks(this); Loading Loading @@ -121,7 +122,8 @@ public class HearingAidServiceTest { @After @After public void tearDown() throws Exception { public void tearDown() throws Exception { if (!mTargetContext.getResources().getBoolean(R.bool.profile_supported_hearing_aid)) { if (!mTargetContext.getResources().getBoolean( R.bool.config_hearing_aid_profile_supported)) { return; return; } } stopService(); stopService(); Loading android/app/tests/unit/src/com/android/bluetooth/hearingaid/HearingAidStateMachineTest.java +5 −3 Original line number Original line Diff line number Diff line Loading @@ -28,9 +28,9 @@ import android.support.test.InstrumentationRegistry; import android.support.test.filters.MediumTest; import android.support.test.filters.MediumTest; import android.support.test.runner.AndroidJUnit4; import android.support.test.runner.AndroidJUnit4; import com.android.bluetooth.R; import com.android.bluetooth.TestUtils; import com.android.bluetooth.TestUtils; import com.android.bluetooth.btservice.AdapterService; import com.android.bluetooth.btservice.AdapterService; import com.android.internal.R; import org.hamcrest.core.IsInstanceOf; import org.hamcrest.core.IsInstanceOf; import org.junit.After; import org.junit.After; Loading Loading @@ -61,7 +61,8 @@ public class HearingAidStateMachineTest { public void setUp() throws Exception { public void setUp() throws Exception { mTargetContext = InstrumentationRegistry.getTargetContext(); mTargetContext = InstrumentationRegistry.getTargetContext(); Assume.assumeTrue("Ignore test when HearingAidService is not enabled", Assume.assumeTrue("Ignore test when HearingAidService is not enabled", mTargetContext.getResources().getBoolean(R.bool.profile_supported_hearing_aid)); mTargetContext.getResources().getBoolean( R.bool.config_hearing_aid_profile_supported)); // Set up mocks and test assets // Set up mocks and test assets MockitoAnnotations.initMocks(this); MockitoAnnotations.initMocks(this); TestUtils.setAdapterService(mAdapterService); TestUtils.setAdapterService(mAdapterService); Loading @@ -83,7 +84,8 @@ public class HearingAidStateMachineTest { @After @After public void tearDown() throws Exception { public void tearDown() throws Exception { if (!mTargetContext.getResources().getBoolean(R.bool.profile_supported_hearing_aid)) { if (!mTargetContext.getResources().getBoolean( R.bool.config_hearing_aid_profile_supported)) { return; return; } } mHearingAidStateMachine.doQuit(); mHearingAidStateMachine.doQuit(); Loading Loading
android/app/res/values/config.xml +0 −1 Original line number Original line Diff line number Diff line Loading @@ -31,7 +31,6 @@ <bool name="profile_supported_pbapclient">false</bool> <bool name="profile_supported_pbapclient">false</bool> <bool name="profile_supported_mapmce">false</bool> <bool name="profile_supported_mapmce">false</bool> <bool name="profile_supported_hid_device">true</bool> <bool name="profile_supported_hid_device">true</bool> <bool name="profile_supported_hearing_aid">true</bool> <!-- If true, we will require location to be enabled on the device to <!-- If true, we will require location to be enabled on the device to fire Bluetooth LE scan result callbacks in addition to having one fire Bluetooth LE scan result callbacks in addition to having one Loading
android/app/src/com/android/bluetooth/btservice/Config.java +2 −1 Original line number Original line Diff line number Diff line Loading @@ -97,7 +97,8 @@ public class Config { (1 << BluetoothProfile.OPP)), (1 << BluetoothProfile.OPP)), new ProfileConfig(BluetoothPbapService.class, R.bool.profile_supported_pbap, new ProfileConfig(BluetoothPbapService.class, R.bool.profile_supported_pbap, (1 << BluetoothProfile.PBAP)), (1 << BluetoothProfile.PBAP)), new ProfileConfig(HearingAidService.class, R.bool.profile_supported_hearing_aid, new ProfileConfig(HearingAidService.class, com.android.internal.R.bool.config_hearing_aid_profile_supported, (1 << BluetoothProfile.HEARING_AID)) (1 << BluetoothProfile.HEARING_AID)) }; }; Loading
android/app/tests/unit/src/com/android/bluetooth/btservice/ActiveDeviceManagerTest.java +8 −4 Original line number Original line Diff line number Diff line Loading @@ -216,7 +216,8 @@ public class ActiveDeviceManagerTest { @Test @Test public void hearingAidActive_clearA2dpAndHeadsetActive() { public void hearingAidActive_clearA2dpAndHeadsetActive() { Assume.assumeTrue("Ignore test when HearingAidService is not enabled", Assume.assumeTrue("Ignore test when HearingAidService is not enabled", mContext.getResources().getBoolean(R.bool.profile_supported_hearing_aid)); mContext.getResources().getBoolean( com.android.internal.R.bool.config_hearing_aid_profile_supported)); a2dpConnected(mA2dpHeadsetDevice); a2dpConnected(mA2dpHeadsetDevice); headsetConnected(mA2dpHeadsetDevice); headsetConnected(mA2dpHeadsetDevice); Loading @@ -234,7 +235,8 @@ public class ActiveDeviceManagerTest { @Test @Test public void hearingAidActive_dontSetA2dpAndHeadsetActive() { public void hearingAidActive_dontSetA2dpAndHeadsetActive() { Assume.assumeTrue("Ignore test when HearingAidService is not enabled", Assume.assumeTrue("Ignore test when HearingAidService is not enabled", mContext.getResources().getBoolean(R.bool.profile_supported_hearing_aid)); mContext.getResources().getBoolean( com.android.internal.R.bool.config_hearing_aid_profile_supported)); hearingAidActiveDeviceChanged(mHearingAidDevice); hearingAidActiveDeviceChanged(mHearingAidDevice); a2dpConnected(mA2dpHeadsetDevice); a2dpConnected(mA2dpHeadsetDevice); Loading @@ -251,7 +253,8 @@ public class ActiveDeviceManagerTest { @Test @Test public void hearingAidActive_setA2dpActiveExplicitly() { public void hearingAidActive_setA2dpActiveExplicitly() { Assume.assumeTrue("Ignore test when HearingAidService is not enabled", Assume.assumeTrue("Ignore test when HearingAidService is not enabled", mContext.getResources().getBoolean(R.bool.profile_supported_hearing_aid)); mContext.getResources().getBoolean( com.android.internal.R.bool.config_hearing_aid_profile_supported)); hearingAidActiveDeviceChanged(mHearingAidDevice); hearingAidActiveDeviceChanged(mHearingAidDevice); a2dpConnected(mA2dpHeadsetDevice); a2dpConnected(mA2dpHeadsetDevice); Loading @@ -271,7 +274,8 @@ public class ActiveDeviceManagerTest { @Test @Test public void hearingAidActive_setHeadsetActiveExplicitly() { public void hearingAidActive_setHeadsetActiveExplicitly() { Assume.assumeTrue("Ignore test when HearingAidService is not enabled", Assume.assumeTrue("Ignore test when HearingAidService is not enabled", mContext.getResources().getBoolean(R.bool.profile_supported_hearing_aid)); mContext.getResources().getBoolean( com.android.internal.R.bool.config_hearing_aid_profile_supported)); hearingAidActiveDeviceChanged(mHearingAidDevice); hearingAidActiveDeviceChanged(mHearingAidDevice); headsetConnected(mA2dpHeadsetDevice); headsetConnected(mA2dpHeadsetDevice); Loading
android/app/tests/unit/src/com/android/bluetooth/hearingaid/HearingAidServiceTest.java +5 −3 Original line number Original line Diff line number Diff line Loading @@ -35,10 +35,10 @@ import android.support.test.filters.MediumTest; import android.support.test.rule.ServiceTestRule; import android.support.test.rule.ServiceTestRule; import android.support.test.runner.AndroidJUnit4; import android.support.test.runner.AndroidJUnit4; import com.android.bluetooth.R; import com.android.bluetooth.TestUtils; import com.android.bluetooth.TestUtils; import com.android.bluetooth.btservice.AdapterService; import com.android.bluetooth.btservice.AdapterService; import com.android.bluetooth.btservice.DatabaseManager; import com.android.bluetooth.btservice.DatabaseManager; import com.android.internal.R; import org.junit.After; import org.junit.After; import org.junit.Assert; import org.junit.Assert; Loading Loading @@ -80,7 +80,8 @@ public class HearingAidServiceTest { public void setUp() throws Exception { public void setUp() throws Exception { mTargetContext = InstrumentationRegistry.getTargetContext(); mTargetContext = InstrumentationRegistry.getTargetContext(); Assume.assumeTrue("Ignore test when HearingAidService is not enabled", Assume.assumeTrue("Ignore test when HearingAidService is not enabled", mTargetContext.getResources().getBoolean(R.bool.profile_supported_hearing_aid)); mTargetContext.getResources().getBoolean( R.bool.config_hearing_aid_profile_supported)); // Set up mocks and test assets // Set up mocks and test assets MockitoAnnotations.initMocks(this); MockitoAnnotations.initMocks(this); Loading Loading @@ -121,7 +122,8 @@ public class HearingAidServiceTest { @After @After public void tearDown() throws Exception { public void tearDown() throws Exception { if (!mTargetContext.getResources().getBoolean(R.bool.profile_supported_hearing_aid)) { if (!mTargetContext.getResources().getBoolean( R.bool.config_hearing_aid_profile_supported)) { return; return; } } stopService(); stopService(); Loading
android/app/tests/unit/src/com/android/bluetooth/hearingaid/HearingAidStateMachineTest.java +5 −3 Original line number Original line Diff line number Diff line Loading @@ -28,9 +28,9 @@ import android.support.test.InstrumentationRegistry; import android.support.test.filters.MediumTest; import android.support.test.filters.MediumTest; import android.support.test.runner.AndroidJUnit4; import android.support.test.runner.AndroidJUnit4; import com.android.bluetooth.R; import com.android.bluetooth.TestUtils; import com.android.bluetooth.TestUtils; import com.android.bluetooth.btservice.AdapterService; import com.android.bluetooth.btservice.AdapterService; import com.android.internal.R; import org.hamcrest.core.IsInstanceOf; import org.hamcrest.core.IsInstanceOf; import org.junit.After; import org.junit.After; Loading Loading @@ -61,7 +61,8 @@ public class HearingAidStateMachineTest { public void setUp() throws Exception { public void setUp() throws Exception { mTargetContext = InstrumentationRegistry.getTargetContext(); mTargetContext = InstrumentationRegistry.getTargetContext(); Assume.assumeTrue("Ignore test when HearingAidService is not enabled", Assume.assumeTrue("Ignore test when HearingAidService is not enabled", mTargetContext.getResources().getBoolean(R.bool.profile_supported_hearing_aid)); mTargetContext.getResources().getBoolean( R.bool.config_hearing_aid_profile_supported)); // Set up mocks and test assets // Set up mocks and test assets MockitoAnnotations.initMocks(this); MockitoAnnotations.initMocks(this); TestUtils.setAdapterService(mAdapterService); TestUtils.setAdapterService(mAdapterService); Loading @@ -83,7 +84,8 @@ public class HearingAidStateMachineTest { @After @After public void tearDown() throws Exception { public void tearDown() throws Exception { if (!mTargetContext.getResources().getBoolean(R.bool.profile_supported_hearing_aid)) { if (!mTargetContext.getResources().getBoolean( R.bool.config_hearing_aid_profile_supported)) { return; return; } } mHearingAidStateMachine.doQuit(); mHearingAidStateMachine.doQuit(); Loading