diff options
Diffstat (limited to 'src/com/android/deskclock/provider/Alarm.java')
| -rw-r--r-- | src/com/android/deskclock/provider/Alarm.java | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/com/android/deskclock/provider/Alarm.java b/src/com/android/deskclock/provider/Alarm.java index 0d5a726f0..680f70d05 100644 --- a/src/com/android/deskclock/provider/Alarm.java +++ b/src/com/android/deskclock/provider/Alarm.java @@ -35,6 +35,7 @@ import com.android.deskclock.data.Weekdays; import java.util.Calendar; import java.util.LinkedList; import java.util.List; +import java.util.UUID; public final class Alarm implements Parcelable, ClockContract.AlarmsColumns { /** @@ -59,7 +60,8 @@ public final class Alarm implements Parcelable, ClockContract.AlarmsColumns { VIBRATE, LABEL, RINGTONE, - DELETE_AFTER_USE + DELETE_AFTER_USE, + INCREASING_VOLUME, }; private static final String[] QUERY_ALARMS_WITH_INSTANCES_COLUMNS = { @@ -72,6 +74,7 @@ public final class Alarm implements Parcelable, ClockContract.AlarmsColumns { ClockDatabaseHelper.ALARMS_TABLE_NAME + "." + LABEL, ClockDatabaseHelper.ALARMS_TABLE_NAME + "." + RINGTONE, ClockDatabaseHelper.ALARMS_TABLE_NAME + "." + DELETE_AFTER_USE, + ClockDatabaseHelper.ALARMS_TABLE_NAME + "." + INCREASING_VOLUME, ClockDatabaseHelper.INSTANCES_TABLE_NAME + "." + ClockContract.InstancesColumns.ALARM_STATE, ClockDatabaseHelper.INSTANCES_TABLE_NAME + "." + ClockContract.InstancesColumns._ID, @@ -97,6 +100,8 @@ public final class Alarm implements Parcelable, ClockContract.AlarmsColumns { private static final int LABEL_INDEX = 6; private static final int RINGTONE_INDEX = 7; private static final int DELETE_AFTER_USE_INDEX = 8; + private static final int INCREASING_VOLUME_INDEX = 9; + private static final int INSTANCE_STATE_INDEX = 9; public static final int INSTANCE_ID_INDEX = 10; public static final int INSTANCE_YEAR_INDEX = 11; @@ -107,7 +112,7 @@ public final class Alarm implements Parcelable, ClockContract.AlarmsColumns { public static final int INSTANCE_LABEL_INDEX = 16; public static final int INSTANCE_VIBRATE_INDEX = 17; - private static final int COLUMN_COUNT = DELETE_AFTER_USE_INDEX + 1; + private static final int COLUMN_COUNT = INCREASING_VOLUME_INDEX + 1; private static final int ALARM_JOIN_INSTANCE_COLUMN_COUNT = INSTANCE_VIBRATE_INDEX + 1; public static ContentValues createContentValues(Alarm alarm) { @@ -123,6 +128,7 @@ public final class Alarm implements Parcelable, ClockContract.AlarmsColumns { values.put(VIBRATE, alarm.vibrate ? 1 : 0); values.put(LABEL, alarm.label); values.put(DELETE_AFTER_USE, alarm.deleteAfterUse); + values.put(INCREASING_VOLUME, alarm.increasingVolume ? 1 : 0); if (alarm.alert == null) { // We want to put null, so default alarm changes values.putNull(RINGTONE); @@ -284,6 +290,7 @@ public final class Alarm implements Parcelable, ClockContract.AlarmsColumns { public String label; public Uri alert; public boolean deleteAfterUse; + public boolean increasingVolume; public int instanceState; public int instanceId; @@ -301,6 +308,7 @@ public final class Alarm implements Parcelable, ClockContract.AlarmsColumns { this.label = ""; this.alert = DataModel.getDataModel().getDefaultAlarmRingtoneUri(); this.deleteAfterUse = false; + this.increasingVolume = false; } public Alarm(Cursor c) { @@ -312,6 +320,7 @@ public final class Alarm implements Parcelable, ClockContract.AlarmsColumns { vibrate = c.getInt(VIBRATE_INDEX) == 1; label = c.getString(LABEL_INDEX); deleteAfterUse = c.getInt(DELETE_AFTER_USE_INDEX) == 1; + increasingVolume = c.getInt(INCREASING_VOLUME_INDEX) == 1; if (c.getColumnCount() == ALARM_JOIN_INSTANCE_COLUMN_COUNT) { instanceState = c.getInt(INSTANCE_STATE_INDEX); @@ -337,6 +346,7 @@ public final class Alarm implements Parcelable, ClockContract.AlarmsColumns { label = p.readString(); alert = p.readParcelable(null); deleteAfterUse = p.readInt() == 1; + increasingVolume = p.readInt() == 1; } /** @@ -371,6 +381,7 @@ public final class Alarm implements Parcelable, ClockContract.AlarmsColumns { p.writeString(label); p.writeParcelable(alert, flags); p.writeInt(deleteAfterUse ? 1 : 0); + p.writeInt(increasingVolume ? 1 : 0); } public int describeContents() { @@ -383,6 +394,7 @@ public final class Alarm implements Parcelable, ClockContract.AlarmsColumns { result.mVibrate = vibrate; result.mLabel = label; result.mRingtone = alert; + result.mIncreasingVolume = increasingVolume; return result; } @@ -463,6 +475,7 @@ public final class Alarm implements Parcelable, ClockContract.AlarmsColumns { ", vibrate=" + vibrate + ", label='" + label + '\'' + ", deleteAfterUse=" + deleteAfterUse + + ", increasingVolume=" + increasingVolume + '}'; } } |
