From b634ca8f5f01e7e85f6006bfd9eaa15f8eca0aea Mon Sep 17 00:00:00 2001 From: Jungshik Jang Date: Mon, 4 Aug 2014 16:27:48 +0900 Subject: [PATCH] Fix several bugs on timer recoder code. Change-Id: I331d5c61fa11513584c926fdeea55a5d7adbbad9 --- .../hardware/hdmi/HdmiTimerRecordSources.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/core/java/android/hardware/hdmi/HdmiTimerRecordSources.java b/core/java/android/hardware/hdmi/HdmiTimerRecordSources.java index 01b4dd3b269e8..db2d6d8703c1e 100644 --- a/core/java/android/hardware/hdmi/HdmiTimerRecordSources.java +++ b/core/java/android/hardware/hdmi/HdmiTimerRecordSources.java @@ -142,34 +142,34 @@ public class HdmiTimerRecordSources { /** * Create {@link Duration} for time value. * - * @param hour hour in range of [0, 24] + * @param hour hour in range of [0, 23] * @param minute minute in range of [0, 60] * @return {@link Duration} * @throws IllegalArgumentException if hour or minute is out of range */ - public static Time ofTime(int hour, int minute) { + public static Time timeOf(int hour, int minute) { checkTimeValue(hour, minute); return new Time(hour, minute); } private static void checkTimeValue(int hour, int minute) { - if (hour < 0 || hour > 24) { - throw new IllegalArgumentException("Hour should be in rage of [0, 24]:" + hour); + if (hour < 0 || hour > 23) { + throw new IllegalArgumentException("Hour should be in rage of [0, 23]:" + hour); } - if (minute < 0 || minute > 60) { - throw new IllegalArgumentException("Minute should be in rage of [0, 60]:" + minute); + if (minute < 0 || minute > 59) { + throw new IllegalArgumentException("Minute should be in rage of [0, 59]:" + minute); } } /** * Create {@link Duration} for duration value. * - * @param hour hour in range of [0, 90] - * @param minute minute in range of [0, 60] + * @param hour hour in range of [0, 99] + * @param minute minute in range of [0, 59] * @return {@link Duration} * @throws IllegalArgumentException if hour or minute is out of range */ - public static Duration ofDuration(int hour, int minute) { + public static Duration durationOf(int hour, int minute) { checkDurationValue(hour, minute); return new Duration(hour, minute); } @@ -178,8 +178,8 @@ public class HdmiTimerRecordSources { if (hour < 0 || hour > 99) { throw new IllegalArgumentException("Hour should be in rage of [0, 99]:" + hour); } - if (minute < 0 || minute > 60) { - throw new IllegalArgumentException("minute should be in rage of [0, 60]:" + minute); + if (minute < 0 || minute > 59) { + throw new IllegalArgumentException("minute should be in rage of [0, 59]:" + minute); } }