I'm not much of an expert here, but it looks like Android 2.3 is using 
/dev/alarm as its RTC interface. See system/core/toolbox/alarm.c 
and frameworks/base/libs/utils/SystemClock.cpp for example. Neither of 
these, however, define functions used to get the current date and time so 
it's not a great answer to your question. Android's AlarmManager uses the 
RTC to wake the device out of sleep at a given time.

gettimeofday() seems to be defined 
here: bionic/libc/arch-arm/syscalls/gettimeofday.S
But that *still* doesn't answer your question. Toolbox's "date" command 
uses a call to time() to get the local time, which must be the same thing 
Android uses. See system/core/toolbox/date.c. But I'm running out of luck 
tracking down the source code for that function call.

HTH to get you started.

 - Topher

On Sunday, June 16, 2013 3:21:50 PM UTC-6, cha...@gmail.com wrote:
>
> Hi All,
> I'm working on porting* android (2.3.3)* to some arm device and on that 
> device I have two different *Real Time Clocks (RTCs)*. First one comes 
> from processor and the second comes from PMIC.
> In my system I see them in the path* /sys/class/rtc/rtc0* 
> and*/sys/class/rtc/rtc1
> *.
>
> On default Android system time is taken from the first RTC (rtc0). What is 
> more, setting time and date in Android Settings changes exactly that clock.
>
> I want to switch it to the second clock. I know how to do it from one 
> direction - how to set system time from rtc1 (compile parameter for 
> kernel), but I don't know how to change RTC standing behind* Settings -> 
> Change Date and Time* option in user interface. In other words, I want to 
> change time and date from user interface of second RTC (rtc1, not rtc0 as 
> in default).
>
> How can I do it?
>
> Thanks for help.
>
> chaqi 
>
>

-- 
-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting

--- 
You received this message because you are subscribed to the Google Groups 
"android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-porting+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to