protected static List<Action> getAlarmActions(
      SleepAsAndroidConstants.SLEEP_AS_ANDROID_ALARM_EVENT event) throws Exception {
    ArrayList<Action> actions = new ArrayList<>();

    String[] columns = {
      SleepAsAndroidActionTable.COLUMN_ALARM_TYPE_ID, SleepAsAndroidActionTable.COLUMN_ACTION_ID
    };
    Cursor cursor =
        DatabaseHandler.database.query(
            SleepAsAndroidActionTable.TABLE_NAME,
            columns,
            SleepAsAndroidActionTable.COLUMN_ALARM_TYPE_ID + "==" + event.getId(),
            null,
            null,
            null,
            null);
    cursor.moveToFirst();

    while (!cursor.isAfterLast()) {
      Long actionId = cursor.getLong(1);
      actions.add(ActionHandler.get(actionId));
      cursor.moveToNext();
    }

    cursor.close();
    return actions;
  }
  private static void addAlarmActions(
      SleepAsAndroidConstants.SLEEP_AS_ANDROID_ALARM_EVENT event, ArrayList<Action> actions)
      throws Exception {
    // add actions to database
    ArrayList<Long> actionIds = ActionHandler.add(actions);

    // add AlarmTriggered <-> action relation
    for (Long actionId : actionIds) {
      ContentValues values = new ContentValues();
      values.put(SleepAsAndroidActionTable.COLUMN_ALARM_TYPE_ID, event.getId());
      values.put(SleepAsAndroidActionTable.COLUMN_ACTION_ID, actionId);
      DatabaseHandler.database.insert(SleepAsAndroidActionTable.TABLE_NAME, null, values);
    }
  }