/* InstallEnvFlatpak.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from InstallEnvFlatpak.vala, do not modify */

/* -*- Mode: Vala; indent-tabs-mode: nil; tab-width: 2 -*-
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 * SPDX-FileCopyrightText: Michael Terry
 */

#include <glib-object.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "deja.h"
#include <glib/gi18n-lib.h>

#define DEJA_DUP_FLATPAK_AUTOSTART_REQUEST_PORTAL_NAME "org.freedesktop.portal.Desktop"
#define DEJA_DUP_FLATPAK_AUTOSTART_REQUEST_PORTAL_PATH "/org/freedesktop/portal/desktop"
#define DEJA_DUP_FLATPAK_AUTOSTART_REQUEST_REQUEST_IFACE "org.freedesktop.portal.Request"
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

#define TYPE_BACKGROUND_INTERFACE (background_interface_get_type ())
#define BACKGROUND_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BACKGROUND_INTERFACE, BackgroundInterface))
#define IS_BACKGROUND_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BACKGROUND_INTERFACE))
#define BACKGROUND_INTERFACE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_BACKGROUND_INTERFACE, BackgroundInterfaceIface))

typedef struct _BackgroundInterface BackgroundInterface;
typedef struct _BackgroundInterfaceIface BackgroundInterfaceIface;

#define TYPE_BACKGROUND_INTERFACE_PROXY (background_interface_proxy_get_type ())
typedef GDBusProxy BackgroundInterfaceProxy;
typedef GDBusProxyClass BackgroundInterfaceProxyClass;
typedef struct _BackgroundInterfaceRequestBackgroundReadyData BackgroundInterfaceRequestBackgroundReadyData;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))

#define DEJA_DUP_TYPE_INSTALL_ENV_FLATPAK (deja_dup_install_env_flatpak_get_type ())
#define DEJA_DUP_INSTALL_ENV_FLATPAK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DEJA_DUP_TYPE_INSTALL_ENV_FLATPAK, DejaDupInstallEnvFlatpak))
#define DEJA_DUP_INSTALL_ENV_FLATPAK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DEJA_DUP_TYPE_INSTALL_ENV_FLATPAK, DejaDupInstallEnvFlatpakClass))
#define DEJA_DUP_IS_INSTALL_ENV_FLATPAK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DEJA_DUP_TYPE_INSTALL_ENV_FLATPAK))
#define DEJA_DUP_IS_INSTALL_ENV_FLATPAK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DEJA_DUP_TYPE_INSTALL_ENV_FLATPAK))
#define DEJA_DUP_INSTALL_ENV_FLATPAK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DEJA_DUP_TYPE_INSTALL_ENV_FLATPAK, DejaDupInstallEnvFlatpakClass))

typedef struct _DejaDupInstallEnvFlatpak DejaDupInstallEnvFlatpak;
typedef struct _DejaDupInstallEnvFlatpakClass DejaDupInstallEnvFlatpakClass;
typedef struct _DejaDupInstallEnvFlatpakPrivate DejaDupInstallEnvFlatpakPrivate;
enum  {
	DEJA_DUP_INSTALL_ENV_FLATPAK_0_PROPERTY,
	DEJA_DUP_INSTALL_ENV_FLATPAK_NUM_PROPERTIES
};
static GParamSpec* deja_dup_install_env_flatpak_properties[DEJA_DUP_INSTALL_ENV_FLATPAK_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define DEJA_DUP_TYPE_FLATPAK_AUTOSTART_REQUEST (deja_dup_flatpak_autostart_request_get_type ())
#define DEJA_DUP_FLATPAK_AUTOSTART_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DEJA_DUP_TYPE_FLATPAK_AUTOSTART_REQUEST, DejaDupFlatpakAutostartRequest))
#define DEJA_DUP_FLATPAK_AUTOSTART_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DEJA_DUP_TYPE_FLATPAK_AUTOSTART_REQUEST, DejaDupFlatpakAutostartRequestClass))
#define DEJA_DUP_IS_FLATPAK_AUTOSTART_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DEJA_DUP_TYPE_FLATPAK_AUTOSTART_REQUEST))
#define DEJA_DUP_IS_FLATPAK_AUTOSTART_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DEJA_DUP_TYPE_FLATPAK_AUTOSTART_REQUEST))
#define DEJA_DUP_FLATPAK_AUTOSTART_REQUEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DEJA_DUP_TYPE_FLATPAK_AUTOSTART_REQUEST, DejaDupFlatpakAutostartRequestClass))

typedef struct _DejaDupFlatpakAutostartRequest DejaDupFlatpakAutostartRequest;
typedef struct _DejaDupFlatpakAutostartRequestClass DejaDupFlatpakAutostartRequestClass;
typedef struct _DejaDupInstallEnvFlatpakRequestAutostartData DejaDupInstallEnvFlatpakRequestAutostartData;
#define _g_main_loop_unref0(var) ((var == NULL) ? NULL : (var = (g_main_loop_unref (var), NULL)))
typedef struct _Block5Data Block5Data;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _DejaDupFlatpakAutostartRequestPrivate DejaDupFlatpakAutostartRequestPrivate;
enum  {
	DEJA_DUP_FLATPAK_AUTOSTART_REQUEST_0_PROPERTY,
	DEJA_DUP_FLATPAK_AUTOSTART_REQUEST_NUM_PROPERTIES
};
static GParamSpec* deja_dup_flatpak_autostart_request_properties[DEJA_DUP_FLATPAK_AUTOSTART_REQUEST_NUM_PROPERTIES];
typedef struct _DejaDupFlatpakAutostartRequestRequestAutostartData DejaDupFlatpakAutostartRequestRequestAutostartData;
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
typedef struct _DejaDupFlatpakAutostartRequestSendRequestData DejaDupFlatpakAutostartRequestSendRequestData;

struct _BackgroundInterfaceIface {
	GTypeInterface parent_iface;
	void (*request_background) (BackgroundInterface* self, const gchar* parent_window, GHashTable* options, GAsyncReadyCallback _callback_, gpointer _user_data_);
	char* (*request_background_finish) (BackgroundInterface* self, GAsyncResult* _res_, GError** error);
};

struct _BackgroundInterfaceRequestBackgroundReadyData {
	GDBusMethodInvocation* _invocation_;
	gchar* parent_window;
	GHashTable* options;
};

struct _DejaDupInstallEnvFlatpak {
	DejaDupInstallEnv parent_instance;
	DejaDupInstallEnvFlatpakPrivate * priv;
};

struct _DejaDupInstallEnvFlatpakClass {
	DejaDupInstallEnvClass parent_class;
};

struct _DejaDupInstallEnvFlatpakPrivate {
	GFileMonitor* update_monitor;
	GFileMonitor* remove_monitor;
};

struct _DejaDupInstallEnvFlatpakRequestAutostartData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DejaDupInstallEnvFlatpak* self;
	gchar* handle;
	gchar* mitigation;
	gboolean result;
	DejaDupFlatpakAutostartRequest* request;
	DejaDupFlatpakAutostartRequest* _tmp0_;
	gchar* _tmp1_;
	gboolean _tmp2_;
};

struct _Block5Data {
	int _ref_count_;
	DejaDupInstallEnvFlatpak* self;
	GMainLoop* loop;
};

struct _DejaDupFlatpakAutostartRequest {
	GObject parent_instance;
	DejaDupFlatpakAutostartRequestPrivate * priv;
};

struct _DejaDupFlatpakAutostartRequestClass {
	GObjectClass parent_class;
};

struct _DejaDupFlatpakAutostartRequestPrivate {
	gboolean autostart_allowed;
	GSourceFunc resume_callback;
	gpointer resume_callback_target;
	GDestroyNotify resume_callback_target_destroy_notify;
	GDBusConnection* connection;
	guint signal_id;
	gchar* user_message;
};

struct _DejaDupFlatpakAutostartRequestRequestAutostartData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DejaDupFlatpakAutostartRequest* self;
	gchar* handle;
	gchar* mitigation;
	gboolean result;
	gchar* _tmp0_;
	GDBusConnection* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
};

struct _DejaDupFlatpakAutostartRequestSendRequestData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DejaDupFlatpakAutostartRequest* self;
	gchar* handle;
	gchar* token;
	gchar* _tmp0_;
	GHashTable* options;
	GHashFunc _tmp1_;
	GEqualFunc _tmp2_;
	GHashTable* _tmp3_;
	GHashTable* _tmp4_;
	gchar* _tmp5_;
	GVariant* _tmp6_;
	GHashTable* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar** _tmp10_;
	gchar** _tmp11_;
	gint _tmp11__length1;
	GVariant* _tmp12_;
	GHashTable* _tmp13_;
	gchar* _tmp14_;
	const gchar* _tmp15_;
	GVariant* _tmp16_;
	GDBusConnection* _tmp17_;
	GDBusConnection* _tmp18_;
	GDBusConnection* _tmp19_;
	gchar* expected_path;
	GDBusConnection* _tmp20_;
	const gchar* _tmp21_;
	gchar* _tmp22_;
	GDBusConnection* _tmp23_;
	const gchar* _tmp24_;
	BackgroundInterface* iface;
	GDBusConnection* _tmp25_;
	BackgroundInterface* _tmp26_;
	BackgroundInterface* _tmp27_;
	GHashTable* _tmp28_;
	char* _tmp29_;
	char* _tmp30_;
	gchar* _tmp31_;
	GSourceFunc _tmp32_;
	gpointer _tmp32__target;
	GDestroyNotify _tmp32__target_destroy_notify;
	GError* _inner_error0_;
};

