This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Regarding time in status bar can't update automatically

I had ported Android GingerBread to OMAP 3730 and the system can boot into home screen.

But the time in status bar can't update automatically and the value always be 00:00.

Anyone knows how to solve this issue?

PS. When we rotate the board and the screen will be rotate, then the time can be update once....

  • Hi Lian,

    Could you try setting time maually from settings application ? 

    One time I have faced similar kind of issue

     

    BR,

    satish

  • Hi Lian,

    Not sure whether this will fix the issue, but you can try with the following patch.

     

    diff --git a/services/java/com/android/server/AlarmManagerService.java b/services/java/com/android/server/AlarmManagerService.java
    index 1ad18b8..f8cc857 100644
    --- a/services/java/com/android/server/AlarmManagerService.java
    +++ b/services/java/com/android/server/AlarmManagerService.java
    @@ -651,12 +651,12 @@ class AlarmManagerService extends IAlarmManager.Stub {
                    
                     if ((result & TIME_CHANGED_MASK) != 0) {
                         remove(mTimeTickSender);
    -/*
    +
                         mClockReceiver.scheduleTimeTickEvent();
                         Intent intent = new Intent(Intent.ACTION_TIME_CHANGED);
                         intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING);
                         mContext.sendBroadcast(intent);
    -*/
    +
                     }
                    
                     synchronized (mLock) {

    Regards,

    Pankaj Bharadiya

     

  • hi Pankaj,

    Thanks for your patch and suggestion.

    I had modified the original source code and built it, but the problem still exist.

    So, I tried to change some settings from "Date&Time" option.

    I canceled "Automatic" option and set the current time via "Set time" option, then the time in status bar can be update automatically.

    It's so magic~

    Do you have any ideas for this situation?

    PS. My device has no RTC driver and the start time is always from 00:00 when power on or reboot.

  • hi satish,

    Thanks for your suggestion.

    I set the current time via "Date&Time -> Set Time" option and the time can be update automatically.

    But in my opinion, we don't need to set time every times when we power on or reboot.

    Do you have any idea for this situation?

    BR,

    Lian

  • I saw a similar issue with a 2.3 build on the 3517.  It only seemed to update after the following sequence:

    1.  Build image, make SD card, and boot the board.

    2.  After boot up, set the date and time from settings.

    3.  Hit reset to reset the board.  This keeps the clock.

    4.  When it comes back up, it will update the clock in the notification bar.

    It seems the clock won't update on first boot.

    The problem also seems worse if you are setting a PM time.

    A pre-built image of 2.2 does not have this problem.  I only see it on 2.3.

    Can not build 2.2 as I can't pull a Java1.5 from repositories anymore.

    Seems like a fix is still needed, I can only hope this offers more clues to aid the debug process.

     

  • Hi Bill,

    Thank you for pointing out the issue and giving analysis. 

    We will look into this issue and possibly fix with upcoming devkit release from rowboat.

    BR,

    satish

  • I also note that if you put in the date and time settings in the PM hours, only changing the AM/PM setting will update the status bar clock.  Once you reset, it will update. 

    If you power down the board (EVM3517), you will loose the clock and have to repeat this setup.

     

  • I solve this problem ..

    at "frameworks/base/services/java/com/android/server/AlarmManagerService.java"  on AlarmThread class / run() procedure  

     

    655                     mClockReceiver.scheduleTimeTickEvent();

    /*

    656                     Intent intent = new Intent(Intent.ACTION_TIME_CHANGED);

    657                     intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING);

    658                     mContext.sendBroadcast(intent); 

    */

    on our source these lines are commented-out  by someone ( i didn't find related patch ), i just clear comments on first line and re-compile "services.jar" and then clock work as normal on everywhere.

    Also i checked original source from google res. these lines are not commented.

     

    Mehmet Ugursoy

     

  • Hi Mehmet,

    could you send that patch to http://groups.google.com/group/rowboat?hl=en&pli=1 - rowboat group.

    We will update that patch to rowboat source tree. Thanking you for your contribution.

    -

    satish