From: Joohyun Kim Date: Tue, 19 Mar 2013 08:15:31 +0000 (+0900) Subject: Support millisecond on SystemTime X-Git-Tag: accepted/tizen_2.1/20130425.034849~263 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=44ea839c9facffa09410d85c387e776b81a13347;p=framework%2Fosp%2Fappfw.git Support millisecond on SystemTime Change-Id: I2ca064e6c586882eea1994c88c4b7c1413fa5c0e Signed-off-by: Joohyun Kim --- diff --git a/src/system/FSys_PowerManagerImpl.cpp b/src/system/FSys_PowerManagerImpl.cpp index 65b20b0..21ba9b5 100644 --- a/src/system/FSys_PowerManagerImpl.cpp +++ b/src/system/FSys_PowerManagerImpl.cpp @@ -353,6 +353,7 @@ _PowerManagerImpl::IsActive(void) if(r == E_SUCCESS) { + SysLog(NID_SYS, "current active is:%ls, required:%ls", appId.GetPointer(), _AppInfo::GetApplicationId().GetPointer()); if(appId == _AppInfo::GetApplicationId()) { _activeApp = true; diff --git a/src/system/FSys_SystemTimeImpl.cpp b/src/system/FSys_SystemTimeImpl.cpp index 13b5070..62d6aa1 100644 --- a/src/system/FSys_SystemTimeImpl.cpp +++ b/src/system/FSys_SystemTimeImpl.cpp @@ -78,9 +78,12 @@ _SystemTimeImpl::GetCurrentTime(TimeMode timeMode, DateTime& currentTime) time_t currTime = 0; TimeZone timeZone; DateTime tempTime; + struct timeval currentTimeVal; + _LocaleManagerImpl* plm = null; time(&currTime); + gettimeofday(¤tTimeVal, null); pGmTime = gmtime(&currTime); SysTryReturnResult(NID_SYS, null != pGmTime, E_SYSTEM, "Failed to convert the time value to UTC time"); @@ -96,9 +99,9 @@ _SystemTimeImpl::GetCurrentTime(TimeMode timeMode, DateTime& currentTime) SysLog(NID_SYS, "Time zone: %S, %d, %d", timeZoneId.GetPointer(), rawOffset, dstSavings); - tempTime.SetValue(pGmTime->tm_year + 1900, pGmTime->tm_mon + 1, pGmTime->tm_mday, pGmTime->tm_hour, pGmTime->tm_min, pGmTime->tm_sec); + tempTime.SetValue(pGmTime->tm_year + 1900, pGmTime->tm_mon + 1, pGmTime->tm_mday, pGmTime->tm_hour, pGmTime->tm_min, pGmTime->tm_sec, currentTimeVal.tv_usec / 1000); - SysLog(NID_SYS, "Temp Time %d %d/%d, %d:%d:%d", tempTime.GetYear(), tempTime.GetMonth(), tempTime.GetDay(), tempTime.GetHour(), tempTime.GetMinute(), tempTime.GetSecond()); + SysLog(NID_SYS, "Original Time %d %d/%d, %d:%d:%d:%d", tempTime.GetYear(), tempTime.GetMonth(), tempTime.GetDay(), tempTime.GetHour(), tempTime.GetMinute(), tempTime.GetSecond(), tempTime.GetMillisecond()); switch (timeMode) { @@ -155,7 +158,7 @@ _SystemTimeImpl::SetCurrentTime(const DateTime& currentTime) String commandId = _SYSTEM_COMMAND_CHANGE_TIME ; String dateTime; - sprintf(datetime, "%03d %02d %02d %02d:%02d:%02d", wallTime.GetYear() - 1900, wallTime.GetMonth()-1, wallTime.GetDay(), wallTime.GetHour(), wallTime.GetMinute(), wallTime.GetSecond()); + sprintf(datetime, "%03d %02d %02d %02d:%02d:%02d:%03d", wallTime.GetYear() - 1900, wallTime.GetMonth()-1, wallTime.GetDay(), wallTime.GetHour(), wallTime.GetMinute(), wallTime.GetSecond(), wallTime.GetMillisecond()); dateTime.Append(datetime); requestMessage.Add(serviceId);