static gint DejaDupInstallEnvFlatpak_private_offset;
static gpointer deja_dup_install_env_flatpak_parent_class = NULL;
static gint DejaDupFlatpakAutostartRequest_private_offset;
static gpointer deja_dup_flatpak_autostart_request_parent_class = NULL;

VALA_EXTERN GType background_interface_proxy_get_type (void) G_GNUC_CONST ;
VALA_EXTERN guint background_interface_register_object (void* object,
                                            GDBusConnection* connection,
                                            const gchar* path,
                                            GError** error);
VALA_EXTERN GType background_interface_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void background_interface_request_background (BackgroundInterface* self,
                                              const gchar* parent_window,
                                              GHashTable* options,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_);
VALA_EXTERN char* background_interface_request_background_finish (BackgroundInterface* self,
                                                      GAsyncResult* _res_,
                                                      GError** error);
static GType background_interface_get_type_once (void);
static void background_interface_proxy_g_signal (GDBusProxy* proxy,
                                          const gchar* sender_name,
                                          const gchar* signal_name,
                                          GVariant* parameters);
static void _vala_g_async_ready_callback (GObject *source_object,
                                   GAsyncResult *res,
                                   void *user_data);
static void background_interface_proxy_request_background_async (BackgroundInterface* self,
                                                          const gchar* parent_window,
                                                          GHashTable* options,
                                                          GAsyncReadyCallback _callback_,
                                                          gpointer _user_data_);
static char* background_interface_proxy_request_background_finish (BackgroundInterface* self,
                                                            GAsyncResult* _res_,
                                                            GError** error);
static void background_interface_proxy_background_interface_interface_init (BackgroundInterfaceIface* iface);
static void _dbus_background_interface_request_background (BackgroundInterface* self,
                                                    GVariant* _parameters_,
                                                    GDBusMethodInvocation* invocation);
static void _dbus_background_interface_request_background_ready (GObject * source_object,
                                                          GAsyncResult * _res_,
                                                          gpointer _user_data_);
static void background_interface_dbus_interface_method_call (GDBusConnection* connection,
                                                      const gchar* sender,
                                                      const gchar* object_path,
                                                      const gchar* interface_name,
                                                      const gchar* method_name,
                                                      GVariant* parameters,
                                                      GDBusMethodInvocation* invocation,
                                                      gpointer user_data);
static GVariant* background_interface_dbus_interface_get_property (GDBusConnection* connection,
                                                            const gchar* sender,
                                                            const gchar* object_path,
                                                            const gchar* interface_name,
                                                            const gchar* property_name,
                                                            GError** error,
                                                            gpointer user_data);
static gboolean background_interface_dbus_interface_set_property (GDBusConnection* connection,
                                                           const gchar* sender,
                                                           const gchar* object_path,
                                                           const gchar* interface_name,
                                                           const gchar* property_name,
                                                           GVariant* value,
                                                           GError** error,
                                                           gpointer user_data);
static void _background_interface_unregister_object (gpointer user_data);
VALA_EXTERN GType deja_dup_install_env_flatpak_get_type (void) G_GNUC_CONST ;
static gchar* deja_dup_install_env_flatpak_real_get_name (DejaDupInstallEnv* base);
static gboolean deja_dup_install_env_flatpak_real_has_custom_config_home (DejaDupInstallEnv* base);
static gchar* deja_dup_install_env_flatpak_real_get_trash_dir (DejaDupInstallEnv* base);
static void deja_dup_install_env_flatpak_real_request_autostart_data_free (gpointer _data);
static void deja_dup_install_env_flatpak_real_request_autostart (DejaDupInstallEnv* base,
                                                          const gchar* handle,
                                                          GAsyncReadyCallback _callback_,
                                                          gpointer _user_data_);
static gboolean deja_dup_install_env_flatpak_real_request_autostart_co (DejaDupInstallEnvFlatpakRequestAutostartData* _data_);
VALA_EXTERN GType deja_dup_flatpak_autostart_request_get_type (void) G_GNUC_CONST ;
VALA_EXTERN DejaDupFlatpakAutostartRequest* deja_dup_flatpak_autostart_request_new (void);
VALA_EXTERN DejaDupFlatpakAutostartRequest* deja_dup_flatpak_autostart_request_construct (GType object_type);
VALA_EXTERN void deja_dup_flatpak_autostart_request_request_autostart (DejaDupFlatpakAutostartRequest* self,
                                                           const gchar* handle,
                                                           GAsyncReadyCallback _callback_,
                                                           gpointer _user_data_);
VALA_EXTERN gboolean deja_dup_flatpak_autostart_request_request_autostart_finish (DejaDupFlatpakAutostartRequest* self,
                                                                      GAsyncResult* _res_,
                                                                      gchar** mitigation);
static void deja_dup_install_env_flatpak_request_autostart_ready (GObject* source_object,
                                                           GAsyncResult* _res_,
                                                           gpointer _user_data_);
static void deja_dup_install_env_flatpak_real_register_monitor_restart (DejaDupInstallEnv* base,
                                                                 GMainLoop* loop);
static Block5Data* block5_data_ref (Block5Data* _data5_);
static void block5_data_unref (void * _userdata_);
static void ___lambda4_ (Block5Data* _data5_);
static void ____lambda4__g_file_monitor_changed (GFileMonitor* _sender,
                                          GFile* file,
                                          GFile* other_file,
                                          GFileMonitorEvent event_type,
                                          gpointer self);
static void ___lambda5_ (Block5Data* _data5_);
static void ____lambda5__g_file_monitor_changed (GFileMonitor* _sender,
                                          GFile* file,
                                          GFile* other_file,
                                          GFileMonitorEvent event_type,
                                          gpointer self);
static gboolean deja_dup_install_env_flatpak_real_is_file_available (DejaDupInstallEnv* base,
                                                              GFile* file);
VALA_EXTERN DejaDupInstallEnvFlatpak* deja_dup_install_env_flatpak_new (void);
VALA_EXTERN DejaDupInstallEnvFlatpak* deja_dup_install_env_flatpak_construct (GType object_type);
static void deja_dup_install_env_flatpak_finalize (GObject * obj);
static GType deja_dup_install_env_flatpak_get_type_once (void);
static void deja_dup_flatpak_autostart_request_request_autostart_data_free (gpointer _data);
static gboolean deja_dup_flatpak_autostart_request_request_autostart_co (DejaDupFlatpakAutostartRequestRequestAutostartData* _data_);
static void deja_dup_flatpak_autostart_request_send_request (DejaDupFlatpakAutostartRequest* self,
                                                      const gchar* handle,
                                                      GAsyncReadyCallback _callback_,
                                                      gpointer _user_data_);
static void deja_dup_flatpak_autostart_request_send_request_finish (DejaDupFlatpakAutostartRequest* self,
                                                             GAsyncResult* _res_);
static gboolean _deja_dup_flatpak_autostart_request_request_autostart_co_gsource_func (gpointer self);
static gchar* deja_dup_flatpak_autostart_request_get_request_path (DejaDupFlatpakAutostartRequest* self,
                                                            GDBusConnection* connection,
                                                            const gchar* token);
static void deja_dup_flatpak_autostart_request_got_response (DejaDupFlatpakAutostartRequest* self,
                                                      GDBusConnection* connection,
                                                      const gchar* sender_name,
                                                      const gchar* object_path,
                                                      const gchar* interface_name,
                                                      const gchar* signal_name,
                                                      GVariant* parameters);
static void deja_dup_flatpak_autostart_request_send_request_data_free (gpointer _data);
static gboolean deja_dup_flatpak_autostart_request_send_request_co (DejaDupFlatpakAutostartRequestSendRequestData* _data_);
static void _g_free0_ (gpointer var);
static void _g_variant_unref0_ (gpointer var);
static void deja_dup_flatpak_autostart_request_send_request_ready (GObject* source_object,
                                                            GAsyncResult* _res_,
                                                            gpointer _user_data_);
static void _deja_dup_flatpak_autostart_request_got_response_gd_bus_signal_callback (GDBusConnection* connection,
                                                                              const gchar* sender_name,
                                                                              const gchar* object_path,
                                                                              const gchar* interface_name,
                                                                              const gchar* signal_name,
                                                                              GVariant* parameters,
                                                                              gpointer self);
