summaryrefslogtreecommitdiff
path: root/apps/menus
diff options
context:
space:
mode:
authorSebastian Leonhardt <sebastian.leonhardt@web.de>2016-10-01 21:53:31 +0200
committerSolomon Peachy <pizza@shaftnet.org>2019-02-07 23:06:54 +0100
commit1c095a1323b042d703729e4d6b11a29e143df395 (patch)
tree58d48ccd0155071391dee7f6892c53dfa663b66a /apps/menus
parent053c4d0593ea1dc5974bf0cc4c08ffc3db65c30e (diff)
YH-820: prohibit to change time/date on some hardware versions
This patch will autodetect these players, where setting the time/date would leave the player in an unusable state. Change-Id: I0579610ce7c10152ace27bb9c06cf6cb2aab8052
Diffstat (limited to 'apps/menus')
-rw-r--r--apps/menus/time_menu.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/apps/menus/time_menu.c b/apps/menus/time_menu.c
index 93ca786cea..94e19b06aa 100644
--- a/apps/menus/time_menu.c
+++ b/apps/menus/time_menu.c
@@ -43,6 +43,10 @@
#include "font.h"
#include "system.h"
+#ifdef SAMSUNG_YH820
+#include "splash.h"
+#endif
+
static int timedate_set(void)
{
/* Make a local copy of the time struct */
@@ -280,6 +284,20 @@ int time_screen(void* ignored)
draw_timedate(&clock_vps[i], &screens[i]);
}
+#ifdef SAMSUNG_YH820
+ /* some hardware revisions of the yh820 have a rtc problem: if you try to set
+ the time/date it will leave the player in an absolute unresponsive state
+ which can only be reverted by removing the battery. Setting time/date
+ should be prohibited on this targets. Fortunately we can autodetect these,
+ because they always report "02:02:02" as time.
+ */
+ struct tm *tm = get_time();
+ if (tm->tm_year==102 && tm->tm_hour==2 && tm->tm_min==2 && tm->tm_sec==2) {
+ splash(4*HZ, "Can't set time/date due to hardware issues!");
+ return 0;
+ }
+#endif
+
ret = do_menu(&time_menu, NULL, menu, false);
pop_current_activity();
/* see comments above in the button callback */