/** * Call this in {@link LocationBackendService#update()}. */ public synchronized void onUpdate() { if (!currentDataUsed) { listener.onWiFisChanged(getWiFis()); } else { scanWiFis(); } }
private void onWiFisChanged() { if (loadWiFis()) { listener.onWiFisChanged(getWiFis()); } }
private Cell parseCellInfo(NeighboringCellInfo info) { try { if (getCellType(info.getNetworkType()) != Cell.CellType.GSM) return null; return new Cell(Cell.CellType.GSM, getMcc(), getMnc(), info.getLac(), info.getCid(), info.getPsc(), info.getRssi()); } catch (Exception ignored) { } return null; }
private boolean hasCid(long cid) { for (Cell cell : cells) { if (cell.getCid() == cid) return true; } return false; }
@Override public void disconnect() { if (callback != null) { onClose(); callback = null; } }
@Override public List<Address> getFromLocation(double latitude, double longitude, int maxResults, String locale) throws RemoteException { return GeocoderBackendService.this .getFromLocation(latitude, longitude, maxResults, locale); }
@Override public Intent getAboutIntent() throws RemoteException { return LocationBackendService.this.getAboutIntent(); } }
@Override protected synchronized void onClose() { for (AbstractBackendHelper helper : helpers) { helper.onClose(); } opened = false; }
@Override public void open() throws RemoteException { onOpen(); connected = true; }
@Override public List<Address> getFromLocationName(String locationName, int maxResults, double lowerLeftLatitude, double lowerLeftLongitude, double upperRightLatitude, double upperRightLongitude, String locale) throws RemoteException { return GeocoderBackendService.this .getFromLocationName(locationName, maxResults, lowerLeftLatitude, lowerLeftLongitude, upperRightLatitude, upperRightLongitude, locale); }
@Override public int hashCode() { int result = type.hashCode(); result = 31 * result + mcc; result = 31 * result + mnc; result = 31 * result + lac; result = 31 * result + (int) (cid ^ (cid >>> 32)); result = 31 * result + psc; result = 31 * result + signal; return result; }
public static String getServiceApiVersion(Context context) { String apiVersion = getPackageApiVersion(context, "com.google.android.gms"); return apiVersion != null ? apiVersion : getPackageApiVersion(context, "com.google.android.location"); }
@Override protected synchronized Location update() { for (AbstractBackendHelper helper : helpers) { helper.onUpdate(); } return null; }
public WiFi(String bssid, int rssi, Integer channel, Integer frequency) { this.bssid = wellFormedMac(bssid); this.rssi = rssi; this.channel = channel; this.frequency = frequency; } }
@Override protected synchronized void onOpen() { for (AbstractBackendHelper helper : helpers) { helper.onOpen(); } opened = true; }
@Override public void disconnect() { if (connected) { onClose(); connected = false; } }
@Override public Intent getAboutIntent() throws RemoteException { return GeocoderBackendService.this.getAboutIntent(); } }
@Override public Intent getSettingsIntent() throws RemoteException { return LocationBackendService.this.getSettingsIntent(); }
private static String getRadioType(Cell cell) { switch (cell.getType()) { case CDMA: return "cdma"; case LTE: return "lte"; case UMTS: return "wcdma"; case GSM: default: return "gsm"; } }