FastDateTimeZoneProvider.smali

.class public Lcom/cm/reminder/calendar/utils/FastDateTimeZoneProvider;
.super Ljava/lang/Object;
.source "FastDateTimeZoneProvider.java"

# interfaces
.implements Lorg/joda/time/tz/Provider;


# static fields
.field public static final AVAILABLE_IDS:Ljava/util/Set;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Set",
            "<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method static constructor <clinit>()V
    .registers 2

    .prologue
    .line 13
    new-instance v0, Ljava/util/HashSet;

    invoke-direct {v0}, Ljava/util/HashSet;-><init>()V

    sput-object v0, Lcom/cm/reminder/calendar/utils/FastDateTimeZoneProvider;->AVAILABLE_IDS:Ljava/util/Set;

    .line 16
    sget-object v0, Lcom/cm/reminder/calendar/utils/FastDateTimeZoneProvider;->AVAILABLE_IDS:Ljava/util/Set;

    invoke-static {}, Ljava/util/TimeZone;->getAvailableIDs()[Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Ljava/util/Arrays;->asList([Ljava/lang/Object;)Ljava/util/List;

    move-result-object v1

    invoke-interface {v0, v1}, Ljava/util/Set;->addAll(Ljava/util/Collection;)Z

    .line 17
    return-void
.end method

.method public constructor <init>()V
    .registers 1

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

    return-void
.end method


# virtual methods
.method public getAvailableIDs()Ljava/util/Set;
    .registers 2

    .prologue
    .line 40
    sget-object v0, Lcom/cm/reminder/calendar/utils/FastDateTimeZoneProvider;->AVAILABLE_IDS:Ljava/util/Set;

    return-object v0
.end method

.method public getZone(Ljava/lang/String;)Lorg/joda/time/DateTimeZone;
    .registers 5

    .prologue
    .line 20
    if-nez p1, :cond_5

    .line 21
    sget-object v0, Lorg/joda/time/DateTimeZone;->UTC:Lorg/joda/time/DateTimeZone;

    .line 36
    :goto_4
    return-object v0

    .line 24
    :cond_5
    invoke-static {p1}, Ljava/util/TimeZone;->getTimeZone(Ljava/lang/String;)Ljava/util/TimeZone;

    move-result-object v1

    .line 25
    if-nez v1, :cond_e

    .line 26
    sget-object v0, Lorg/joda/time/DateTimeZone;->UTC:Lorg/joda/time/DateTimeZone;

    goto :goto_4

    .line 29
    :cond_e
    invoke-virtual {v1}, Ljava/util/TimeZone;->getRawOffset()I

    move-result v0

    .line 32
    new-instance v2, Ljava/util/Date;

    invoke-direct {v2}, Ljava/util/Date;-><init>()V

    invoke-virtual {v1, v2}, Ljava/util/TimeZone;->inDaylightTime(Ljava/util/Date;)Z

    move-result v2

    if-eqz v2, :cond_22

    .line 33
    invoke-virtual {v1}, Ljava/util/TimeZone;->getDSTSavings()I

    move-result v1

    add-int/2addr v0, v1

    .line 36
    :cond_22
    invoke-static {v0}, Lorg/joda/time/DateTimeZone;->forOffsetMillis(I)Lorg/joda/time/DateTimeZone;

    move-result-object v0

    goto :goto_4
.end method