File tree 2 files changed +2
-9
lines changed
android/sdl_android/src/androidTest/java/com/smartdevicelink
2 files changed +2
-9
lines changed Original file line number Diff line number Diff line change 34
34
public class TransportManagerTests {
35
35
36
36
@ Rule
37
- public GrantPermissionRule btRuntimePermissionRule ;
37
+ public GrantPermissionRule btRuntimePermissionRule = Build . VERSION . SDK_INT >= Build . VERSION_CODES . S ? GrantPermissionRule . grant ( Manifest . permission . BLUETOOTH_CONNECT ) : null ;
38
38
MultiplexTransportConfig config ;
39
39
final TransportRecord defaultBtRecord = new TransportRecord (TransportType .BLUETOOTH , "12:34:56:78:90" );
40
40
final ComponentName routerServiceComponentName = new ComponentName ("com.smartdevicelink.test" , "com.smartdevicelink.test.SdlRouterService" );
@@ -68,10 +68,6 @@ public boolean onLegacyModeEnabled(String info) {
68
68
69
69
@ Before
70
70
public void setUp () throws Exception {
71
- if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .S ) {
72
- btRuntimePermissionRule =
73
- GrantPermissionRule .grant (Manifest .permission .BLUETOOTH_CONNECT );
74
- }
75
71
config = new MultiplexTransportConfig (getInstrumentation ().getContext (), SdlUnitTestContants .TEST_APP_ID );
76
72
config .setService (routerServiceComponentName );
77
73
if (Looper .myLooper () == null ) {
Original file line number Diff line number Diff line change 37
37
@ RunWith (AndroidJUnit4 .class )
38
38
public class MediaStreamingStatusTests {
39
39
@ Rule
40
- public GrantPermissionRule btRuntimePermissionRule ;
40
+ public GrantPermissionRule btRuntimePermissionRule = Build . VERSION . SDK_INT >= Build . VERSION_CODES . S ? GrantPermissionRule . grant ( Manifest . permission . BLUETOOTH_CONNECT ) : null ;
41
41
42
42
@ Mock
43
43
private AudioManager audioManager = mock (AudioManager .class );
@@ -63,9 +63,6 @@ public Object answer(InvocationOnMock invocation) {
63
63
64
64
@ Before
65
65
public void setUp () throws Exception {
66
- if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .S ) {
67
- btRuntimePermissionRule = GrantPermissionRule .grant (Manifest .permission .BLUETOOTH_CONNECT );
68
- }
69
66
mockedContext = mock (Context .class );
70
67
doAnswer (onGetSystemService ).when (mockedContext ).getSystemService (Context .AUDIO_SERVICE );
71
68
defaultMediaStreamingStatus = new MediaStreamingStatus (mockedContext , mock (MediaStreamingStatus .Callback .class ));
You can’t perform that action at this time.
0 commit comments