static void deja_dup_flatpak_autostart_request_finalize (GObject * obj);
static GType deja_dup_flatpak_autostart_request_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static const GDBusArgInfo _background_interface_dbus_arg_info_request_background_parent_window = {-1, "parent_window", "s", NULL};
static const GDBusArgInfo _background_interface_dbus_arg_info_request_background_options = {-1, "options", "a{sv}", NULL};
static const GDBusArgInfo _background_interface_dbus_arg_info_request_background_result = {-1, "result", "o", NULL};
static const GDBusArgInfo * const _background_interface_dbus_arg_info_request_background_in[] = {&_background_interface_dbus_arg_info_request_background_parent_window, &_background_interface_dbus_arg_info_request_background_options, NULL};
static const GDBusArgInfo * const _background_interface_dbus_arg_info_request_background_out[] = {&_background_interface_dbus_arg_info_request_background_result, NULL};
static const GDBusMethodInfo _background_interface_dbus_method_info_request_background = {-1, "RequestBackground", (GDBusArgInfo **) (&_background_interface_dbus_arg_info_request_background_in), (GDBusArgInfo **) (&_background_interface_dbus_arg_info_request_background_out), NULL};
static const GDBusMethodInfo * const _background_interface_dbus_method_info[] = {&_background_interface_dbus_method_info_request_background, NULL};
static const GDBusSignalInfo * const _background_interface_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo * const _background_interface_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _background_interface_dbus_interface_info = {-1, "org.freedesktop.portal.Background", (GDBusMethodInfo **) (&_background_interface_dbus_method_info), (GDBusSignalInfo **) (&_background_interface_dbus_signal_info), (GDBusPropertyInfo **) (&_background_interface_dbus_property_info), NULL};
static const GDBusInterfaceVTable _background_interface_dbus_interface_vtable = {background_interface_dbus_interface_method_call, background_interface_dbus_interface_get_property, background_interface_dbus_interface_set_property};

void
background_interface_request_background (BackgroundInterface* self,
                                         const gchar* parent_window,
                                         GHashTable* options,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_)
{
	BackgroundInterfaceIface* _iface_;
	_iface_ = BACKGROUND_INTERFACE_GET_INTERFACE (self);
	if (_iface_->request_background) {
		_iface_->request_background (self, parent_window, options, _callback_, _user_data_);
	}
}

char*
background_interface_request_background_finish (BackgroundInterface* self,
                                                GAsyncResult* _res_,
                                                GError** error)
{
	BackgroundInterfaceIface* _iface_;
	_iface_ = BACKGROUND_INTERFACE_GET_INTERFACE (self);
	if (_iface_->request_background_finish) {
		return _iface_->request_background_finish (self, _res_, error);
	}
	return NULL;
}

static void
background_interface_default_init (BackgroundInterfaceIface * iface,
                                   gpointer iface_data)
{
}

 G_GNUC_NO_INLINE static GType
background_interface_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BackgroundInterfaceIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) background_interface_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType background_interface_type_id;
	background_interface_type_id = g_type_register_static (G_TYPE_INTERFACE, "BackgroundInterface", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (background_interface_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (background_interface_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) background_interface_proxy_get_type);
	g_type_set_qdata (background_interface_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.freedesktop.portal.Background");
	g_type_set_qdata (background_interface_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_background_interface_dbus_interface_info));
	g_type_set_qdata (background_interface_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) background_interface_register_object);
	return background_interface_type_id;
}

GType
background_interface_get_type (void)
{
	static gsize background_interface_type_id__once = 0;
	if (g_once_init_enter (&background_interface_type_id__once)) {
		GType background_interface_type_id;
		background_interface_type_id = background_interface_get_type_once ();
		g_once_init_leave (&background_interface_type_id__once, background_interface_type_id);
	}
	return background_interface_type_id__once;
}

G_DEFINE_TYPE_EXTENDED (BackgroundInterfaceProxy, background_interface_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (TYPE_BACKGROUND_INTERFACE, background_interface_proxy_background_interface_interface_init) )
static void
background_interface_proxy_class_init (BackgroundInterfaceProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = background_interface_proxy_g_signal;
}

static void
background_interface_proxy_g_signal (GDBusProxy* proxy,
                                     const gchar* sender_name,
                                     const gchar* signal_name,
                                     GVariant* parameters)
{
}

static void
background_interface_proxy_init (BackgroundInterfaceProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_background_interface_dbus_interface_info));
}

static void
_vala_g_async_ready_callback (GObject *source_object,
                              GAsyncResult *res,
                              void *user_data)
{
	g_task_return_pointer (user_data, g_object_ref (res), g_object_unref);
	g_object_unref (user_data);
}

static void
background_interface_proxy_request_background_async (BackgroundInterface* self,
                                                     const gchar* parent_window,
                                                     GHashTable* options,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GVariantBuilder _tmp0_;
	GHashTableIter _tmp1_;
	gpointer _tmp2_;
	gpointer _tmp3_;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.freedesktop.portal.Background", "RequestBackground");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (parent_window));
	g_hash_table_iter_init (&_tmp1_, options);
	g_variant_builder_init (&_tmp0_, G_VARIANT_TYPE ("a{sv}"));
	while (g_hash_table_iter_next (&_tmp1_, &_tmp2_, &_tmp3_)) {
		gchar* _key;
		GVariant* _value;
		_key = (gchar*) _tmp2_;
		_value = (GVariant*) _tmp3_;
		g_variant_builder_add (&_tmp0_, "{?*}", g_variant_new_string (_key), g_variant_new_variant (_value));
	}
	g_variant_builder_add_value (&_arguments_builder, g_variant_builder_end (&_tmp0_));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	if (_callback_ != NULL) {
		g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_task_new ((GObject *) self, NULL, _callback_, _user_data_));
	} else {
		g_dbus_message_set_flags (_message, G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED);
		g_dbus_connection_send_message (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	}
	g_object_unref (_message);
}

static char*
background_interface_proxy_request_background_finish (BackgroundInterface* self,
                                                      GAsyncResult* _res_,
                                                      GError** error)
{
	GAsyncResult *_inner_res;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	char* _result = NULL;
	GVariant* _tmp4_;
	_inner_res = g_task_propagate_pointer ((GTask *) _res_, NULL);
	_reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), _inner_res, error);
	g_object_unref (_inner_res);
	if (!_reply_message) {
		return NULL;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return NULL;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_tmp4_ = g_variant_iter_next_value (&_reply_iter);
	_result = g_variant_dup_string (_tmp4_, NULL);
	g_variant_unref (_tmp4_);
	g_object_unref (_reply_message);
	return _result;
}

static void
background_interface_proxy_background_interface_interface_init (BackgroundInterfaceIface* iface)
{
	iface->request_background = background_interface_proxy_request_background_async;
	iface->request_background_finish = background_interface_proxy_request_background_finish;
}

static void
_dbus_background_interface_request_background (BackgroundInterface* self,
                                               GVariant* _parameters_,
                                               GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	BackgroundInterfaceRequestBackgroundReadyData* _ready_data;
	GVariant* _tmp5_;
	GVariant* _tmp6_;
	GHashTable* _tmp7_;
	GVariantIter _tmp8_;
	GVariant* _tmp9_;
	GVariant* _tmp10_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (BackgroundInterfaceRequestBackgroundReadyData);
	_ready_data->_invocation_ = invocation;
	_tmp5_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->parent_window = g_variant_dup_string (_tmp5_, NULL);
	g_variant_unref (_tmp5_);
	_tmp6_ = g_variant_iter_next_value (&_arguments_iter);
	_tmp7_ = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_variant_unref);
	g_variant_iter_init (&_tmp8_, _tmp6_);
	while (g_variant_iter_loop (&_tmp8_, "{?*}", &_tmp9_, &_tmp10_)) {
		g_hash_table_insert (_tmp7_, g_variant_dup_string (_tmp9_, NULL), g_variant_get_variant (_tmp10_));
	}
	_ready_data->options = _tmp7_;
	g_variant_unref (_tmp6_);
	background_interface_request_background (self, _ready_data->parent_window, _ready_data->options, (GAsyncReadyCallback) _dbus_background_interface_request_background_ready, _ready_data);
	_error:
	;
}

static void
_dbus_background_interface_request_background_ready (GObject * source_object,
                                                     GAsyncResult * _res_,
                                                     gpointer _user_data_)
{
	BackgroundInterfaceRequestBackgroundReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	char* result;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	result = background_interface_request_background_finish ((BackgroundInterface*) source_object, _res_, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_object_path (result));
	_g_free0 (result);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
	_error:
	_g_free0 (_ready_data->parent_window);
	_g_hash_table_unref0 (_ready_data->options);
	g_slice_free (BackgroundInterfaceRequestBackgroundReadyData, _ready_data);
}

