Lines Matching refs:now

463             /* only pick up the first battery for now */
692 static void update_screen_state(struct charger *charger, int64_t now)
698 if (!batt_anim->run || now < charger->next_screen_transition)
706 LOGV("[%lld] animation done\n", now);
719 LOGV("[%lld] animation starting\n", now);
749 LOGV("[%lld] animation missing or unknown battery status\n", now);
750 charger->next_screen_transition = now + BATTERY_UNKNOWN_TIME;
756 charger->next_screen_transition = now + disp_time;
782 int64_t now = curr_time_ms();
795 charger->keys[code].timestamp = now;
799 LOGV("[%lld] key[%d] down\n", now, code);
801 int64_t duration = now - charger->keys[code].timestamp;
804 LOGV("[%lld] key[%d] up (was down for %lld.%lldsec)\n", now,
829 static void process_key(struct charger *charger, int code, int64_t now)
837 if (now >= reboot_timeout) {
838 LOGI("[%lld] rebooting\n", now);
858 static void handle_input_state(struct charger *charger, int64_t now)
860 process_key(charger, KEY_POWER, now);
862 if (charger->next_key_check != -1 && now > charger->next_key_check)
866 static void handle_power_supply_state(struct charger *charger, int64_t now)
871 charger->next_pwr_check = now + UNPLUGGED_SHUTDOWN_TIME;
873 now, UNPLUGGED_SHUTDOWN_TIME, charger->next_pwr_check);
874 } else if (now >= charger->next_pwr_check) {
875 LOGI("[%lld] shutting down\n", now);
883 LOGI("[%lld] device plugged in: shutdown cancelled\n", now);
890 static void wait_next_event(struct charger *charger, int64_t now)
897 LOGV("[%lld] next screen: %lld next key: %lld next pwr: %lld\n", now,
909 timeout = max(0, next_event - now);
912 LOGV("[%lld] blocking (%lld)\n", now, timeout);
936 int64_t now = curr_time_ms();
938 LOGV("[%lld] event_loop()\n", now);
939 handle_input_state(charger, now);
940 handle_power_supply_state(charger, now);
945 update_screen_state(charger, now);
947 wait_next_event(charger, now);
955 int64_t now = curr_time_ms() - 1;
1006 charger->next_screen_transition = now - 1;