Loading android/app/src/com/android/bluetooth/le_audio/LeAudioService.java +2 −0 Original line number Diff line number Diff line Loading @@ -283,6 +283,7 @@ public class LeAudioService extends ProfileService { LeAudioNativeInterface nativeInterface = mLeAudioNativeInterface; if (nativeInterface == null) { Log.w(TAG, "the service is stopped. ignore init()"); return; } nativeInterface.init(mLeAudioCodecConfig.getCodecConfigOffloading()); } Loading @@ -295,6 +296,7 @@ public class LeAudioService extends ProfileService { return true; } mHandler.removeCallbacks(this::init); setActiveDevice(null); if (mTmapGattServer == null) { Loading android/app/tests/unit/src/com/android/bluetooth/le_audio/LeAudioServiceTest.java +15 −0 Original line number Diff line number Diff line Loading @@ -304,6 +304,21 @@ public class LeAudioServiceTest { }); } /** * Test if stop during init is ok. */ @Test public void testStopStartStopService() throws Exception { InstrumentationRegistry.getInstrumentation().runOnMainSync(new Runnable() { public void run() { assertThat(mService.stop()).isTrue(); assertThat(mService.start()).isTrue(); assertThat(mService.stop()).isTrue(); assertThat(mService.start()).isTrue(); } }); } /** * Test get/set priority for BluetoothDevice */ Loading Loading
android/app/src/com/android/bluetooth/le_audio/LeAudioService.java +2 −0 Original line number Diff line number Diff line Loading @@ -283,6 +283,7 @@ public class LeAudioService extends ProfileService { LeAudioNativeInterface nativeInterface = mLeAudioNativeInterface; if (nativeInterface == null) { Log.w(TAG, "the service is stopped. ignore init()"); return; } nativeInterface.init(mLeAudioCodecConfig.getCodecConfigOffloading()); } Loading @@ -295,6 +296,7 @@ public class LeAudioService extends ProfileService { return true; } mHandler.removeCallbacks(this::init); setActiveDevice(null); if (mTmapGattServer == null) { Loading
android/app/tests/unit/src/com/android/bluetooth/le_audio/LeAudioServiceTest.java +15 −0 Original line number Diff line number Diff line Loading @@ -304,6 +304,21 @@ public class LeAudioServiceTest { }); } /** * Test if stop during init is ok. */ @Test public void testStopStartStopService() throws Exception { InstrumentationRegistry.getInstrumentation().runOnMainSync(new Runnable() { public void run() { assertThat(mService.stop()).isTrue(); assertThat(mService.start()).isTrue(); assertThat(mService.stop()).isTrue(); assertThat(mService.start()).isTrue(); } }); } /** * Test get/set priority for BluetoothDevice */ Loading