File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed 
app/src/androidTest/java/com/welie/blessedexample 
blessed/src/main/java/com/welie/blessed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ public class ExampleInstrumentedTest {
1919    @ Test 
2020    public  void  useAppContext () {
2121        // Context of the app under test. 
22-         Context  appContext  = InstrumentationRegistry .getTargetContext ();
22+         Context  appContext  = InstrumentationRegistry .getInstrumentation (). getContext ();
2323
2424        assertEquals ("com.welie.blessedexample" , appContext .getPackageName ());
2525    }
Original file line number Diff line number Diff line change @@ -346,7 +346,16 @@ public void disableLogging() {
346346    private  @ NotNull  ScanSettings  getScanSettings (@ NotNull  final  ScanMode  scanMode ) {
347347        Objects .requireNonNull (scanMode , "scanMode is null" );
348348
349-         if  (Build .VERSION .SDK_INT  >= Build .VERSION_CODES .M ) {
349+         if  (Build .VERSION .SDK_INT  >= Build .VERSION_CODES .O ) {
350+             return  new  ScanSettings .Builder ()
351+                     .setScanMode (scanMode .value )
352+                     .setCallbackType (ScanSettings .CALLBACK_TYPE_ALL_MATCHES )
353+                     .setMatchMode (ScanSettings .MATCH_MODE_AGGRESSIVE )
354+                     .setNumOfMatches (ScanSettings .MATCH_NUM_ONE_ADVERTISEMENT )
355+                     .setReportDelay (0L )
356+                     .setLegacy (false )
357+                     .build ();
358+         } else  if  (Build .VERSION .SDK_INT  >= Build .VERSION_CODES .M ) {
350359            return  new  ScanSettings .Builder ()
351360                    .setScanMode (scanMode .value )
352361                    .setCallbackType (ScanSettings .CALLBACK_TYPE_ALL_MATCHES )
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments