.class public final Lcom/moji/alarm/clock/AlarmClockData;
.super Ljava/lang/Object;
.source "AlarmClockData.java"

# interfaces
.implements Landroid/os/Parcelable;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/moji/alarm/clock/AlarmClockData$DaysOfWeek;
    }
.end annotation


# static fields
.field public static final ALARM_INTENT_EXTRA:Ljava/lang/String; = "intent.extra.alarm"

.field public static final CREATOR:Landroid/os/Parcelable$Creator;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Landroid/os/Parcelable$Creator<",
            "Lcom/moji/alarm/clock/AlarmClockData;",
            ">;"
        }
    .end annotation
.end field

.field private static final DAYS_OF_WEEK_EVERYDAY:I = 0x7f

.field private static final DAYS_OF_WEEK_NO_DAY:I = 0x0

.field private static final DAYS_OF_WEEK_WEEKEND:I = 0x60

.field private static final DAYS_OF_WEEK_WORKING_DAY:I = 0x1f

.field private static final TAG:Ljava/lang/String; = "AlarmClockData"


# instance fields
.field public AlarmAlertActivity:Ljava/lang/String;

.field public AlarmAlertFullScreenActivity:Ljava/lang/String;

.field public daysOfWeek:Lcom/moji/alarm/clock/AlarmClockData$DaysOfWeek;

.field public enabled:Z

.field public hour:I

.field public id:I

.field public label:Ljava/lang/String;

.field public minutes:I

.field public time:J

.field public vibrate:Z


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .line 23
    new-instance v0, Lcom/moji/alarm/clock/AlarmClockData$1;

    invoke-direct {v0}, Lcom/moji/alarm/clock/AlarmClockData$1;-><init>()V

    sput-object v0, Lcom/moji/alarm/clock/AlarmClockData;->CREATOR:Landroid/os/Parcelable$Creator;

    return-void
.end method

.method public constructor <init>()V
    .locals 5

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

    const/4 v0, -0x1

    .line 103
    iput v0, p0, Lcom/moji/alarm/clock/AlarmClockData;->id:I

    .line 104
    invoke-static {}, Ljava/util/Calendar;->getInstance()Ljava/util/Calendar;

    move-result-object v0

    .line 105
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v1

    invoke-virtual {v0, v1, v2}, Ljava/util/Calendar;->setTimeInMillis(J)V

    const/16 v1, 0xb

    .line 106
    invoke-virtual {v0, v1}, Ljava/util/Calendar;->get(I)I

    move-result v1

    iput v1, p0, Lcom/moji/alarm/clock/AlarmClockData;->hour:I

    const/16 v1, 0xc

    .line 107
    invoke-virtual {v0, v1}, Ljava/util/Calendar;->get(I)I

    move-result v1

    iput v1, p0, Lcom/moji/alarm/clock/AlarmClockData;->minutes:I

    const/4 v1, 0x0

    .line 108
    iput-boolean v1, p0, Lcom/moji/alarm/clock/AlarmClockData;->vibrate:Z

    const/4 v1, 0x7

    .line 110
    invoke-virtual {v0, v1}, Ljava/util/Calendar;->get(I)I

    move-result v0

    .line 111
    sget-object v2, Lcom/moji/alarm/clock/AlarmClockData;->TAG:Ljava/lang/String;

    new-instance v3, Ljava/lang/StringBuilder;

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

    const-string v4, "week ="

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

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

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

    move-result-object v3

    invoke-static {v2, v3}, Lcom/moji/tool/log/MJLogger;->b(Ljava/lang/String;Ljava/lang/String;)V

    if-eq v0, v1, :cond_1

    const/4 v1, 0x1

    if-ne v0, v1, :cond_0

    goto :goto_0

    .line 115
    :cond_0
    new-instance v0, Lcom/moji/alarm/clock/AlarmClockData$DaysOfWeek;

    const/16 v1, 0x1f

    invoke-direct {v0, v1}, Lcom/moji/alarm/clock/AlarmClockData$DaysOfWeek;-><init>(I)V

    iput-object v0, p0, Lcom/moji/alarm/clock/AlarmClockData;->daysOfWeek:Lcom/moji/alarm/clock/AlarmClockData$DaysOfWeek;

    goto :goto_1

    .line 113
    :cond_1
    :goto_0
    new-instance v0, Lcom/moji/alarm/clock/AlarmClockData$DaysOfWeek;

    const/16 v1, 0x60

    invoke-direct {v0, v1}, Lcom/moji/alarm/clock/AlarmClockData$DaysOfWeek;-><init>(I)V

    iput-object v0, p0, Lcom/moji/alarm/clock/AlarmClockData;->daysOfWeek:Lcom/moji/alarm/clock/AlarmClockData$DaysOfWeek;

    :goto_1
    const-string v0, ""

    .line 117
    iput-object v0, p0, Lcom/moji/alarm/clock/AlarmClockData;->label:Ljava/lang/String;

    const-string v0, ""

    .line 118
    iput-object v0, p0, Lcom/moji/alarm/clock/AlarmClockData;->AlarmAlertActivity:Ljava/lang/String;

    const-string v0, ""

    .line 119
    iput-object v0, p0, Lcom/moji/alarm/clock/AlarmClockData;->AlarmAlertFullScreenActivity:Ljava/lang/String;

    return-void
