public final ArrayList<WifiRecord> loadWifisByBssid(final String bssid,final Integer session){
  final ArrayList<WifiRecord> wifis=new ArrayList<>();
  String selectSql;
  if (session != null) {
    selectSql=Schema.COL_BSSID + " = \"" + bssid+ "\" AND "+ Schema.COL_SESSION_ID+ " =\""+ session+ "\"";
  }
 else {
    selectSql=Schema.COL_BSSID + " = \"" + bssid+ "\"";
  }
  final Cursor cursor=contentResolver.query(ContentProvider.CONTENT_URI_WIFI,null,selectSql,null,null);
  final int columnIndex=cursor.getColumnIndex(Schema.COL_BSSID);
  final int columnIndex2=cursor.getColumnIndex(Schema.COL_SSID);
  final int columnIndex3=cursor.getColumnIndex(Schema.COL_CAPABILITIES);
  final int columnIndex4=cursor.getColumnIndex(Schema.COL_FREQUENCY);
  final int columnIndex5=cursor.getColumnIndex(Schema.COL_LEVEL);
  final int columnIndex6=cursor.getColumnIndex(Schema.COL_TIMESTAMP);
  final int columnIndex7=cursor.getColumnIndex(Schema.COL_BEGIN_POSITION_ID);
  final int columnIndex8=cursor.getColumnIndex(Schema.COL_END_POSITION_ID);
  final int columnIndex9=cursor.getColumnIndex(Schema.COL_KNOWN_WIFI);
  while (cursor.moveToNext()) {
    final WifiRecord wifi=new WifiRecord();
    wifi.setBssid(cursor.getString(columnIndex));
    wifi.setSsid(cursor.getString(columnIndex2));
    wifi.setCapabilities(cursor.getString(columnIndex3));
    wifi.setFrequency(cursor.getInt(columnIndex4));
    wifi.setLevel(cursor.getInt(columnIndex5));
    wifi.setOpenBmapTimestamp(cursor.getLong(columnIndex6));
    wifi.setBeginPosition(loadPositionById(cursor.getString(columnIndex7)));
    wifi.setEndPosition(loadPositionById(cursor.getString(columnIndex8)));
    wifi.setCatalogStatus(CatalogStatus.values()[cursor.getInt(columnIndex9)]);
    wifis.add(wifi);
  }
  cursor.close();
  return wifis;
}

public final ArrayList < WifiRecord > loadWifisByBssid ( final String bssid , final Integer session ) { final ArrayList < WifiRecord > wifis = new ArrayList < > ( ) ; String selectSql ; if ( session != null ) { selectSql = Schema . COL_BSSID + " = \"" + bssid + "\" AND " + Schema . COL_SESSION_ID + " =\"" + session + "\"" ; } else { selectSql = Schema . COL_BSSID + " = \"" + bssid + "\"" ; } final Cursor cursor = contentResolver . query ( ContentProvider . CONTENT_URI_WIFI , null , selectSql , null , null ) ; final int columnIndex = cursor . getColumnIndex ( Schema . COL_BSSID ) ; final int columnIndex2 = cursor . getColumnIndex ( Schema . COL_SSID ) ; final int columnIndex3 = cursor . getColumnIndex ( Schema . COL_CAPABILITIES ) ; final int columnIndex4 = cursor . getColumnIndex ( Schema . COL_FREQUENCY ) ; final int columnIndex5 = cursor . getColumnIndex ( Schema . COL_LEVEL ) ; final int columnIndex6 = cursor . getColumnIndex ( Schema . COL_TIMESTAMP ) ; final int columnIndex7 = cursor . getColumnIndex ( Schema . COL_BEGIN_POSITION_ID ) ; final int columnIndex8 = cursor . getColumnIndex ( Schema . COL_END_POSITION_ID ) ; final int columnIndex9 = cursor . getColumnIndex ( Schema . COL_KNOWN_WIFI ) ; while ( cursor . moveToNext ( ) ) { final WifiRecord wifi = new WifiRecord ( ) ; wifi . setBssid ( cursor . getString ( columnIndex ) ) ; wifi . setSsid ( cursor . getString ( columnIndex2 ) ) ; wifi . setCapabilities ( cursor . getString ( columnIndex3 ) ) ; wifi . setFrequency ( cursor . getInt ( columnIndex4 ) ) ; wifi . setLevel ( cursor . getInt ( columnIndex5 ) ) ; wifi . setOpenBmapTimestamp ( cursor . getLong ( columnIndex6 ) ) ; wifi . setBeginPosition ( loadPositionById ( cursor . getString ( columnIndex7 ) ) ) ; wifi . setEndPosition ( loadPositionById ( cursor . getString ( columnIndex8 ) ) ) ; wifi . setCatalogStatus ( CatalogStatus . values ( ) [ cursor . getInt ( columnIndex9 ) ] ) ; wifis . add ( wifi ) ; } cursor . close ( ) ; return wifis ; }
gets wifis by bssid
