Lines Matching defs:now

443             /* only pick up the first battery for now */
672 static void update_screen_state(struct charger *charger, int64_t now)
678 if (!batt_anim->run || now < charger->next_screen_transition)
686 LOGV("[%lld] animation done\n", now);
697 LOGV("[%lld] animation starting\n", now);
727 LOGV("[%lld] animation missing or unknown battery status\n", now);
728 charger->next_screen_transition = now + BATTERY_UNKNOWN_TIME;
734 charger->next_screen_transition = now + disp_time;
760 int64_t now = curr_time_ms();
773 charger->keys[code].timestamp = now;
777 LOGV("[%lld] key[%d] down\n", now, code);
779 int64_t duration = now - charger->keys[code].timestamp;
782 LOGV("[%lld] key[%d] up (was down for %lld.%lldsec)\n", now,
807 static void process_key(struct charger *charger, int code, int64_t now)
815 if (now >= reboot_timeout) {
816 LOGI("[%lld] rebooting\n", now);
834 static void handle_input_state(struct charger *charger, int64_t now)
836 process_key(charger, KEY_POWER, now);
838 if (charger->next_key_check != -1 && now > charger->next_key_check)
842 static void handle_power_supply_state(struct charger *charger, int64_t now)
846 charger->next_pwr_check = now + UNPLUGGED_SHUTDOWN_TIME;
848 now, UNPLUGGED_SHUTDOWN_TIME, charger->next_pwr_check);
849 } else if (now >= charger->next_pwr_check) {
850 LOGI("[%lld] shutting down\n", now);
858 LOGI("[%lld] device plugged in: shutdown cancelled\n", now);
865 static void wait_next_event(struct charger *charger, int64_t now)
872 LOGV("[%lld] next screen: %lld next key: %lld next pwr: %lld\n", now,
884 timeout = max(0, next_event - now);
887 LOGV("[%lld] blocking (%lld)\n", now, timeout);
911 int64_t now = curr_time_ms();
913 LOGV("[%lld] event_loop()\n", now);
914 handle_input_state(charger, now);
915 handle_power_supply_state(charger, now);
920 update_screen_state(charger, now);
922 wait_next_event(charger, now);
930 int64_t now = curr_time_ms() - 1;
979 charger->next_screen_transition = now - 1;