Ignore:
Timestamp:
07/29/06 00:53:01 (18 years ago)
Author:
Nicholas Riley
Message:

Better alarm debug description, datastore debugging; use absolute fire time for snoozed alarms too; replace the buggy alarm stack and misaligned sleep message with a painfully constructed alert.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/hiptop/pester/net/sabi/pester/Alarm.java

    r295 r296  
    3131    // transient
    3232    private int mState;
    33     private int mAbsoluteFireTime; // valid if periodic and modified since reboot
     33    private int mAbsoluteFireTime; // valid if periodic or snoozed,
     34                                   // and modified since reboot
    3435    private danger.app.Alarm mAlarm;
    3536    private int mUID;
     
    155156        if (mState != STATE_SCHEDULED)
    156157            return;
    157         if (getUsesPeriod() && mAbsoluteFireTime != -1) {
     158        if (mAbsoluteFireTime != -1) {
    158159            int realSecondsLeft = mAbsoluteFireTime - Hardware.getAbsoluteTime();
    159160            mDate = new Date();
     
    200201    public String description() {
    201202        StringBuffer sb = new StringBuffer();
     203        if (mUID != 0) sb.append('(').append(mUID).append(") ");
    202204        switch (mState) {
    203         case STATE_INVALID: sb.append("invalid "); break;
    204         case STATE_EDITING: sb.append("editing "); break;
    205         case STATE_SCHEDULED: sb.append("scheduled "); break;
     205        case STATE_INVALID: sb.append("inv "); break;
     206        case STATE_EDITING: sb.append("edi "); break;
     207        case STATE_SCHEDULED: sb.append("sch "); break;
    206208        }
    207209        switch (mType) {
     210        case TYPE_PERIODIC_REPEATING:
     211            sb.append("r-");
    208212        case TYPE_PERIODIC:
    209             sb.append("periodic (").append(mPeriod).append("s) "); break;
    210         case TYPE_PERIODIC_REPEATING:
    211             sb.append("repeating periodic (").append(mPeriod).append("s) ");
    212             break;
     213            sb.append("per(").append(mPeriod).append("s)");
     214            if (mState != STATE_SCHEDULED)
     215                break;
    213216        case TYPE_DATE:
    214             sb.append("date (").append(getDateTimeString()).append(") "); break;
    215         }
    216         sb.append("alarm: ");
     217            sb.append("(").append(getDateTimeString()).append(")"); break;
     218        }
     219        sb.append(": ");
    217220        sb.append('"').append(mMessage).append('"');
    218221        return sb.toString();
Note: See TracChangeset for help on using the changeset viewer.