static void
background_interface_dbus_interface_method_call (GDBusConnection* connection,
                                                 const gchar* sender,
                                                 const gchar* object_path,
                                                 const gchar* interface_name,
                                                 const gchar* method_name,
                                                 GVariant* parameters,
                                                 GDBusMethodInvocation* invocation,
                                                 gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (method_name, "RequestBackground") == 0) {
		_dbus_background_interface_request_background (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
background_interface_dbus_interface_get_property (GDBusConnection* connection,
                                                  const gchar* sender,
                                                  const gchar* object_path,
                                                  const gchar* interface_name,
                                                  const gchar* property_name,
                                                  GError** error,
                                                  gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	return NULL;
}

static gboolean
background_interface_dbus_interface_set_property (GDBusConnection* connection,
                                                  const gchar* sender,
                                                  const gchar* object_path,
                                                  const gchar* interface_name,
                                                  const gchar* property_name,
                                                  GVariant* value,
                                                  GError** error,
                                                  gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	return FALSE;
}

guint
background_interface_register_object (gpointer object,
                                      GDBusConnection* connection,
                                      const gchar* path,
                                      GError** error)
{
	guint result;
	gpointer *data;
	data = g_new (gpointer, 3);
	data[0] = g_object_ref (object);
	data[1] = g_object_ref (connection);
	data[2] = g_strdup (path);
	result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_background_interface_dbus_interface_info), &_background_interface_dbus_interface_vtable, data, _background_interface_unregister_object, error);
	if (!result) {
		return 0;
	}
	return result;
}

static void
_background_interface_unregister_object (gpointer user_data)
{
	gpointer* data;
	data = user_data;
	g_object_unref (data[0]);
	g_object_unref (data[1]);
	g_free (data[2]);
	g_free (data);
}

static inline gpointer
deja_dup_install_env_flatpak_get_instance_private (DejaDupInstallEnvFlatpak* self)
{
	return G_STRUCT_MEMBER_P (self, DejaDupInstallEnvFlatpak_private_offset);
}

static gchar*
deja_dup_install_env_flatpak_real_get_name (DejaDupInstallEnv* base)
{
	DejaDupInstallEnvFlatpak * self;
	gchar* _tmp0_;
	gchar* result;
	self = (DejaDupInstallEnvFlatpak*) base;
	_tmp0_ = g_strdup ("flatpak");
	result = _tmp0_;
	return result;
}

static gboolean
deja_dup_install_env_flatpak_real_has_custom_config_home (DejaDupInstallEnv* base)
{
	DejaDupInstallEnvFlatpak * self;
	gboolean result;
	self = (DejaDupInstallEnvFlatpak*) base;
	result = TRUE;
	return result;
}

static gchar*
deja_dup_install_env_flatpak_real_get_trash_dir (DejaDupInstallEnv* base)
{
	DejaDupInstallEnvFlatpak * self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	self = (DejaDupInstallEnvFlatpak*) base;
	_tmp0_ = g_get_home_dir ();
	_tmp1_ = g_build_filename (_tmp0_, ".local", "share", "Trash", NULL);
	result = _tmp1_;
	return result;
}