.end method

.method public constructor <init>(Landroid/database/Cursor;)V
    .locals 1

    const/4 v0, 0x0

    .line 86
    invoke-direct {p0, p1, v0}, Lcom/moji/alarm/clock/AlarmClockData;-><init>(Landroid/database/Cursor;Z)V

    return-void
.end method

.method public constructor <init>(Landroid/database/Cursor;Z)V
    .locals 5

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

    const/4 v0, 0x0

    .line 68
    invoke-interface {p1, v0}, Landroid/database/Cursor;->getInt(I)I

    move-result v1

    iput v1, p0, Lcom/moji/alarm/clock/AlarmClockData;->id:I

    const/4 v1, 0x5

    .line 69
    invoke-interface {p1, v1}, Landroid/database/Cursor;->getInt(I)I

    move-result v1

    const/4 v2, 0x1

    if-ne v1, v2, :cond_0

    const/4 v1, 0x1

    goto :goto_0

    :cond_0
    const/4 v1, 0x0

    :goto_0
    iput-boolean v1, p0, Lcom/moji/alarm/clock/AlarmClockData;->enabled:Z

    .line 70
    invoke-interface {p1, v2}, Landroid/database/Cursor;->getInt(I)I

    move-result v1

    iput v1, p0, Lcom/moji/alarm/clock/AlarmClockData;->hour:I

    const/4 v1, 0x2

    .line 71
    invoke-interface {p1, v1}, Landroid/database/Cursor;->getInt(I)I

    move-result v1

    iput v1, p0, Lcom/moji/alarm/clock/AlarmClockData;->minutes:I

    .line 72
    new-instance v1, Lcom/moji/alarm/clock/AlarmClockData$DaysOfWeek;

    const/4 v3, 0x3

    invoke-interface {p1, v3}, Landroid/database/Cursor;->getInt(I)I

    move-result v3

    invoke-direct {v1, v3}, Lcom/moji/alarm/clock/AlarmClockData$DaysOfWeek;-><init>(I)V

    iput-object v1, p0, Lcom/moji/alarm/clock/AlarmClockData;->daysOfWeek:Lcom/moji/alarm/clock/AlarmClockData$DaysOfWeek;

    const/4 v1, 0x4

    .line 73
    invoke-interface {p1, v1}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v3

    iput-wide v3, p0, Lcom/moji/alarm/clock/AlarmClockData;->time:J

    const/4 v1, 0x6

    .line 74
    invoke-interface {p1, v1}, Landroid/database/Cursor;->getInt(I)I

    move-result v1

    if-ne v1, v2, :cond_1

    const/4 v0, 0x1

    :cond_1
    iput-boolean v0, p0, Lcom/moji/alarm/clock/AlarmClockData;->vibrate:Z

    const/4 v0, 0x7

    .line 75
    invoke-interface {p1, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/moji/alarm/clock/AlarmClockData;->label:Ljava/lang/String;

    if-nez p2, :cond_2

    const/16 p2, 0x8

    .line 77
    invoke-interface {p1, p2}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object p2

    iput-object p2, p0, Lcom/moji/alarm/clock/AlarmClockData;->AlarmAlertActivity:Ljava/lang/String;

    const/16 p2, 0x9

    .line 78
    invoke-interface {p1, p2}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object p1

    iput-object p1, p0, Lcom/moji/alarm/clock/AlarmClockData;->AlarmAlertFullScreenActivity:Ljava/lang/String;

    goto :goto_1

    :cond_2
    const-string p1, ""

    .line 80
    iput-object p1, p0, Lcom/moji/alarm/clock/AlarmClockData;->AlarmAlertActivity:Ljava/lang/String;

    const-string p1, ""

    .line 81
    iput-object p1, p0, Lcom/moji/alarm/clock/AlarmClockData;->AlarmAlertFullScreenActivity:Ljava/lang/String;

    :goto_1
    return-void
.end method

.method public constructor <init>(Landroid/os/Parcel;)V
    .locals 5

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

    .line 90
    invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I

    move-result v0

    iput v0, p0, Lcom/moji/alarm/clock/AlarmClockData;->id:I

    .line 91
    invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I

    move-result v0

    const/4 v1, 0x0

    const/4 v2, 0x1

    if-ne v0, v2, :cond_0

    const/4 v0, 0x1

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    :goto_0
    iput-boolean v0, p0, Lcom/moji/alarm/clock/AlarmClockData;->enabled:Z

    .line 92
    invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I

    move-result v0

    iput v0, p0, Lcom/moji/alarm/clock/AlarmClockData;->hour:I

    .line 93
    invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I

    move-result v0

    iput v0, p0, Lcom/moji/alarm/clock/AlarmClockData;->minutes:I

    .line 94
    new-instance v0, Lcom/moji/alarm/clock/AlarmClockData$DaysOfWeek;

    invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I

    move-result v3

    invoke-direct {v0, v3}, Lcom/moji/alarm/clock/AlarmClockData$DaysOfWeek;-><init>(I)V

    iput-object v0, p0, Lcom/moji/alarm/clock/AlarmClockData;->daysOfWeek:Lcom/moji/alarm/clock/AlarmClockData$DaysOfWeek;

    .line 95
    invoke-virtual {p1}, Landroid/os/Parcel;->readLong()J

    move-result-wide v3

    iput-wide v3, p0, Lcom/moji/alarm/clock/AlarmClockData;->time:J

    .line 96
    invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I

    move-result v0

    if-ne v0, v2, :cond_1

    const/4 v1, 0x1

    :cond_1
    iput-boolean v1, p0, Lcom/moji/alarm/clock/AlarmClockData;->vibrate:Z

    .line 97
    invoke-virtual {p1}, Landroid/os/Parcel;->readString()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/moji/alarm/clock/AlarmClockData;->label:Ljava/lang/String;

    .line 98
    invoke-virtual {p1}, Landroid/os/Parcel;->readString()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/moji/alarm/clock/AlarmClockData;->AlarmAlertActivity:Ljava/lang/String;

    .line 99
    invoke-virtual {p1}, Landroid/os/Parcel;->readString()Ljava/lang/String;

    move-result-object p1

    iput-object p1, p0, Lcom/moji/alarm/clock/AlarmClockData;->AlarmAlertFullScreenActivity:Ljava/lang/String;

    return-void
.end method


# virtual methods
.method public describeContents()I
    .locals 1

    const/4 v0, 0x0

    return v0
.end method

.method public getLabelOrDefault(Landroid/content/Context;)Ljava/lang/String;
    .locals 1

    .line 128
    iget-object v0, p0, Lcom/moji/alarm/clock/AlarmClockData;->label:Ljava/lang/String;

    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 129
    sget v0, Lcom/moji/alarm/R$string;->default_label:I

    invoke-virtual {p1, v0}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object p1

    return-object p1

    .line 131
    :cond_0
    iget-object p1, p0, Lcom/moji/alarm/clock/AlarmClockData;->label:Ljava/lang/String;

    return-object p1
.end method

.method public toString()Ljava/lang/String;
    .locals 3

    .line 250
    new-instance v0, Ljava/lang/StringBuilder;

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

    const-string v1, "label="

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

    iget-object v1, p0, Lcom/moji/alarm/clock/AlarmClockData;->label:Ljava/lang/String;

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

    const-string v1, "--id="

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

    iget v1, p0, Lcom/moji/alarm/clock/AlarmClockData;->id:I

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v1, "--enabled ="

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

    iget-boolean v1, p0, Lcom/moji/alarm/clock/AlarmClockData;->enabled:Z

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    const-string v1, "--hour ="

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

    iget v1, p0, Lcom/moji/alarm/clock/AlarmClockData;->hour:I

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v1, "--minute="

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

    iget v1, p0, Lcom/moji/alarm/clock/AlarmClockData;->minutes:I

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v1, "--time ="

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

    iget-wide v1, p0, Lcom/moji/alarm/clock/AlarmClockData;->time:J

    invoke-virtual {v0, v1, v2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

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

    move-result-object v0

    return-object v0
.end method

.method public writeToParcel(Landroid/os/Parcel;I)V
    .locals 2

    .line 38
    iget p2, p0, Lcom/moji/alarm/clock/AlarmClockData;->id:I

    invoke-virtual {p1, p2}, Landroid/os/Parcel;->writeInt(I)V

    .line 39
    iget-boolean p2, p0, Lcom/moji/alarm/clock/AlarmClockData;->enabled:Z

    invoke-virtual {p1, p2}, Landroid/os/Parcel;->writeInt(I)V

    .line 40
    iget p2, p0, Lcom/moji/alarm/clock/AlarmClockData;->hour:I

    invoke-virtual {p1, p2}, Landroid/os/Parcel;->writeInt(I)V

    .line 41
    iget p2, p0, Lcom/moji/alarm/clock/AlarmClockData;->minutes:I

    invoke-virtual {p1, p2}, Landroid/os/Parcel;->writeInt(I)V

    .line 42
    iget-object p2, p0, Lcom/moji/alarm/clock/AlarmClockData;->daysOfWeek:Lcom/moji/alarm/clock/AlarmClockData$DaysOfWeek;

    invoke-virtual {p2}, Lcom/moji/alarm/clock/AlarmClockData$DaysOfWeek;->a()I

    move-result p2

    invoke-virtual {p1, p2}, Landroid/os/Parcel;->writeInt(I)V

    .line 43
    iget-wide v0, p0, Lcom/moji/alarm/clock/AlarmClockData;->time:J

    invoke-virtual {p1, v0, v1}, Landroid/os/Parcel;->writeLong(J)V

    .line 44
    iget-boolean p2, p0, Lcom/moji/alarm/clock/AlarmClockData;->vibrate:Z

    invoke-virtual {p1, p2}, Landroid/os/Parcel;->writeInt(I)V

    .line 45
    iget-object p2, p0, Lcom/moji/alarm/clock/AlarmClockData;->label:Ljava/lang/String;

    invoke-virtual {p1, p2}, Landroid/os/Parcel;->writeString(Ljava/lang/String;)V

    .line 46
    iget-object p2, p0, Lcom/moji/alarm/clock/AlarmClockData;->AlarmAlertActivity:Ljava/lang/String;

    invoke-virtual {p1, p2}, Landroid/os/Parcel;->writeString(Ljava/lang/String;)V

    .line 47
    iget-object p2, p0, Lcom/moji/alarm/clock/AlarmClockData;->AlarmAlertFullScreenActivity:Ljava/lang/String;

    invoke-virtual {p1, p2}, Landroid/os/Parcel;->writeString(Ljava/lang/String;)V

    return-void
.end method
