2
* Copyright (C) 2013 Canonical Ltd
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU Lesser General Public License version 3 as
6
* published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Authored by: Thomas Voss <thomas.voss@canonical.com>
17
* Ricardo Mendoza <ricardo.mendoza@canonical.com>
20
#include "hybris_bridge.h"
25
namespace uh = ubuntu::hybris;
29
extern void *android_dlopen(const char *filename, int flag);
30
extern void *android_dlsym(void *handle, const char *symbol);
34
const char* uh::Bridge::path_to_library()
36
return "/system/lib/libubuntu_application_api.so";
39
uh::Bridge& uh::Bridge::instance()
41
static uh::Bridge bridge;
46
: lib_handle(android_dlopen(path_to_library(), RTLD_LAZY))
48
assert(lib_handle && "Error loading ubuntu_application_api");
53
// TODO android_dlclose(libcamera_handle);
56
void* uh::Bridge::resolve_symbol(const char* symbol) const
58
return android_dlsym(lib_handle, symbol);