android/src/com/mapswithme/maps/background/WorkerService.java
private void placeDownloadNotification(Location l)
  {
    final String country = Framework.nativeGetCountryNameIfAbsent(l.getLatitude(), l.getLongitude());
    if (!TextUtils.isEmpty(country))
    {

      final String lastNotification = PREFS.getString(country, null);
      if (lastNotification != null)
      {
        // Do not place notification if it was displayed less than 180 days ago.
        final long timeStamp = Long.valueOf(lastNotification);
        final long outdatedMillis = 180L * 24 * 60 * 60 * 1000;
        if (System.currentTimeMillis() - timeStamp < outdatedMillis)
          return;
      }

      Notifier.notifyDownloadSuggest(country, String.format(APP.getString(R.string.download_location_country), country),
          Framework.nativeGetCountryIndex(l.getLatitude(), l.getLongitude()));
      PREFS.edit().putString(country, String.valueOf(System.currentTimeMillis())).apply();
    }
  }
/**
   * Adds notification with download country suggest.
   */
Adds notification with download country suggest.
Adds notification with download country suggest .
private void placeDownloadNotification(Location l)
  {
    final String country = Framework.nativeGetCountryNameIfAbsent(l.getLatitude(), l.getLongitude());
    if (!TextUtils.isEmpty(country))
    {
      final String lastNotification = PREFS.getString(country, null);
      if (lastNotification != null)
      {
        final long timeStamp = Long.valueOf(lastNotification);
        final long outdatedMillis = 180L * 24 * 60 * 60 * 1000;
        if (System.currentTimeMillis() - timeStamp < outdatedMillis)
          return;
      }
      Notifier.notifyDownloadSuggest(country, String.format(APP.getString(R.string.download_location_country), country),
          Framework.nativeGetCountryIndex(l.getLatitude(), l.getLongitude()));
      PREFS.edit().putString(country, String.valueOf(System.currentTimeMillis())).apply();
    }
  }
private void placeDownloadNotification ( Location l ) { final String country = Framework . nativeGetCountryNameIfAbsent ( l . getLatitude ( ) , l . getLongitude ( ) ) ; if ( ! TextUtils . isEmpty ( country ) ) { final String lastNotification = PREFS . getString ( country , null ) ; if ( lastNotification != null ) { final long timeStamp = Long . valueOf ( lastNotification ) ; final long outdatedMillis = 180L * 24 * 60 * 60 * 1000 ; if ( System . currentTimeMillis ( ) - timeStamp < outdatedMillis ) return ; } Notifier . notifyDownloadSuggest ( country , String . format ( APP . getString ( R . string . download_location_country ) , country ) , Framework . nativeGetCountryIndex ( l . getLatitude ( ) , l . getLongitude ( ) ) ) ; PREFS . edit ( ) . putString ( country , String . valueOf ( System . currentTimeMillis ( ) ) ) . apply ( ) ; } }
Adds notification with download country suggest.
Adds notification with download country suggest .
// Do not place notification if it was displayed less than 180 days ago.