static void
deja_dup_install_env_flatpak_real_request_autostart_data_free (gpointer _data)
{
	DejaDupInstallEnvFlatpakRequestAutostartData* _data_;
	_data_ = _data;
	_g_free0 (_data_->handle);
	_g_object_unref0 (_data_->self);
	g_slice_free (DejaDupInstallEnvFlatpakRequestAutostartData, _data_);
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

static void
deja_dup_install_env_flatpak_real_request_autostart (DejaDupInstallEnv* base,
                                                     const gchar* handle,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_)
{
	DejaDupInstallEnvFlatpak * self;
	DejaDupInstallEnvFlatpakRequestAutostartData* _data_;
	DejaDupInstallEnvFlatpak* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (handle != NULL);
	self = (DejaDupInstallEnvFlatpak*) base;
	_data_ = g_slice_new0 (DejaDupInstallEnvFlatpakRequestAutostartData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, deja_dup_install_env_flatpak_real_request_autostart_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (handle);
	_g_free0 (_data_->handle);
	_data_->handle = _tmp1_;
	deja_dup_install_env_flatpak_real_request_autostart_co (_data_);
}

static gboolean
deja_dup_install_env_flatpak_request_autostart_finish (DejaDupInstallEnv* base,
                                                       GAsyncResult* _res_,
                                                       gchar** mitigation)
{
	gboolean result;
	DejaDupInstallEnvFlatpakRequestAutostartData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	if (mitigation) {
		*mitigation = _data_->mitigation;
	} else {
		_g_free0 (_data_->mitigation);
	}
	_data_->mitigation = NULL;
	result = _data_->result;
	return result;
}

static void
deja_dup_install_env_flatpak_request_autostart_ready (GObject* source_object,
                                                      GAsyncResult* _res_,
                                                      gpointer _user_data_)
{
	DejaDupInstallEnvFlatpakRequestAutostartData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	deja_dup_install_env_flatpak_real_request_autostart_co (_data_);
}

static gboolean
deja_dup_install_env_flatpak_real_request_autostart_co (DejaDupInstallEnvFlatpakRequestAutostartData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = deja_dup_flatpak_autostart_request_new ();
	_data_->request = _data_->_tmp0_;
	_data_->_tmp1_ = NULL;
	_data_->_state_ = 1;
	deja_dup_flatpak_autostart_request_request_autostart (_data_->request, _data_->handle, deja_dup_install_env_flatpak_request_autostart_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp2_ = deja_dup_flatpak_autostart_request_request_autostart_finish (_data_->request, _data_->_res_, &_data_->_tmp1_);
	_g_free0 (_data_->mitigation);
	_data_->mitigation = _data_->_tmp1_;
	_data_->result = _data_->_tmp2_;
	_g_object_unref0 (_data_->request);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static gpointer
_g_main_loop_ref0 (gpointer self)
{
	return self ? g_main_loop_ref (self) : NULL;
}

static Block5Data*
block5_data_ref (Block5Data* _data5_)
{
	g_atomic_int_inc (&_data5_->_ref_count_);
	return _data5_;
}

static void
block5_data_unref (void * _userdata_)
{
	Block5Data* _data5_;
	_data5_ = (Block5Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data5_->_ref_count_)) {
		DejaDupInstallEnvFlatpak* self;
		self = _data5_->self;
		_g_main_loop_unref0 (_data5_->loop);
		_g_object_unref0 (self);
		g_slice_free (Block5Data, _data5_);
	}
}

static void
___lambda4_ (Block5Data* _data5_)
{
	DejaDupInstallEnvFlatpak* self;
	gchar* cmd = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	GError* _inner_error0_ = NULL;
	self = _data5_->self;
	_tmp0_ = deja_dup_get_monitor_exec ();
	_tmp1_ = _tmp0_;
	_tmp2_ = g_strdup_printf ("flatpak-spawn --latest-version %s --replace", _tmp1_);
	_tmp3_ = _tmp2_;
	_g_free0 (_tmp1_);
	cmd = _tmp3_;
	{
		g_spawn_command_line_async (cmd, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_SPAWN_ERROR) {
				goto __catch0_g_spawn_error;
			}
			_g_free0 (cmd);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
	goto __finally0;
	__catch0_g_spawn_error:
	{
		GError* e = NULL;
		GError* _tmp4_;
		const gchar* _tmp5_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp4_ = e;
		_tmp5_ = _tmp4_->message;
		g_warning ("InstallEnvFlatpak.vala:47: %s", _tmp5_);
		g_main_loop_quit (_data5_->loop);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (cmd);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_g_free0 (cmd);
}

static void
____lambda4__g_file_monitor_changed (GFileMonitor* _sender,
                                     GFile* file,
                                     GFile* other_file,
                                     GFileMonitorEvent event_type,
                                     gpointer self)
{
	___lambda4_ (self);
}

static void
___lambda5_ (Block5Data* _data5_)
{
	DejaDupInstallEnvFlatpak* self;
	self = _data5_->self;
	g_main_loop_quit (_data5_->loop);
}

static void
____lambda5__g_file_monitor_changed (GFileMonitor* _sender,
                                     GFile* file,
                                     GFile* other_file,
                                     GFileMonitorEvent event_type,
                                     gpointer self)
{
	___lambda5_ (self);
}

static void
deja_dup_install_env_flatpak_real_register_monitor_restart (DejaDupInstallEnv* base,
                                                            GMainLoop* loop)
{
	DejaDupInstallEnvFlatpak * self;
	Block5Data* _data5_;
	GMainLoop* _tmp0_;
	GFile* updated = NULL;
	GFile* _tmp1_;
	GFile* removed = NULL;
	GFile* _tmp8_;
	GError* _inner_error0_ = NULL;
	self = (DejaDupInstallEnvFlatpak*) base;
	g_return_if_fail (loop != NULL);
	_data5_ = g_slice_new0 (Block5Data);
	_data5_->_ref_count_ = 1;
	_data5_->self = g_object_ref (self);
	_tmp0_ = _g_main_loop_ref0 (loop);
	_g_main_loop_unref0 (_data5_->loop);
	_data5_->loop = _tmp0_;
	_tmp1_ = g_file_new_for_path ("/app/.updated");
	updated = _tmp1_;
	{
		GFileMonitor* _tmp2_ = NULL;
		GFileMonitor* _tmp3_;
		GFileMonitor* _tmp4_;
		GFileMonitor* _tmp5_;
		_tmp3_ = g_file_monitor_file (updated, G_FILE_MONITOR_NONE, NULL, &_inner_error0_);
		_tmp2_ = _tmp3_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_IO_ERROR) {
				goto __catch0_g_io_error;
			}
			_g_object_unref0 (updated);
			block5_data_unref (_data5_);
			_data5_ = NULL;
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
		_tmp4_ = _tmp2_;
		_tmp2_ = NULL;
		_g_object_unref0 (self->priv->update_monitor);
		self->priv->update_monitor = _tmp4_;
		_tmp5_ = self->priv->update_monitor;
		g_signal_connect_data (_tmp5_, "changed", (GCallback) ____lambda4__g_file_monitor_changed, block5_data_ref (_data5_), (GClosureNotify) block5_data_unref, 0);
		_g_object_unref0 (_tmp2_);
	}
	goto __finally0;
	__catch0_g_io_error:
	{
		GError* e = NULL;
		GError* _tmp6_;
		const gchar* _tmp7_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp6_ = e;
		_tmp7_ = _tmp6_->message;
		g_warning ("InstallEnvFlatpak.vala:52: %s", _tmp7_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (updated);
		block5_data_unref (_data5_);
		_data5_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_tmp8_ = g_file_new_for_path ("/app/.removed");
	removed = _tmp8_;
	{
		GFileMonitor* _tmp9_ = NULL;
		GFileMonitor* _tmp10_;
		GFileMonitor* _tmp11_;
		GFileMonitor* _tmp12_;
		_tmp10_ = g_file_monitor_file (removed, G_FILE_MONITOR_NONE, NULL, &_inner_error0_);
		_tmp9_ = _tmp10_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_IO_ERROR) {
				goto __catch1_g_io_error;
			}
			_g_object_unref0 (removed);
			_g_object_unref0 (updated);
			block5_data_unref (_data5_);
			_data5_ = NULL;
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
		_tmp11_ = _tmp9_;
		_tmp9_ = NULL;
		_g_object_unref0 (self->priv->remove_monitor);
		self->priv->remove_monitor = _tmp11_;
		_tmp12_ = self->priv->remove_monitor;
		g_signal_connect_data (_tmp12_, "changed", (GCallback) ____lambda5__g_file_monitor_changed, block5_data_ref (_data5_), (GClosureNotify) block5_data_unref, 0);
		_g_object_unref0 (_tmp9_);
	}
	goto __finally1;
	__catch1_g_io_error:
	{
		GError* e = NULL;
		GError* _tmp13_;
		const gchar* _tmp14_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp13_ = e;
		_tmp14_ = _tmp13_->message;
		g_warning ("InstallEnvFlatpak.vala:62: %s", _tmp14_);
		_g_error_free0 (e);
	}
	__finally1:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (removed);
		_g_object_unref0 (updated);
		block5_data_unref (_data5_);
		_data5_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_g_object_unref0 (removed);
	_g_object_unref0 (updated);
	block5_data_unref (_data5_);
	_data5_ = NULL;
}

static gboolean
deja_dup_install_env_flatpak_real_is_file_available (DejaDupInstallEnv* base,
                                                     GFile* file)
{
	DejaDupInstallEnvFlatpak * self;
	gchar** hidden = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	gchar** _tmp16_;
	gint hidden_length1;
	gint _hidden_size_;
	gchar** allowed = NULL;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	gchar* _tmp21_;
	gchar* _tmp22_;
	const gchar* _tmp23_;
	gchar* _tmp24_;
	gchar** _tmp25_;
	gint allowed_length1;
	gint _allowed_size_;
	gchar** _tmp26_;
	gint _tmp26__length1;
	gchar** _tmp34_;
	gint _tmp34__length1;
	gboolean result;
	self = (DejaDupInstallEnvFlatpak*) base;
	g_return_val_if_fail (file != NULL, FALSE);
	_tmp0_ = g_strdup ("/lib");
	_tmp1_ = g_strdup ("/lib32");
	_tmp2_ = g_strdup ("/lib64");
	_tmp3_ = g_strdup ("/bin");
	_tmp4_ = g_strdup ("/sbin");
	_tmp5_ = g_strdup ("/usr");
	_tmp6_ = g_strdup ("/boot");
	_tmp7_ = g_strdup ("/root");
	_tmp8_ = g_strdup ("/tmp");
	_tmp9_ = g_strdup ("/etc");
	_tmp10_ = g_strdup ("/app");
	_tmp11_ = g_strdup ("/run");
	_tmp12_ = g_strdup ("/proc");
	_tmp13_ = g_strdup ("/sys");
	_tmp14_ = g_strdup ("/dev");
	_tmp15_ = g_strdup ("/var");
	_tmp16_ = g_new0 (gchar*, 16 + 1);
	_tmp16_[0] = _tmp0_;
	_tmp16_[1] = _tmp1_;
	_tmp16_[2] = _tmp2_;
	_tmp16_[3] = _tmp3_;
	_tmp16_[4] = _tmp4_;
	_tmp16_[5] = _tmp5_;
	_tmp16_[6] = _tmp6_;
	_tmp16_[7] = _tmp7_;
	_tmp16_[8] = _tmp8_;
	_tmp16_[9] = _tmp9_;
	_tmp16_[10] = _tmp10_;
	_tmp16_[11] = _tmp11_;
	_tmp16_[12] = _tmp12_;
	_tmp16_[13] = _tmp13_;
	_tmp16_[14] = _tmp14_;
	_tmp16_[15] = _tmp15_;
	hidden = _tmp16_;
	hidden_length1 = 16;
	_hidden_size_ = hidden_length1;
	_tmp17_ = g_strdup ("/run/host");
	_tmp18_ = g_strdup ("/run/media");
	_tmp19_ = g_strdup ("/var/home");
	_tmp20_ = g_strdup ("/var/mnt");
	_tmp21_ = g_strdup ("/var/opt");
	_tmp22_ = g_strdup ("/var/srv");
	_tmp23_ = g_get_home_dir ();
	_tmp24_ = g_strdup (_tmp23_);
	_tmp25_ = g_new0 (gchar*, 7 + 1);
	_tmp25_[0] = _tmp17_;
	_tmp25_[1] = _tmp18_;
	_tmp25_[2] = _tmp19_;
	_tmp25_[3] = _tmp20_;
	_tmp25_[4] = _tmp21_;
	_tmp25_[5] = _tmp22_;
	_tmp25_[6] = _tmp24_;
	allowed = _tmp25_;
	allowed_length1 = 7;
	_allowed_size_ = allowed_length1;
	_tmp26_ = allowed;
	_tmp26__length1 = allowed_length1;
	{
		gchar** f_collection = NULL;
		gint f_collection_length1 = 0;
		gint _f_collection_size_ = 0;
		gint f_it = 0;
		f_collection = _tmp26_;
		f_collection_length1 = _tmp26__length1;
		for (f_it = 0; f_it < f_collection_length1; f_it = f_it + 1) {
			gchar* _tmp27_;
			gchar* f = NULL;
			_tmp27_ = g_strdup (f_collection[f_it]);
			f = _tmp27_;
			{
				GFile* ffile = NULL;
				const gchar* _tmp28_;
				GFile* _tmp29_;
				gboolean _tmp30_ = FALSE;
				GFile* _tmp31_;
				_tmp28_ = f;
				_tmp29_ = g_file_new_for_path (_tmp28_);
				ffile = _tmp29_;
				_tmp31_ = ffile;
				if (g_file_equal (file, _tmp31_)) {
					_tmp30_ = TRUE;
				} else {
					GFile* _tmp32_;
					_tmp32_ = ffile;
					_tmp30_ = g_file_has_prefix (file, _tmp32_);
				}
				if (_tmp30_) {
					GFile* _tmp33_;
					_tmp33_ = ffile;
					result = g_file_query_exists (_tmp33_, NULL);
					_g_object_unref0 (ffile);
					_g_free0 (f);
					allowed = (_vala_array_free (allowed, allowed_length1, (GDestroyNotify) g_free), NULL);
					hidden = (_vala_array_free (hidden, hidden_length1, (GDestroyNotify) g_free), NULL);
					return result;
				}
				_g_object_unref0 (ffile);
				_g_free0 (f);
			}
		}
	}
	_tmp34_ = hidden;
	_tmp34__length1 = hidden_length1;
	{
		gchar** f_collection = NULL;
		gint f_collection_length1 = 0;
		gint _f_collection_size_ = 0;
		gint f_it = 0;
		f_collection = _tmp34_;
		f_collection_length1 = _tmp34__length1;
		for (f_it = 0; f_it < f_collection_length1; f_it = f_it + 1) {
			gchar* _tmp35_;
			gchar* f = NULL;
			_tmp35_ = g_strdup (f_collection[f_it]);
			f = _tmp35_;
			{
				GFile* ffile = NULL;
				const gchar* _tmp36_;
				GFile* _tmp37_;
				gboolean _tmp38_ = FALSE;
				GFile* _tmp39_;
				_tmp36_ = f;
				_tmp37_ = g_file_new_for_path (_tmp36_);
				ffile = _tmp37_;
				_tmp39_ = ffile;
				if (g_file_equal (file, _tmp39_)) {
					_tmp38_ = TRUE;
				} else {
					GFile* _tmp40_;
					_tmp40_ = ffile;
					_tmp38_ = g_file_has_prefix (file, _tmp40_);
				}
				if (_tmp38_) {
					result = FALSE;
					_g_object_unref0 (ffile);
					_g_free0 (f);
					allowed = (_vala_array_free (allowed, allowed_length1, (GDestroyNotify) g_free), NULL);
					hidden = (_vala_array_free (hidden, hidden_length1, (GDestroyNotify) g_free), NULL);
					return result;
				}
				_g_object_unref0 (ffile);
				_g_free0 (f);
			}
		}
	}
	result = TRUE;
	allowed = (_vala_array_free (allowed, allowed_length1, (GDestroyNotify) g_free), NULL);
	hidden = (_vala_array_free (hidden, hidden_length1, (GDestroyNotify) g_free), NULL);
	return result;
}

DejaDupInstallEnvFlatpak*
deja_dup_install_env_flatpak_construct (GType object_type)
{
	DejaDupInstallEnvFlatpak * self = NULL;
	self = (DejaDupInstallEnvFlatpak*) deja_dup_install_env_construct (object_type);
	return self;
}

DejaDupInstallEnvFlatpak*
deja_dup_install_env_flatpak_new (void)
{
	return deja_dup_install_env_flatpak_construct (DEJA_DUP_TYPE_INSTALL_ENV_FLATPAK);
}

static void
deja_dup_install_env_flatpak_class_init (DejaDupInstallEnvFlatpakClass * klass,
                                         gpointer klass_data)
{
	deja_dup_install_env_flatpak_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DejaDupInstallEnvFlatpak_private_offset);
	((DejaDupInstallEnvClass *) klass)->get_name = (gchar* (*) (DejaDupInstallEnv*)) deja_dup_install_env_flatpak_real_get_name;
	((DejaDupInstallEnvClass *) klass)->has_custom_config_home = (gboolean (*) (DejaDupInstallEnv*)) deja_dup_install_env_flatpak_real_has_custom_config_home;
	((DejaDupInstallEnvClass *) klass)->get_trash_dir = (gchar* (*) (DejaDupInstallEnv*)) deja_dup_install_env_flatpak_real_get_trash_dir;
	((DejaDupInstallEnvClass *) klass)->request_autostart = (void (*) (DejaDupInstallEnv*, const gchar*, GAsyncReadyCallback, gpointer)) deja_dup_install_env_flatpak_real_request_autostart;
	((DejaDupInstallEnvClass *) klass)->request_autostart_finish = (gboolean (*) (DejaDupInstallEnv*, GAsyncResult*, gchar**)) deja_dup_install_env_flatpak_request_autostart_finish;
	((DejaDupInstallEnvClass *) klass)->register_monitor_restart = (void (*) (DejaDupInstallEnv*, GMainLoop*)) deja_dup_install_env_flatpak_real_register_monitor_restart;
	((DejaDupInstallEnvClass *) klass)->is_file_available = (gboolean (*) (DejaDupInstallEnv*, GFile*)) deja_dup_install_env_flatpak_real_is_file_available;
	G_OBJECT_CLASS (klass)->finalize = deja_dup_install_env_flatpak_finalize;
}

static void
deja_dup_install_env_flatpak_instance_init (DejaDupInstallEnvFlatpak * self,
                                            gpointer klass)
{
	self->priv = deja_dup_install_env_flatpak_get_instance_private (self);
}

static void
deja_dup_install_env_flatpak_finalize (GObject * obj)
{
	DejaDupInstallEnvFlatpak * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DEJA_DUP_TYPE_INSTALL_ENV_FLATPAK, DejaDupInstallEnvFlatpak);
	_g_object_unref0 (self->priv->update_monitor);
	_g_object_unref0 (self->priv->remove_monitor);
	G_OBJECT_CLASS (deja_dup_install_env_flatpak_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
deja_dup_install_env_flatpak_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DejaDupInstallEnvFlatpakClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) deja_dup_install_env_flatpak_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DejaDupInstallEnvFlatpak), 0, (GInstanceInitFunc) deja_dup_install_env_flatpak_instance_init, NULL };
	GType deja_dup_install_env_flatpak_type_id;
	deja_dup_install_env_flatpak_type_id = g_type_register_static (DEJA_DUP_TYPE_INSTALL_ENV, "DejaDupInstallEnvFlatpak", &g_define_type_info, 0);
	DejaDupInstallEnvFlatpak_private_offset = g_type_add_instance_private (deja_dup_install_env_flatpak_type_id, sizeof (DejaDupInstallEnvFlatpakPrivate));
	return deja_dup_install_env_flatpak_type_id;
}

GType
deja_dup_install_env_flatpak_get_type (void)
{
	static gsize deja_dup_install_env_flatpak_type_id__once = 0;
	if (g_once_init_enter (&deja_dup_install_env_flatpak_type_id__once)) {
		GType deja_dup_install_env_flatpak_type_id;
		deja_dup_install_env_flatpak_type_id = deja_dup_install_env_flatpak_get_type_once ();
		g_once_init_leave (&deja_dup_install_env_flatpak_type_id__once, deja_dup_install_env_flatpak_type_id);
	}
	return deja_dup_install_env_flatpak_type_id__once;
}

static inline gpointer
deja_dup_flatpak_autostart_request_get_instance_private (DejaDupFlatpakAutostartRequest* self)
{
	return G_STRUCT_MEMBER_P (self, DejaDupFlatpakAutostartRequest_private_offset);
}

static void
deja_dup_flatpak_autostart_request_request_autostart_data_free (gpointer _data)
{
	DejaDupFlatpakAutostartRequestRequestAutostartData* _data_;
	_data_ = _data;
	_g_free0 (_data_->handle);
	_g_object_unref0 (_data_->self);
	g_slice_free (DejaDupFlatpakAutostartRequestRequestAutostartData, _data_);
}

void
deja_dup_flatpak_autostart_request_request_autostart (DejaDupFlatpakAutostartRequest* self,
                                                      const gchar* handle,
                                                      GAsyncReadyCallback _callback_,
                                                      gpointer _user_data_)
{
	DejaDupFlatpakAutostartRequestRequestAutostartData* _data_;
	DejaDupFlatpakAutostartRequest* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (handle != NULL);
	_data_ = g_slice_new0 (DejaDupFlatpakAutostartRequestRequestAutostartData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, deja_dup_flatpak_autostart_request_request_autostart_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (handle);
	_g_free0 (_data_->handle);
	_data_->handle = _tmp1_;
	deja_dup_flatpak_autostart_request_request_autostart_co (_data_);
}

gboolean
deja_dup_flatpak_autostart_request_request_autostart_finish (DejaDupFlatpakAutostartRequest* self,
                                                             GAsyncResult* _res_,
                                                             gchar** mitigation)
{
	gboolean result;
	DejaDupFlatpakAutostartRequestRequestAutostartData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	if (mitigation) {
		*mitigation = _data_->mitigation;
	} else {
		_g_free0 (_data_->mitigation);
	}
	_data_->mitigation = NULL;
	result = _data_->result;
	return result;
}

static gboolean
_deja_dup_flatpak_autostart_request_request_autostart_co_gsource_func (gpointer self)
{
	gboolean result;
	result = deja_dup_flatpak_autostart_request_request_autostart_co (self);
	return result;
}

static gboolean
deja_dup_flatpak_autostart_request_request_autostart_co (DejaDupFlatpakAutostartRequestRequestAutostartData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = g_strdup (_ ("Make sure Backups has permission to run in " "the background in your desktop session’s settings " "and try again."));
	_g_free0 (_data_->self->priv->user_message);
	_data_->self->priv->user_message = _data_->_tmp0_;
	deja_dup_flatpak_autostart_request_send_request (_data_->self, _data_->handle, NULL, NULL);
	(_data_->self->priv->resume_callback_target_destroy_notify == NULL) ? NULL : (_data_->self->priv->resume_callback_target_destroy_notify (_data_->self->priv->resume_callback_target), NULL);
	_data_->self->priv->resume_callback = NULL;
	_data_->self->priv->resume_callback_target = NULL;
	_data_->self->priv->resume_callback_target_destroy_notify = NULL;
	_data_->self->priv->resume_callback = _deja_dup_flatpak_autostart_request_request_autostart_co_gsource_func;
	_data_->self->priv->resume_callback_target = _data_;
	_data_->self->priv->resume_callback_target_destroy_notify = NULL;
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	if (_data_->self->priv->signal_id > ((guint) 0)) {
		_data_->_tmp1_ = _data_->self->priv->connection;
		g_dbus_connection_signal_unsubscribe (_data_->_tmp1_, _data_->self->priv->signal_id);
		_data_->self->priv->signal_id = (guint) 0;
	}
	_data_->_tmp2_ = _data_->self->priv->user_message;
	_data_->_tmp3_ = g_strdup (_data_->_tmp2_);
	_g_free0 (_data_->mitigation);
	_data_->mitigation = _data_->_tmp3_;
	_data_->result = _data_->self->priv->autostart_allowed;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static glong
string_strnlen (gchar* str,
                glong maxlen)
{
	gchar* end = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	glong result;
	_tmp0_ = memchr (str, 0, (gsize) maxlen);
	end = _tmp0_;
	_tmp1_ = end;
	if (_tmp1_ == NULL) {
		result = maxlen;
		return result;
	} else {
		gchar* _tmp2_;
		_tmp2_ = end;
		result = (glong) (_tmp2_ - str);
		return result;
	}
}

static gchar*
string_substring (const gchar* self,
                  glong offset,
                  glong len)
{
	glong string_length = 0L;
	gboolean _tmp0_ = FALSE;
	gchar* _tmp3_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (offset >= ((glong) 0)) {
		_tmp0_ = len >= ((glong) 0);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		string_length = string_strnlen ((gchar*) self, offset + len);
	} else {
		gint _tmp1_;
		gint _tmp2_;
		_tmp1_ = strlen (self);
		_tmp2_ = _tmp1_;
		string_length = (glong) _tmp2_;
	}
	if (offset < ((glong) 0)) {
		offset = string_length + offset;
		g_return_val_if_fail (offset >= ((glong) 0), NULL);
	} else {
		g_return_val_if_fail (offset <= string_length, NULL);
	}
	if (len < ((glong) 0)) {
		len = string_length - offset;
	}
	g_return_val_if_fail ((offset + len) <= string_length, NULL);
	_tmp3_ = g_strndup (((gchar*) self) + offset, (gsize) len);
	result = _tmp3_;
	return result;
}

static gchar*
string_replace (const gchar* self,
                const gchar* old,
                const gchar* replacement)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (old != NULL, NULL);
	g_return_val_if_fail (replacement != NULL, NULL);
	if ((*((gchar*) self)) == '\0') {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = (*((gchar*) old)) == '\0';
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = g_strcmp0 (old, replacement) == 0;
	}
	if (_tmp0_) {
		gchar* _tmp2_;
		_tmp2_ = g_strdup (self);
		result = _tmp2_;
		return result;
	}
	{
		GRegex* regex = NULL;
		gchar* _tmp3_;
		gchar* _tmp4_;
		GRegex* _tmp5_;
		GRegex* _tmp6_;
		gchar* _tmp7_ = NULL;
		GRegex* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		_tmp3_ = g_regex_escape_string (old, -1);
		_tmp4_ = _tmp3_;
		_tmp5_ = g_regex_new (_tmp4_, 0, 0, &_inner_error0_);
		_tmp6_ = _tmp5_;
		_g_free0 (_tmp4_);
		regex = _tmp6_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp8_ = regex;
		_tmp9_ = g_regex_replace_literal (_tmp8_, self, (gssize) -1, 0, replacement, 0, &_inner_error0_);
		_tmp7_ = _tmp9_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_regex_unref0 (regex);
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp10_ = _tmp7_;
		_tmp7_ = NULL;
		result = _tmp10_;
		_g_free0 (_tmp7_);
		_g_regex_unref0 (regex);
		return result;
	}
	goto __finally0;
	__catch0_g_regex_error:
	{
		g_clear_error (&_inner_error0_);
		g_assert_not_reached ();
	}
	__finally0:
	g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
	g_clear_error (&_inner_error0_);
	return NULL;
}

static gchar*
deja_dup_flatpak_autostart_request_get_request_path (DejaDupFlatpakAutostartRequest* self,
                                                     GDBusConnection* connection,
                                                     const gchar* token)
{
	gchar* sender = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (connection != NULL, NULL);
	g_return_val_if_fail (token != NULL, NULL);
	_tmp0_ = g_dbus_connection_get_unique_name (connection);
	_tmp1_ = string_substring (_tmp0_, (glong) 1, (glong) -1);
	_tmp2_ = _tmp1_;
	_tmp3_ = string_replace (_tmp2_, ".", "_");
	_tmp4_ = _tmp3_;
	_g_free0 (_tmp2_);
	sender = _tmp4_;
	_tmp5_ = g_strdup_printf ("/org/freedesktop/portal/desktop/request/%s/%s", sender, token);
	result = _tmp5_;
	_g_free0 (sender);
	return result;
}

static void
deja_dup_flatpak_autostart_request_got_response (DejaDupFlatpakAutostartRequest* self,
                                                 GDBusConnection* connection,
                                                 const gchar* sender_name,
                                                 const gchar* object_path,
                                                 const gchar* interface_name,
                                                 const gchar* signal_name,
                                                 GVariant* parameters)
{
	gint response = 0;
	GVariant* values = NULL;
	gint _tmp0_ = 0;
	GVariant* _tmp1_ = NULL;
	GSourceFunc _tmp4_;
	gpointer _tmp4__target;
	GDestroyNotify _tmp4__target_destroy_notify;
	g_return_if_fail (self != NULL);
	g_return_if_fail (connection != NULL);
	g_return_if_fail (object_path != NULL);
	g_return_if_fail (interface_name != NULL);
	g_return_if_fail (signal_name != NULL);
	g_return_if_fail (parameters != NULL);
	g_variant_get (parameters, "(u@a{sv})", &_tmp0_, &_tmp1_, NULL);
	response = _tmp0_;
	_g_variant_unref0 (values);
	values = _tmp1_;
	if (response == 0) {
		gboolean autostart = FALSE;
		GVariant* _tmp2_;
		gboolean _tmp3_ = FALSE;
		_tmp2_ = values;
		g_variant_lookup (_tmp2_, "autostart", "b", &_tmp3_, NULL);
		autostart = _tmp3_;
		self->priv->autostart_allowed = autostart;
	}
	_tmp4_ = self->priv->resume_callback;
	_tmp4__target = self->priv->resume_callback_target;
	_tmp4__target_destroy_notify = self->priv->resume_callback_target_destroy_notify;
	self->priv->resume_callback = NULL;
	self->priv->resume_callback_target = NULL;
	self->priv->resume_callback_target_destroy_notify = NULL;
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, _tmp4_, _tmp4__target, _tmp4__target_destroy_notify);
	_g_variant_unref0 (values);
}

static void
deja_dup_flatpak_autostart_request_send_request_data_free (gpointer _data)
{
	DejaDupFlatpakAutostartRequestSendRequestData* _data_;
	_data_ = _data;
	_g_free0 (_data_->handle);
	_g_object_unref0 (_data_->self);
	g_slice_free (DejaDupFlatpakAutostartRequestSendRequestData, _data_);
}

static void
deja_dup_flatpak_autostart_request_send_request (DejaDupFlatpakAutostartRequest* self,
                                                 const gchar* handle,
                                                 GAsyncReadyCallback _callback_,
                                                 gpointer _user_data_)
{
	DejaDupFlatpakAutostartRequestSendRequestData* _data_;
	DejaDupFlatpakAutostartRequest* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (handle != NULL);
	_data_ = g_slice_new0 (DejaDupFlatpakAutostartRequestSendRequestData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, deja_dup_flatpak_autostart_request_send_request_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (handle);
	_g_free0 (_data_->handle);
	_data_->handle = _tmp1_;
	deja_dup_flatpak_autostart_request_send_request_co (_data_);
}

static void
deja_dup_flatpak_autostart_request_send_request_finish (DejaDupFlatpakAutostartRequest* self,
                                                        GAsyncResult* _res_)
{
	DejaDupFlatpakAutostartRequestSendRequestData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
_g_free0_ (gpointer var)
{
	var = (g_free (var), NULL);
}

static void
_g_variant_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (g_variant_unref (var), NULL));
}

static void
deja_dup_flatpak_autostart_request_send_request_ready (GObject* source_object,
                                                       GAsyncResult* _res_,
                                                       gpointer _user_data_)
{
	DejaDupFlatpakAutostartRequestSendRequestData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	deja_dup_flatpak_autostart_request_send_request_co (_data_);
}

static void
_deja_dup_flatpak_autostart_request_got_response_gd_bus_signal_callback (GDBusConnection* connection,
                                                                         const gchar* sender_name,
                                                                         const gchar* object_path,
                                                                         const gchar* interface_name,
                                                                         const gchar* signal_name,
                                                                         GVariant* parameters,
                                                                         gpointer self)
{
	deja_dup_flatpak_autostart_request_got_response ((DejaDupFlatpakAutostartRequest*) self, connection, sender_name, object_path, interface_name, signal_name, parameters);
}

static gboolean
deja_dup_flatpak_autostart_request_send_request_co (DejaDupFlatpakAutostartRequestSendRequestData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = g_strdup_printf ("deja_dup_%u", (guint) g_random_int ());
	_data_->token = _data_->_tmp0_;
	_data_->_tmp1_ = g_str_hash;
	_data_->_tmp2_ = g_str_equal;
	_data_->_tmp3_ = g_hash_table_new_full (_data_->_tmp1_, _data_->_tmp2_, _g_free0_, _g_variant_unref0_);
	_data_->options = _data_->_tmp3_;
	_data_->_tmp4_ = _data_->options;
	_data_->_tmp5_ = g_strdup ("autostart");
	_data_->_tmp6_ = g_variant_new_boolean (TRUE);
	g_variant_ref_sink (_data_->_tmp6_);
	g_hash_table_insert (_data_->_tmp4_, _data_->_tmp5_, _data_->_tmp6_);
	_data_->_tmp7_ = _data_->options;
	_data_->_tmp8_ = g_strdup ("commandline");
	_data_->_tmp9_ = deja_dup_get_monitor_exec ();
	_data_->_tmp10_ = g_new0 (gchar*, 1 + 1);
	_data_->_tmp10_[0] = _data_->_tmp9_;
	_data_->_tmp11_ = _data_->_tmp10_;
	_data_->_tmp11__length1 = 1;
	_data_->_tmp12_ = g_variant_new_strv (_data_->_tmp11_, 1);
	g_variant_ref_sink (_data_->_tmp12_);
	g_hash_table_insert (_data_->_tmp7_, _data_->_tmp8_, _data_->_tmp12_);
	_data_->_tmp11_ = (_vala_array_free (_data_->_tmp11_, _data_->_tmp11__length1, (GDestroyNotify) g_free), NULL);
	_data_->_tmp13_ = _data_->options;
	_data_->_tmp14_ = g_strdup ("handle_token");
	_data_->_tmp15_ = _data_->token;
	_data_->_tmp16_ = g_variant_new_string (_data_->_tmp15_);
	g_variant_ref_sink (_data_->_tmp16_);
	g_hash_table_insert (_data_->_tmp13_, _data_->_tmp14_, _data_->_tmp16_);
	{
		_data_->_state_ = 1;
		g_bus_get (G_BUS_TYPE_SESSION, NULL, deja_dup_flatpak_autostart_request_send_request_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp18_ = g_bus_get_finish (_data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp17_ = _data_->_tmp18_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp19_ = _data_->_tmp17_;
		_data_->_tmp17_ = NULL;
		_g_object_unref0 (_data_->self->priv->connection);
		_data_->self->priv->connection = _data_->_tmp19_;
		_data_->_tmp20_ = _data_->self->priv->connection;
		_data_->_tmp21_ = _data_->token;
		_data_->_tmp22_ = deja_dup_flatpak_autostart_request_get_request_path (_data_->self, _data_->_tmp20_, _data_->_tmp21_);
		_data_->expected_path = _data_->_tmp22_;
		_data_->_tmp23_ = _data_->self->priv->connection;
		_data_->_tmp24_ = _data_->expected_path;
		_data_->self->priv->signal_id = g_dbus_connection_signal_subscribe (_data_->_tmp23_, DEJA_DUP_FLATPAK_AUTOSTART_REQUEST_PORTAL_NAME, DEJA_DUP_FLATPAK_AUTOSTART_REQUEST_REQUEST_IFACE, "Response", _data_->_tmp24_, NULL, G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE, _deja_dup_flatpak_autostart_request_got_response_gd_bus_signal_callback, g_object_ref (_data_->self), g_object_unref);
		_data_->_tmp25_ = _data_->self->priv->connection;
		_data_->_state_ = 2;
		g_async_initable_new_async (TYPE_BACKGROUND_INTERFACE_PROXY, 0, NULL, deja_dup_flatpak_autostart_request_send_request_ready, _data_, "g-flags", 0, "g-name", DEJA_DUP_FLATPAK_AUTOSTART_REQUEST_PORTAL_NAME, "g-connection", _data_->_tmp25_, "g-object-path", DEJA_DUP_FLATPAK_AUTOSTART_REQUEST_PORTAL_PATH, "g-interface-name", "org.freedesktop.portal.Background", NULL);
		return FALSE;
		_state_2:
		_data_->_tmp26_ = (BackgroundInterface*) g_async_initable_new_finish ((GAsyncInitable *) _data_->_source_object_, _data_->_res_, &_data_->_inner_error0_);
		_data_->iface = (BackgroundInterface*) _data_->_tmp26_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_free0 (_data_->expected_path);
			_g_object_unref0 (_data_->_tmp17_);
			goto __catch0_g_error;
		}
		_data_->_tmp27_ = _data_->iface;
		_data_->_tmp28_ = _data_->options;
		_data_->_state_ = 3;
		background_interface_request_background (_data_->_tmp27_, _data_->handle, _data_->_tmp28_, deja_dup_flatpak_autostart_request_send_request_ready, _data_);
		return FALSE;
		_state_3:
		_data_->_tmp29_ = background_interface_request_background_finish (_data_->_tmp27_, _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp30_ = _data_->_tmp29_;
		_g_free0 (_data_->_tmp30_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->iface);
			_g_free0 (_data_->expected_path);
			_g_object_unref0 (_data_->_tmp17_);
			goto __catch0_g_error;
		}
		_g_object_unref0 (_data_->iface);
		_g_free0 (_data_->expected_path);
		_g_object_unref0 (_data_->_tmp17_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_data_->_inner_error0_);
		_data_->_tmp31_ = g_strdup (_ ("Your desktop session does not support automatically starting Flatpak a" \
"pps."));
		_g_free0 (_data_->self->priv->user_message);
		_data_->self->priv->user_message = _data_->_tmp31_;
		_data_->_tmp32_ = _data_->self->priv->resume_callback;
		_data_->_tmp32__target = _data_->self->priv->resume_callback_target;
		_data_->_tmp32__target_destroy_notify = _data_->self->priv->resume_callback_target_destroy_notify;
		_data_->self->priv->resume_callback = NULL;
		_data_->self->priv->resume_callback_target = NULL;
		_data_->self->priv->resume_callback_target_destroy_notify = NULL;
		g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, _data_->_tmp32_, _data_->_tmp32__target, _data_->_tmp32__target_destroy_notify);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_hash_table_unref0 (_data_->options);
		_g_free0 (_data_->token);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_g_hash_table_unref0 (_data_->options);
	_g_free0 (_data_->token);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

DejaDupFlatpakAutostartRequest*
deja_dup_flatpak_autostart_request_construct (GType object_type)
{
	DejaDupFlatpakAutostartRequest * self = NULL;
	self = (DejaDupFlatpakAutostartRequest*) g_object_new (object_type, NULL);
	return self;
}

DejaDupFlatpakAutostartRequest*
deja_dup_flatpak_autostart_request_new (void)
{
	return deja_dup_flatpak_autostart_request_construct (DEJA_DUP_TYPE_FLATPAK_AUTOSTART_REQUEST);
}

static void
deja_dup_flatpak_autostart_request_class_init (DejaDupFlatpakAutostartRequestClass * klass,
                                               gpointer klass_data)
{
	deja_dup_flatpak_autostart_request_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DejaDupFlatpakAutostartRequest_private_offset);
	G_OBJECT_CLASS (klass)->finalize = deja_dup_flatpak_autostart_request_finalize;
}

static void
deja_dup_flatpak_autostart_request_instance_init (DejaDupFlatpakAutostartRequest * self,
                                                  gpointer klass)
{
	self->priv = deja_dup_flatpak_autostart_request_get_instance_private (self);
	self->priv->user_message = NULL;
}

static void
deja_dup_flatpak_autostart_request_finalize (GObject * obj)
{
	DejaDupFlatpakAutostartRequest * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DEJA_DUP_TYPE_FLATPAK_AUTOSTART_REQUEST, DejaDupFlatpakAutostartRequest);
	(self->priv->resume_callback_target_destroy_notify == NULL) ? NULL : (self->priv->resume_callback_target_destroy_notify (self->priv->resume_callback_target), NULL);
	self->priv->resume_callback = NULL;
	self->priv->resume_callback_target = NULL;
	self->priv->resume_callback_target_destroy_notify = NULL;
	_g_object_unref0 (self->priv->connection);
	_g_free0 (self->priv->user_message);
	G_OBJECT_CLASS (deja_dup_flatpak_autostart_request_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
deja_dup_flatpak_autostart_request_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DejaDupFlatpakAutostartRequestClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) deja_dup_flatpak_autostart_request_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DejaDupFlatpakAutostartRequest), 0, (GInstanceInitFunc) deja_dup_flatpak_autostart_request_instance_init, NULL };
	GType deja_dup_flatpak_autostart_request_type_id;
	deja_dup_flatpak_autostart_request_type_id = g_type_register_static (G_TYPE_OBJECT, "DejaDupFlatpakAutostartRequest", &g_define_type_info, 0);
	DejaDupFlatpakAutostartRequest_private_offset = g_type_add_instance_private (deja_dup_flatpak_autostart_request_type_id, sizeof (DejaDupFlatpakAutostartRequestPrivate));
	return deja_dup_flatpak_autostart_request_type_id;
}

GType
deja_dup_flatpak_autostart_request_get_type (void)
{
	static gsize deja_dup_flatpak_autostart_request_type_id__once = 0;
	if (g_once_init_enter (&deja_dup_flatpak_autostart_request_type_id__once)) {
		GType deja_dup_flatpak_autostart_request_type_id;
		deja_dup_flatpak_autostart_request_type_id = deja_dup_flatpak_autostart_request_get_type_once ();
		g_once_init_leave (&deja_dup_flatpak_autostart_request_type_id__once, deja_dup_flatpak_autostart_request_type_id);
	}
	return deja_dup_flatpak_autostart_request_type_id__once;
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

