Пример #1
0
static void mce_call_state_ind(const DsmeDbusMessage* ind)
{
  static bool emergency_call_started = false;

  if (strcmp(dsme_dbus_message_get_string(ind), "none"     ) != 0 &&
      strcmp(dsme_dbus_message_get_string(ind), "emergency") == 0)
  {
      /* there is an emergency call going on */
      send_emergency_call_status(true);

      emergency_call_started = true;
      dsme_log(LOG_DEBUG, "Emergency call started");

  } else if (emergency_call_started) {
      /* the emergency call is over */
      send_emergency_call_status(false);

      emergency_call_started = false;
      dsme_log(LOG_DEBUG, "Emergency call is over");
  }
}
Пример #2
0
static void connman_tethering_changed(const DsmeDbusMessage* sig)
{
    bool tethering;

    if (strcmp(dsme_dbus_message_get_string(sig), "Tethering") == 0)
    {
        tethering = dsme_dbus_message_get_variant_bool(sig);
        dsme_log(LOG_DEBUG, "wlanloader: Tethering status changed to %d",
                                         tethering);

        if (!tethering) {
            reset_wlan_module();
        }
    }
}
Пример #3
0
static void usb_state_ind(const DsmeDbusMessage* ind)
{
    static bool mounted_to_pc_new = false;
    static bool charger_connected_new = false;
    const char* state         = dsme_dbus_message_get_string(ind);

    // dsme_log(LOG_DEBUG, "usbtracker: %s(state = %s)",__FUNCTION__, state);

    if (strcmp(state, "mass_storage") == 0 ||
            strcmp(state, "data_in_use" ) == 0 ||
            strcmp(state, "pc_suite" ) == 0)
    {
        mounted_to_pc_new = true;
    }
    if (strcmp(state, "USB connected") == 0 ||
            strcmp(state, "charger_connected") == 0 )
        charger_connected_new = true;
    else if (strcmp(state, "USB disconnected") == 0 ||
             strcmp(state, "charger_disconnected") == 0 )
    {
        charger_connected_new = false;
        mounted_to_pc_new = false;
    }

    if (mounted_to_pc != mounted_to_pc_new)
    {
        mounted_to_pc = mounted_to_pc_new;
        send_usb_status(mounted_to_pc);
    }

    if (charger_connected != charger_connected_new)
    {
        charger_connected = charger_connected_new;
        send_charger_status(charger_connected);
    }

}