HurriyetLocationHelper$5.smali

.class Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper$5;
.super Lcom/appcore/utils/TryRunnable;
.source "HurriyetLocationHelper.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;->getLocationName(Lcom/appcore/ui/base/CoreActivity;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;


# direct methods
.method constructor <init>(Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;)V
    .registers 2

    .line 278
    iput-object p1, p0, Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper$5;->this$0:Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;

    invoke-direct {p0}, Lcom/appcore/utils/TryRunnable;-><init>()V

    return-void
.end method


# virtual methods
.method public tryRun()V
    .registers 8

    .line 282
    iget-object v0, p0, Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper$5;->this$0:Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;

    # getter for: Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;->mCityNameListener:Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper$CityNameListener;
    invoke-static {v0}, Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;->access$400(Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;)Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper$CityNameListener;

    move-result-object v0

    if-eqz v0, :cond_9a

    .line 283
    invoke-static {}, Lcom/appcore/CoreApp;->isDevEnabled()Z

    move-result v0

    if-eqz v0, :cond_1b

    sget-boolean v0, Lhurriyet/mobil/android/hurriyet/HConstants;->LOGS_ENABLED_FOR_LOCATION_SERVICES:Z

    if-eqz v0, :cond_1b

    const-string v0, "Location name : Getting location name"

    .line 284
    filled-new-array {v0}, [Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/appcore/utils/L;->wtf([Ljava/lang/String;)V

    .line 287
    :cond_1b
    :try_start_1b
    new-instance v1, Landroid/location/Geocoder;

    invoke-static {}, Lhurriyet/mobil/android/hurriyet/HApp;->getAppContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {}, Ljava/util/Locale;->getDefault()Ljava/util/Locale;

    move-result-object v2

    invoke-direct {v1, v0, v2}, Landroid/location/Geocoder;-><init>(Landroid/content/Context;Ljava/util/Locale;)V

    .line 288
    iget-object v0, p0, Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper$5;->this$0:Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;

    # getter for: Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;->mLastLocation:Landroid/location/Location;
    invoke-static {v0}, Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;->access$100(Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;)Landroid/location/Location;

    move-result-object v0

    invoke-virtual {v0}, Landroid/location/Location;->getLatitude()D

    move-result-wide v2

    iget-object v0, p0, Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper$5;->this$0:Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;

    # getter for: Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;->mLastLocation:Landroid/location/Location;
    invoke-static {v0}, Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;->access$100(Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;)Landroid/location/Location;

    move-result-object v0

    invoke-virtual {v0}, Landroid/location/Location;->getLongitude()D

    move-result-wide v4

    const/4 v6, 0x1

    invoke-virtual/range {v1 .. v6}, Landroid/location/Geocoder;->getFromLocation(DDI)Ljava/util/List;

    move-result-object v0
    :try_end_41
    .catch Ljava/io/IOException; {:try_start_1b .. :try_end_41} :catch_42

    goto :goto_47

    :catch_42
    move-exception v0

    .line 290
    invoke-static {v0}, Lcom/appcore/utils/L;->ex(Ljava/lang/Exception;)V

    const/4 v0, 0x0

    :goto_47
    if-eqz v0, :cond_91

    .line 292
    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v1

    if-lez v1, :cond_91

    .line 293
    invoke-static {}, Lcom/appcore/CoreApp;->isDevEnabled()Z

    move-result v1

    const/4 v2, 0x0

    if-eqz v1, :cond_7d

    sget-boolean v1, Lhurriyet/mobil/android/hurriyet/HConstants;->LOGS_ENABLED_FOR_LOCATION_SERVICES:Z

    if-eqz v1, :cond_7d

    const/4 v1, 0x1

    new-array v1, v1, [Ljava/lang/String;

    .line 294
    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "Location name found:"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-interface {v0, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Landroid/location/Address;

    invoke-virtual {v4}, Landroid/location/Address;->getAdminArea()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    aput-object v3, v1, v2

    invoke-static {v1}, Lcom/appcore/utils/L;->wtf([Ljava/lang/String;)V

    .line 296
    :cond_7d
    iget-object v1, p0, Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper$5;->this$0:Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;

    # getter for: Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;->mCityNameListener:Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper$CityNameListener;
    invoke-static {v1}, Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;->access$400(Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;)Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper$CityNameListener;

    move-result-object v1

    invoke-interface {v0, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/location/Address;

    invoke-virtual {v0}, Landroid/location/Address;->getAdminArea()Ljava/lang/String;

    move-result-object v0

    invoke-interface {v1, v0}, Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper$CityNameListener;->onFoundCityName(Ljava/lang/String;)V

    return-void

    .line 299
    :cond_91
    iget-object v0, p0, Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper$5;->this$0:Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;

    # getter for: Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;->mCityNameListener:Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper$CityNameListener;
    invoke-static {v0}, Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;->access$400(Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;)Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper$CityNameListener;

    move-result-object v0

    invoke-interface {v0}, Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper$CityNameListener;->onFailedToFindCityName()V

    :cond_9a
    return-void
.end method