HurriyetLocationHelper$4.smali

.class Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper$4;
.super Ljava/lang/Object;
.source "HurriyetLocationHelper.java"

# interfaces
.implements Lcom/appcore/utils/permissions/CorePermission$PermissionListener;


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;
.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 188
    iput-object p1, p0, Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper$4;->this$0:Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;

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

    return-void
.end method


# virtual methods
.method public onPermissionAllowed()I
    .registers 4

    const-wide/16 v0, -0x1

    .line 193
    invoke-static {v0, v1}, Lhurriyet/mobil/android/hurriyet/utils/SharedPreferencesHelper;->setLocationCheckpointDate(J)V

    const/4 v0, 0x0

    .line 194
    invoke-static {v0}, Lhurriyet/mobil/android/hurriyet/utils/SharedPreferencesHelper;->setNeverAskAgainCheckedBefore(Z)V

    const/4 v1, 0x1

    .line 195
    invoke-static {v1}, Lhurriyet/mobil/android/hurriyet/utils/SharedPreferencesHelper;->setLocationAllowed(Z)V

    .line 198
    iget-object v2, p0, Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper$4;->this$0:Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;

    # getter for: Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;->mGoogleApiClient:Lcom/google/android/gms/common/api/GoogleApiClient;
    invoke-static {v2}, Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;->access$000(Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;)Lcom/google/android/gms/common/api/GoogleApiClient;

    move-result-object v2

    if-eqz v2, :cond_88

    .line 199
    iget-object v2, p0, Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper$4;->this$0:Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;

    # getter for: Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;->mGoogleApiClient:Lcom/google/android/gms/common/api/GoogleApiClient;
    invoke-static {v2}, Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;->access$000(Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;)Lcom/google/android/gms/common/api/GoogleApiClient;

    move-result-object v2

    invoke-virtual {v2}, Lcom/google/android/gms/common/api/GoogleApiClient;->isConnected()Z

    move-result v2

    if-eqz v2, :cond_4a

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

    move-result v0

    if-eqz v0, :cond_34

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

    if-eqz v0, :cond_34

    const-string v0, "Location Permission: Allowed - Already connected"

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

    move-result-object v0

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

    :cond_34
    const/4 v0, 0x2

    .line 204
    iget-object v2, p0, Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper$4;->this$0:Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;

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

    move-result-object v2

    if-nez v2, :cond_43

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

    # invokes: Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;->requestLocationUpdates(Z)V
    invoke-static {v0, v1}, Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;->access$300(Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;Z)V

    goto :goto_69

    .line 208
    :cond_43
    iget-object v1, p0, Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper$4;->this$0:Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;

    const/4 v2, 0x0

    invoke-virtual {v1, v2}, Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;->getLocationName(Lcom/appcore/ui/base/CoreActivity;)V

    goto :goto_9c

    .line 210
    :cond_4a
    iget-object v2, p0, Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper$4;->this$0:Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;

    # getter for: Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;->mGoogleApiClient:Lcom/google/android/gms/common/api/GoogleApiClient;
    invoke-static {v2}, Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;->access$000(Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;)Lcom/google/android/gms/common/api/GoogleApiClient;

    move-result-object v2

    invoke-virtual {v2}, Lcom/google/android/gms/common/api/GoogleApiClient;->isConnecting()Z

    move-result v2

    if-eqz v2, :cond_6b

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

    move-result v0

    if-eqz v0, :cond_69

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

    if-eqz v0, :cond_69

    const-string v0, "Location Permission: Allowed - Trying to connect"

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

    move-result-object v0

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

    :cond_69
    :goto_69
    const/4 v0, 0x1

    goto :goto_9c

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

    move-result v1

    if-eqz v1, :cond_7e

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

    if-eqz v1, :cond_7e

    const-string v1, "Location Permission: Allowed - Starting connection"

    .line 217
    filled-new-array {v1}, [Ljava/lang/String;

    move-result-object v1

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

    .line 219
    :cond_7e
    iget-object v1, p0, Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper$4;->this$0:Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;

    # getter for: Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;->mGoogleApiClient:Lcom/google/android/gms/common/api/GoogleApiClient;
    invoke-static {v1}, Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;->access$000(Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;)Lcom/google/android/gms/common/api/GoogleApiClient;

    move-result-object v1

    invoke-virtual {v1}, Lcom/google/android/gms/common/api/GoogleApiClient;->connect()V

    goto :goto_9c

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

    move-result v0

    if-eqz v0, :cond_9b

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

    if-eqz v0, :cond_9b

    const-string v0, "Location Permission: Allowed - GoogeApiClient is Null"

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

    move-result-object v0

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

    :cond_9b
    const/4 v0, -0x1

    .line 229
    :goto_9c
    iget-object v1, p0, Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper$4;->this$0:Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;

    # getter for: Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;->mExternalPermissionListener:Lcom/appcore/utils/permissions/CorePermission$PermissionListener;
    invoke-static {v1}, Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;->access$500(Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;)Lcom/appcore/utils/permissions/CorePermission$PermissionListener;

    move-result-object v1

    if-eqz v1, :cond_b3

    sget v1, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v2, 0x17

    if-lt v1, v2, :cond_b3

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

    # getter for: Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;->mExternalPermissionListener:Lcom/appcore/utils/permissions/CorePermission$PermissionListener;
    invoke-static {v1}, Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;->access$500(Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;)Lcom/appcore/utils/permissions/CorePermission$PermissionListener;

    move-result-object v1

    invoke-interface {v1}, Lcom/appcore/utils/permissions/CorePermission$PermissionListener;->onPermissionAllowed()I

    :cond_b3
    return v0
.end method

.method public onPermissionDenied()V
    .registers 3

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

    move-result v0

    if-eqz v0, :cond_13

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

    if-eqz v0, :cond_13

    const-string v0, "Location Permission: Denied Without Never Ask Again"

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

    move-result-object v0

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

    .line 240
    :cond_13
    invoke-static {}, Lhurriyet/mobil/android/hurriyet/utils/HurriyetHelper;->startCountingCheckpointDate()V

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

    # getter for: Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;->mExternalPermissionListener:Lcom/appcore/utils/permissions/CorePermission$PermissionListener;
    invoke-static {v0}, Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;->access$500(Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;)Lcom/appcore/utils/permissions/CorePermission$PermissionListener;

    move-result-object v0

    if-eqz v0, :cond_2d

    sget v0, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v1, 0x17

    if-lt v0, v1, :cond_2d

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

    # getter for: Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;->mExternalPermissionListener:Lcom/appcore/utils/permissions/CorePermission$PermissionListener;
    invoke-static {v0}, Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;->access$500(Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;)Lcom/appcore/utils/permissions/CorePermission$PermissionListener;

    move-result-object v0

    invoke-interface {v0}, Lcom/appcore/utils/permissions/CorePermission$PermissionListener;->onPermissionDenied()V

    :cond_2d
    return-void
.end method

.method public onPermissionDeniedWithNeverAsk()V
    .registers 3

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

    move-result v0

    if-eqz v0, :cond_13

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

    if-eqz v0, :cond_13

    const-string v0, "Location Permission: Denied With Never Ask Again"

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

    move-result-object v0

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

    :cond_13
    const/4 v0, 0x1

    .line 252
    invoke-static {v0}, Lhurriyet/mobil/android/hurriyet/utils/SharedPreferencesHelper;->setNeverAskAgainCheckedBefore(Z)V

    const-wide/16 v0, -0x1

    .line 253
    invoke-static {v0, v1}, Lhurriyet/mobil/android/hurriyet/utils/SharedPreferencesHelper;->setLocationCheckpointDate(J)V

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

    # getter for: Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;->mExternalPermissionListener:Lcom/appcore/utils/permissions/CorePermission$PermissionListener;
    invoke-static {v0}, Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;->access$500(Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;)Lcom/appcore/utils/permissions/CorePermission$PermissionListener;

    move-result-object v0

    if-eqz v0, :cond_33

    sget v0, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v1, 0x17

    if-lt v0, v1, :cond_33

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

    # getter for: Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;->mExternalPermissionListener:Lcom/appcore/utils/permissions/CorePermission$PermissionListener;
    invoke-static {v0}, Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;->access$500(Lhurriyet/mobil/android/hurriyet/utils/HurriyetLocationHelper;)Lcom/appcore/utils/permissions/CorePermission$PermissionListener;

    move-result-object v0

    invoke-interface {v0}, Lcom/appcore/utils/permissions/CorePermission$PermissionListener;->onPermissionDeniedWithNeverAsk()V

    :cond_33
    return-void
.end method