[-]
[+]
|
Changed |
_service:tar_git:libhybris.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris.spec
^
|
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.17.tar.bz2/.gitignore
^
|
@@ -0,0 +1,5 @@
+RPMS/
+installroot/
+libhybris/hybris/tests/test_hwcomposer
+libhybris/hybris/tests/test_vibrator
+
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.17.tar.bz2/libhybris/hybris/common/hooks.c
^
|
@@ -1428,6 +1428,7 @@
{"memmove",memmove},
{"memset",memset},
{"memmem",memmem},
+ {"getlogin", getlogin},
// {"memswap",memswap},
{"index",index},
{"rindex",rindex},
@@ -1469,6 +1470,8 @@
{"index",index},
{"rindex",rindex},
{"strcasecmp",strcasecmp},
+ {"__sprintf_chk", __sprintf_chk},
+ {"__snprintf_chk", __snprintf_chk},
{"strncasecmp",strncasecmp},
/* dirent.h */
{"opendir", opendir},
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.17.tar.bz2/libhybris/hybris/common/jb/dlfcn.c
^
|
@@ -78,7 +78,7 @@
void *android_dlsym(void *handle, const char *symbol)
{
soinfo *found;
- Elf32_Sym *sym;
+ Elf_Sym *sym;
unsigned bind;
pthread_mutex_lock(&dl_lock);
@@ -142,7 +142,7 @@
info->dli_fbase = (void*)si->base;
/* Determine if any symbol in the library contains the specified address */
- Elf32_Sym *sym = find_containing_symbol(addr, si);
+ Elf_Sym *sym = find_containing_symbol(addr, si);
if(sym != NULL) {
info->dli_sname = si->strtab + sym->st_name;
@@ -191,7 +191,7 @@
#endif
-static Elf32_Sym libdl_symtab[] = {
+static Elf_Sym libdl_symtab[] = {
// total length of libdl_info.strtab, including trailing 0
// This is actually the the STH_UNDEF entry. Technically, it's
// supposed to have st_name == 0, but instead, it points to an index
@@ -199,33 +199,33 @@
{ st_name: sizeof(ANDROID_LIBDL_STRTAB) - 1,
},
{ st_name: 0, // starting index of the name in libdl_info.strtab
- st_value: (Elf32_Addr) &android_dlopen,
+ st_value: (Elf_Addr) &android_dlopen,
st_info: STB_GLOBAL << 4,
st_shndx: 1,
},
{ st_name: 7,
- st_value: (Elf32_Addr) &android_dlclose,
+ st_value: (Elf_Addr) &android_dlclose,
st_info: STB_GLOBAL << 4,
st_shndx: 1,
},
{ st_name: 15,
- st_value: (Elf32_Addr) &android_dlsym,
+ st_value: (Elf_Addr) &android_dlsym,
st_info: STB_GLOBAL << 4,
st_shndx: 1,
},
{ st_name: 21,
- st_value: (Elf32_Addr) &android_dlerror,
+ st_value: (Elf_Addr) &android_dlerror,
st_info: STB_GLOBAL << 4,
st_shndx: 1,
},
{ st_name: 29,
- st_value: (Elf32_Addr) &android_dladdr,
+ st_value: (Elf_Addr) &android_dladdr,
st_info: STB_GLOBAL << 4,
st_shndx: 1,
},
#ifdef ANDROID_ARM_LINKER
{ st_name: 36,
- st_value: (Elf32_Addr) &android_dl_unwind_find_exidx,
+ st_value: (Elf_Addr) &android_dl_unwind_find_exidx,
st_info: STB_GLOBAL << 4,
st_shndx: 1,
},
@@ -233,7 +233,7 @@
#else
{ st_name: 36,
#endif
- st_value: (Elf32_Addr) &android_dl_iterate_phdr,
+ st_value: (Elf_Addr) &android_dl_iterate_phdr,
st_info: STB_GLOBAL << 4,
st_shndx: 1,
},
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.17.tar.bz2/libhybris/hybris/common/jb/linker.c
^
|
@@ -380,10 +380,10 @@
return rv;
}
-static Elf32_Sym *_elf_lookup(soinfo *si, unsigned hash, const char *name)
+static Elf_Sym *_elf_lookup(soinfo *si, unsigned hash, const char *name)
{
- Elf32_Sym *s;
- Elf32_Sym *symtab = si->symtab;
+ Elf_Sym *s;
+ Elf_Sym *symtab = si->symtab;
const char *strtab = si->strtab;
unsigned n;
@@ -425,11 +425,11 @@
return h;
}
-static Elf32_Sym *
+static Elf_Sym *
_do_lookup(soinfo *si, const char *name, unsigned *base)
{
unsigned elf_hash = elfhash(name);
- Elf32_Sym *s;
+ Elf_Sym *s;
unsigned *d;
soinfo *lsi = si;
int i;
@@ -501,17 +501,17 @@
/* This is used by dl_sym(). It performs symbol lookup only within the
specified soinfo object and not in any of its dependencies.
*/
-Elf32_Sym *lookup_in_library(soinfo *si, const char *name)
+Elf_Sym *lookup_in_library(soinfo *si, const char *name)
{
return _elf_lookup(si, elfhash(name), name);
}
/* This is used by dl_sym(). It performs a global symbol lookup.
*/
-Elf32_Sym *lookup(const char *name, soinfo **found, soinfo *start)
+Elf_Sym *lookup(const char *name, soinfo **found, soinfo *start)
{
unsigned elf_hash = elfhash(name);
- Elf32_Sym *s = NULL;
+ Elf_Sym *s = NULL;
soinfo *si;
if(start == NULL) {
@@ -552,7 +552,7 @@
return NULL;
}
-Elf32_Sym *find_containing_symbol(const void *addr, soinfo *si)
+Elf_Sym *find_containing_symbol(const void *addr, soinfo *si)
{
unsigned int i;
unsigned soaddr = (unsigned)addr - si->base;
@@ -560,7 +560,7 @@
/* Search the library's symbol table for any defined symbol which
* contains this address */
for(i=0; i<si->nchain; i++) {
- Elf32_Sym *sym = &si->symtab[i];
+ Elf_Sym *sym = &si->symtab[i];
if(sym->st_shndx != SHN_UNDEF &&
soaddr >= sym->st_value &&
@@ -575,7 +575,7 @@
#if 0
static void dump(soinfo *si)
{
- Elf32_Sym *s = si->symtab;
+ Elf_Sym *s = si->symtab;
unsigned n;
for(n = 0; n < si->nchain; n++) {
@@ -704,7 +704,7 @@
static int
verify_elf_object(void *base, const char *name)
{
- Elf32_Ehdr *hdr = (Elf32_Ehdr *) base;
+ Elf_Ehdr *hdr = (Elf_Ehdr *) base;
if (hdr->e_ident[EI_MAG0] != ELFMAG0) return -1;
if (hdr->e_ident[EI_MAG1] != ELFMAG1) return -1;
@@ -749,8 +749,8 @@
unsigned min_vaddr = 0xffffffff;
unsigned max_vaddr = 0;
unsigned char *_hdr = (unsigned char *)__hdr;
- Elf32_Ehdr *ehdr = (Elf32_Ehdr *)_hdr;
- Elf32_Phdr *phdr;
+ Elf_Ehdr *ehdr = (Elf_Ehdr *)_hdr;
+ Elf_Phdr *phdr;
int cnt;
TRACE("[ %5d Computing extents for '%s'. ]\n", pid, name);
@@ -769,7 +769,7 @@
TRACE("[ %5d - Non-prelinked library '%s' found. ]\n", pid, name);
}
- phdr = (Elf32_Phdr *)(_hdr + ehdr->e_phoff);
+ phdr = (Elf_Phdr *)(_hdr + ehdr->e_phoff);
/* find the min/max p_vaddrs from all the PT_LOAD segments so we can
* get the range. */
@@ -884,12 +884,12 @@
static int
load_segments(int fd, void *header, soinfo *si)
{
- Elf32_Ehdr *ehdr = (Elf32_Ehdr *)header;
- Elf32_Phdr *phdr = (Elf32_Phdr *)((unsigned char *)header + ehdr->e_phoff);
- Elf32_Addr base = (Elf32_Addr) si->base;
+ Elf_Ehdr *ehdr = (Elf_Ehdr *)header;
+ Elf_Phdr *phdr = (Elf_Phdr *)((unsigned char *)header + ehdr->e_phoff);
+ Elf_Addr base = (Elf_Addr) si->base;
int cnt;
unsigned len;
- Elf32_Addr tmp;
+ Elf_Addr tmp;
unsigned char *pbase;
unsigned char *extra_base;
unsigned extra_len;
@@ -955,7 +955,7 @@
* | |
* _+---------------------+ page boundary
*/
- tmp = (Elf32_Addr)(((unsigned)pbase + len + PAGE_SIZE - 1) &
+ tmp = (Elf_Addr)(((unsigned)pbase + len + PAGE_SIZE - 1) &
(~PAGE_MASK));
if (tmp < (base + phdr->p_vaddr + phdr->p_memsz)) {
extra_len = base + phdr->p_vaddr + phdr->p_memsz - tmp;
@@ -1019,7 +1019,7 @@
phdr->p_vaddr, phdr->p_memsz);
goto fail;
}
- si->gnu_relro_start = (Elf32_Addr) (base + phdr->p_vaddr);
+ si->gnu_relro_start = (Elf_Addr) (base + phdr->p_vaddr);
si->gnu_relro_len = (unsigned) phdr->p_memsz;
} else {
#ifdef ANDROID_ARM_LINKER
@@ -1066,11 +1066,11 @@
*/
#if 0
static unsigned
-get_wr_offset(int fd, const char *name, Elf32_Ehdr *ehdr)
+get_wr_offset(int fd, const char *name, Elf_Ehdr *ehdr)
{
- Elf32_Shdr *shdr_start;
- Elf32_Shdr *shdr;
- int shdr_sz = ehdr->e_shnum * sizeof(Elf32_Shdr);
+ Elf_Shdr *shdr_start;
+ Elf_Shdr *shdr;
+ int shdr_sz = ehdr->e_shnum * sizeof(Elf_Shdr);
int cnt;
unsigned wr_offset = 0xffffffff;
@@ -1103,7 +1103,7 @@
unsigned req_base;
const char *bname;
soinfo *si = NULL;
- Elf32_Ehdr *hdr;
+ Elf_Ehdr *hdr;
if(fd == -1) {
DL_ERR("Library '%s' not found", name);
@@ -1160,8 +1160,8 @@
/* this might not be right. Technically, we don't even need this info
* once we go through 'load_segments'. */
- hdr = (Elf32_Ehdr *)si->base;
- si->phdr = (Elf32_Phdr *)((unsigned char *)si->base + hdr->e_phoff);
+ hdr = (Elf_Ehdr *)si->base;
+ si->phdr = (Elf_Phdr *)((unsigned char *)si->base + hdr->e_phoff);
si->phnum = hdr->e_phnum;
/**/
@@ -1260,7 +1260,7 @@
* in link_image. This is needed to undo the DT_NEEDED hack below.
*/
if ((si->gnu_relro_start != 0) && (si->gnu_relro_len != 0)) {
- Elf32_Addr start = (si->gnu_relro_start & ~PAGE_MASK);
+ Elf_Addr start = (si->gnu_relro_start & ~PAGE_MASK);
unsigned len = (si->gnu_relro_start - start) + si->gnu_relro_len;
if (mprotect((void *) start, len, PROT_READ | PROT_WRITE) < 0)
DL_ERR("%5d %s: could not undo GNU_RELRO protections. "
@@ -1303,16 +1303,16 @@
}
/* TODO: don't use unsigned for addrs below. It works, but is not
- * ideal. They should probably be either uint32_t, Elf32_Addr, or unsigned
+ * ideal. They should probably be either uint32_t, Elf_Addr, or unsigned
* long.
*/
-static int reloc_library(soinfo *si, Elf32_Rel *rel, unsigned count)
+static int reloc_library(soinfo *si, Elf_Rel *rel, unsigned count)
{
- Elf32_Sym *symtab = si->symtab;
+ Elf_Sym *symtab = si->symtab;
const char *strtab = si->strtab;
- Elf32_Sym *s;
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.17.tar.bz2/libhybris/hybris/common/jb/linker.h
^
|
@@ -38,6 +38,26 @@
#define PAGE_SIZE 4096
#define PAGE_MASK 4095
+#if defined(__x86_64__)
+typedef Elf64_Ehdr Elf_Ehdr;
+typedef Elf64_Shdr Elf_Shdr;
+typedef Elf64_Sym Elf_Sym;
+typedef Elf64_Addr Elf_Addr;
+typedef Elf64_Phdr Elf_Phdr;
+typedef Elf64_Half Elf_Half;
+typedef Elf64_Rel Elf_Rel;
+typedef Elf64_Rela Elf_Rela;
+#else
+typedef Elf32_Ehdr Elf_Ehdr;
+typedef Elf32_Shdr Elf_Shdr;
+typedef Elf32_Sym Elf_Sym;
+typedef Elf32_Addr Elf_Addr;
+typedef Elf32_Phdr Elf_Phdr;
+typedef Elf32_Half Elf_Half;
+typedef Elf32_Rel Elf_Rel;
+typedef Elf32_Rela Elf_Rela;
+#endif
+
void debugger_init();
const char *addr_to_name(unsigned addr);
@@ -55,10 +75,10 @@
/* needed for dl_iterate_phdr to be passed to the callbacks provided */
struct dl_phdr_info
{
- Elf32_Addr dlpi_addr;
+ Elf_Addr dlpi_addr;
const char *dlpi_name;
- const Elf32_Phdr *dlpi_phdr;
- Elf32_Half dlpi_phnum;
+ const Elf_Phdr *dlpi_phdr;
+ Elf_Half dlpi_phnum;
};
@@ -90,7 +110,7 @@
struct soinfo
{
const char name[SOINFO_NAME_LEN];
- Elf32_Phdr *phdr;
+ Elf_Phdr *phdr;
int phnum;
unsigned entry;
unsigned base;
@@ -107,7 +127,7 @@
unsigned flags;
const char *strtab;
- Elf32_Sym *symtab;
+ Elf_Sym *symtab;
unsigned nbucket;
unsigned nchain;
@@ -116,10 +136,10 @@
unsigned *plt_got;
- Elf32_Rel *plt_rel;
+ Elf_Rel *plt_rel;
unsigned plt_rel_count;
- Elf32_Rel *rel;
+ Elf_Rel *rel;
unsigned rel_count;
unsigned *preinit_array;
@@ -144,7 +164,7 @@
int constructors_called;
- Elf32_Addr gnu_relro_start;
+ Elf_Addr gnu_relro_start;
unsigned gnu_relro_len;
};
@@ -202,10 +222,10 @@
soinfo *find_library(const char *name);
unsigned unload_library(soinfo *si);
-Elf32_Sym *lookup_in_library(soinfo *si, const char *name);
-Elf32_Sym *lookup(const char *name, soinfo **found, soinfo *start);
+Elf_Sym *lookup_in_library(soinfo *si, const char *name);
+Elf_Sym *lookup(const char *name, soinfo **found, soinfo *start);
soinfo *find_containing_library(const void *addr);
-Elf32_Sym *find_containing_symbol(const void *addr, soinfo *si);
+Elf_Sym *find_containing_symbol(const void *addr, soinfo *si);
const char *linker_get_error(void);
void call_constructors_recursive(soinfo *si);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.17.tar.bz2/libhybris/hybris/configure.ac
^
|
@@ -181,6 +181,7 @@
AM_CONDITIONAL([HAS_ANDROID_5_0_0], [test $android_headers_major -ge 5 -a $android_headers_minor -ge 0 ])
AM_CONDITIONAL([HAS_ANDROID_4_2_0], [test $android_headers_major -ge 4 -a $android_headers_minor -ge 2 ])
AM_CONDITIONAL([HAS_ANDROID_4_1_0], [test $android_headers_major -ge 4 -a $android_headers_minor -ge 1 ])
+AM_CONDITIONAL([HAS_ANDROID_4_0_3], [test $android_headers_major -ge 4 -a $android_headers_patch -ge 3 ])
AM_CONDITIONAL([HAS_ANDROID_4_0_0], [test $android_headers_major -ge 4 -a $android_headers_minor -ge 0 ])
AM_CONDITIONAL([HAS_ANDROID_2_3_0], [test $android_headers_major -ge 2 -a $android_headers_minor -ge 3 ])
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.17.tar.bz2/libhybris/hybris/libnfc_nxp/libnfc_nxp.c
^
|
@@ -138,10 +138,17 @@
HYBRIS_IMPLEMENT_FUNCTION2(libnfc_so, NFCSTATUS, phFriNfc_LlcpTransport_SocketGetLocalOptions, phFriNfc_LlcpTransport_Socket_t *, phLibNfc_Llcp_sSocketOptions_t *);
HYBRIS_IMPLEMENT_FUNCTION3(libnfc_so, NFCSTATUS, phLibNfc_Llcp_SocketGetRemoteOptions, phLibNfc_Handle, phLibNfc_Handle, phLibNfc_Llcp_sSocketOptions_t *);
HYBRIS_IMPLEMENT_FUNCTION2(libnfc_so, NFCSTATUS, phFriNfc_LlcpTransport_SocketGetRemoteOptions, phFriNfc_LlcpTransport_Socket_t *, phLibNfc_Llcp_sSocketOptions_t *);
+#if (ANDROID_VERSION_MAJOR == 4 && ANDROID_VERSION_MINOR >= 1) || (ANDROID_VERSION_MAJOR >= 5)
HYBRIS_IMPLEMENT_FUNCTION3(libnfc_so, NFCSTATUS, phLibNfc_Llcp_Bind, phLibNfc_Handle, uint8_t, phNfc_sData_t *);
HYBRIS_IMPLEMENT_FUNCTION3(libnfc_so, NFCSTATUS, phFriNfc_LlcpTransport_Bind, phFriNfc_LlcpTransport_Socket_t *, uint8_t, phNfc_sData_t *);
HYBRIS_IMPLEMENT_FUNCTION3(libnfc_so, NFCSTATUS, phLibNfc_Llcp_Listen, phLibNfc_Handle, pphLibNfc_LlcpSocketListenCb_t, void *);
HYBRIS_IMPLEMENT_FUNCTION3(libnfc_so, NFCSTATUS, phFriNfc_LlcpTransport_Listen, phFriNfc_LlcpTransport_Socket_t *, pphFriNfc_LlcpTransportSocketListenCb_t, void *);
+#else
+HYBRIS_IMPLEMENT_FUNCTION2(libnfc_so, NFCSTATUS, phLibNfc_Llcp_Bind, phLibNfc_Handle, uint8_t);
+HYBRIS_IMPLEMENT_FUNCTION2(libnfc_so, NFCSTATUS, phFriNfc_LlcpTransport_Bind, phFriNfc_LlcpTransport_Socket_t *, uint8_t);
+HYBRIS_IMPLEMENT_FUNCTION4(libnfc_so, NFCSTATUS, phLibNfc_Llcp_Listen, phLibNfc_Handle, phNfc_sData_t *, pphLibNfc_LlcpSocketListenCb_t, void *);
+HYBRIS_IMPLEMENT_FUNCTION4(libnfc_so, NFCSTATUS, phFriNfc_LlcpTransport_Listen, phFriNfc_LlcpTransport_Socket_t *, phNfc_sData_t *, pphFriNfc_LlcpTransportSocketListenCb_t, void *);
+#endif
HYBRIS_IMPLEMENT_FUNCTION6(libnfc_so, NFCSTATUS, phLibNfc_Llcp_Accept, phLibNfc_Handle, phLibNfc_Llcp_sSocketOptions_t *, phNfc_sData_t *, pphLibNfc_LlcpSocketErrCb_t, pphLibNfc_LlcpSocketAcceptCb_t, void *);
HYBRIS_IMPLEMENT_FUNCTION6(libnfc_so, NFCSTATUS, phFriNfc_LlcpTransport_Accept, phFriNfc_LlcpTransport_Socket_t *, phFriNfc_LlcpTransport_sSocketOptions_t *, phNfc_sData_t *, pphFriNfc_LlcpTransportSocketErrCb_t, pphFriNfc_LlcpTransportSocketAcceptCb_t, void *);
HYBRIS_IMPLEMENT_FUNCTION4(libnfc_so, NFCSTATUS, phLibNfc_Llcp_Reject, phLibNfc_Handle, phLibNfc_Handle, pphLibNfc_LlcpSocketRejectCb_t, void *);
@@ -184,7 +191,11 @@
HYBRIS_IMPLEMENT_FUNCTION6(libnfc_so, NFCSTATUS, phFriNfc_NdefSmtCrd_Reset, phFriNfc_sNdefSmtCrdFmt_t *, void *, phHal_sRemoteDevInformation_t *, phHal_sDevInputParam_t *, uint8_t *, uint16_t *);
HYBRIS_IMPLEMENT_FUNCTION4(libnfc_so, NFCSTATUS, phFriNfc_NdefSmtCrd_SetCR, phFriNfc_sNdefSmtCrdFmt_t *, uint8_t, pphFriNfc_Cr_t, void *);
HYBRIS_IMPLEMENT_FUNCTION2(libnfc_so, NFCSTATUS, phFriNfc_NdefSmtCrd_Format, phFriNfc_sNdefSmtCrdFmt_t *, const uint8_t *);
+#if (ANDROID_VERSION_MAJOR == 4 && ANDROID_VERSION_MINOR >= 1) || (ANDROID_VERSION_MAJOR >= 5)
HYBRIS_IMPLEMENT_FUNCTION4(libnfc_so, NFCSTATUS, phLibNfc_ConvertToReadOnlyNdef, phLibNfc_Handle, phNfc_sData_t *, pphLibNfc_RspCb_t, void *);
+#else
+HYBRIS_IMPLEMENT_FUNCTION3(libnfc_so, NFCSTATUS, phLibNfc_ConvertToReadOnlyNdef, phLibNfc_Handle, pphLibNfc_RspCb_t, void *);
+#endif
HYBRIS_IMPLEMENT_FUNCTION1(libnfc_so, NFCSTATUS, phFriNfc_NdefMap_ConvertToReadOnly, phFriNfc_NdefMap_t *);
HYBRIS_IMPLEMENT_FUNCTION1(libnfc_so, NFCSTATUS, phFriNfc_NdefSmtCrd_ConvertToReadOnly, phFriNfc_sNdefSmtCrdFmt_t *);
HYBRIS_IMPLEMENT_FUNCTION2(libnfc_so, NFCSTATUS, phFriNfc_MifareStdMap_ConvertToReadOnly, phFriNfc_NdefMap_t *, const uint8_t *);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.17.tar.bz2/libhybris/hybris/tests/Makefile.am
^
|
@@ -16,14 +16,22 @@
if HAS_LIBNFC_NXP_HEADERS
+# test_nfc depends on NFC hardware HAL interface, which is only
+# available until Android API level 15 (v4.0.3, v4.0.4).
+if HAS_ANDROID_4_0_3
+bin_PROGRAMS += test_nfc
+else
+if HAS_ANDROID_4_1_0
+bin_PROGRAMS += test_nfc
+else
+if HAS_ANDROID_5_0_0
bin_PROGRAMS += test_nfc
endif
+endif
+endif
+endif
-# Please re-enable your test programs according to android
-# if HAS_ANDROID_X_Y_Z
-# bin_PROGRAMS += test_audio
-# endif
-
+bin_PROGRAMS += test_audio
test_audio_SOURCES = test_audio.c
test_audio_CFLAGS = \
-I$(top_srcdir)/include
@@ -108,13 +116,6 @@
test_gps_CFLAGS = -pthread \
-I$(top_srcdir)/include \
$(ANDROID_HEADERS_CFLAGS)
-
-if HAS_ANDROID_4_2_0
-test_gps_CFLAGS += -DHAS_ANDROID_4_2_0
-endif
-if HAS_ANDROID_5_0_0
-test_gps_CFLAGS += -DHAS_ANDROID_5_0_0
-endif
test_gps_LDFLAGS = -pthread
test_gps_LDADD = \
$(top_builddir)/common/libhybris-common.la \
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.17.tar.bz2/libhybris/hybris/tests/test_audio.c
^
|
@@ -31,7 +31,11 @@
struct audio_hw_device *audiohw;
hw_get_module_by_class(AUDIO_HARDWARE_MODULE_ID,
+#if defined(AUDIO_HARDWARE_MODULE_ID_PRIMARY)
AUDIO_HARDWARE_MODULE_ID_PRIMARY,
+#else
+ "primary",
+#endif
(const hw_module_t**) &hwmod);
assert(hwmod != NULL);
@@ -39,17 +43,21 @@
assert(audiohw->init_check(audiohw) == 0);
printf("Audio Hardware Interface initialized.\n");
+#if (ANDROID_VERSION_MAJOR == 4 && ANDROID_VERSION_MINOR >= 1) || (ANDROID_VERSION_MAJOR >= 5)
if (audiohw->get_master_volume) {
float volume;
audiohw->get_master_volume(audiohw, &volume);
printf("Master Volume: %f\n", volume);
}
+#endif
+#if (ANDROID_VERSION_MAJOR == 4 && ANDROID_VERSION_MINOR >= 2) || (ANDROID_VERSION_MAJOR >= 5)
if (audiohw->get_master_mute) {
bool mute;
audiohw->get_master_mute(audiohw, &mute);
printf("Master Mute: %d\n", mute);
}
+#endif
audio_hw_device_close(audiohw);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.17.tar.bz2/libhybris/hybris/tests/test_gps.c
^
|
@@ -288,19 +288,11 @@
{
case GPS_REQUEST_AGPS_DATA_CONN:
fprintf(stdout, "*** data_conn_open\n");
-#if ! defined(HAS_ANDROID_4_2_0) && ! defined(HAS_ANDROID_5_0_0)
- AGps->data_conn_open(AGPS_TYPE_SUPL, apn, AGPS_APN_BEARER_IPV4);
-#else
AGps->data_conn_open(apn);
-#endif
break;
case GPS_RELEASE_AGPS_DATA_CONN:
fprintf(stdout, "*** data_conn_closed\n");
-#if ! defined(HAS_ANDROID_4_2_0) && ! defined(HAS_ANDROID_5_0_0)
- AGps->data_conn_closed(AGPS_TYPE_SUPL);
-#else
AGps->data_conn_closed();
-#endif
break;
case GPS_AGPS_DATA_CONNECTED:
fprintf(stdout, "*** data_conn_established\n");
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.17.tar.bz2/libhybris/hybris/tests/test_nfc.c
^
|
@@ -227,7 +227,9 @@
phLibNfc_sADD_Cfg_t discoveryConfig;
discoveryConfig.NfcIP_Mode = phNfc_eP2P_ALL;
+#if (ANDROID_VERSION_MAJOR == 4 && ANDROID_VERSION_MINOR >= 1) || (ANDROID_VERSION_MAJOR >= 5)
discoveryConfig.NfcIP_Target_Mode = 0x0E;
+#endif
discoveryConfig.Duration = 300000;
discoveryConfig.NfcIP_Tgt_Disable = 0;
discoveryConfig.PollDevInfo.PollCfgInfo.EnableIso14443A = 1;
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.17.tar.bz2/libhybris/hybris/tests/test_sensors.c
^
|
@@ -80,11 +80,19 @@
printf("Hardware module ID: %s\n", hwmod->id);
printf("Hardware module Name: %s\n", hwmod->name);
printf("Hardware module Author: %s\n", hwmod->author);
+#ifdef HARDWARE_HAL_API_VERSION
printf("Hardware module API version: 0x%x\n", hwmod->module_api_version);
printf("Hardware HAL API version: 0x%x\n", hwmod->hal_api_version);
+#else
+ printf("Hardware module API version: 0x%x\n", hwmod->version_major);
+ printf("Hardware HAL API version: 0x%x\n", hwmod->version_minor);
+#endif
printf("Poll device version: 0x%x\n", dev->common.version);
- printf("API VERSION 0.1 (legacy): 0x%x\n", HARDWARE_MODULE_API_VERSION(0, 1));
+#ifndef SENSORS_MODULE_API_VERSION_0_1
+#define SENSORS_MODULE_API_VERSION_0_1 0x0001
+#endif
+ printf("API VERSION 0.1 (legacy): 0x%x\n", SENSORS_MODULE_API_VERSION_0_1);
#ifdef SENSORS_DEVICE_API_VERSION_0_1
printf("API VERSION 0.1: 0x%d\n", SENSORS_DEVICE_API_VERSION_0_1);
#endif
@@ -94,6 +102,15 @@
#ifdef SENSORS_DEVICE_API_VERSION_1_1
printf("API VERSION 1.1: 0x%d\n", SENSORS_DEVICE_API_VERSION_1_1);
#endif
+#ifdef SENSORS_DEVICE_API_VERSION_1_2
+ printf("API VERSION 1.2: 0x%d\n", SENSORS_DEVICE_API_VERSION_1_2);
+#endif
+#ifdef SENSORS_DEVICE_API_VERSION_1_3
+ printf("API VERSION 1.3: 0x%d\n", SENSORS_DEVICE_API_VERSION_1_3);
+#endif
+#ifdef SENSORS_DEVICE_API_VERSION_1_4
+ printf("API VERSION 1.4: 0x%d\n", SENSORS_DEVICE_API_VERSION_1_4);
+#endif
struct sensors_module_t *smod = (struct sensors_module_t *)(hwmod);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.17.tar.bz2/upstream/hybris/common/hooks.c
^
|
@@ -1428,6 +1428,7 @@
{"memmove",memmove},
{"memset",memset},
{"memmem",memmem},
+ {"getlogin", getlogin},
// {"memswap",memswap},
{"index",index},
{"rindex",rindex},
@@ -1469,6 +1470,8 @@
{"index",index},
{"rindex",rindex},
{"strcasecmp",strcasecmp},
+ {"__sprintf_chk", __sprintf_chk},
+ {"__snprintf_chk", __snprintf_chk},
{"strncasecmp",strncasecmp},
/* dirent.h */
{"opendir", opendir},
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.17.tar.bz2/upstream/hybris/common/jb/dlfcn.c
^
|
@@ -78,7 +78,7 @@
void *android_dlsym(void *handle, const char *symbol)
{
soinfo *found;
- Elf32_Sym *sym;
+ Elf_Sym *sym;
unsigned bind;
pthread_mutex_lock(&dl_lock);
@@ -142,7 +142,7 @@
info->dli_fbase = (void*)si->base;
/* Determine if any symbol in the library contains the specified address */
- Elf32_Sym *sym = find_containing_symbol(addr, si);
+ Elf_Sym *sym = find_containing_symbol(addr, si);
if(sym != NULL) {
info->dli_sname = si->strtab + sym->st_name;
@@ -191,7 +191,7 @@
#endif
-static Elf32_Sym libdl_symtab[] = {
+static Elf_Sym libdl_symtab[] = {
// total length of libdl_info.strtab, including trailing 0
// This is actually the the STH_UNDEF entry. Technically, it's
// supposed to have st_name == 0, but instead, it points to an index
@@ -199,33 +199,33 @@
{ st_name: sizeof(ANDROID_LIBDL_STRTAB) - 1,
},
{ st_name: 0, // starting index of the name in libdl_info.strtab
- st_value: (Elf32_Addr) &android_dlopen,
+ st_value: (Elf_Addr) &android_dlopen,
st_info: STB_GLOBAL << 4,
st_shndx: 1,
},
{ st_name: 7,
- st_value: (Elf32_Addr) &android_dlclose,
+ st_value: (Elf_Addr) &android_dlclose,
st_info: STB_GLOBAL << 4,
st_shndx: 1,
},
{ st_name: 15,
- st_value: (Elf32_Addr) &android_dlsym,
+ st_value: (Elf_Addr) &android_dlsym,
st_info: STB_GLOBAL << 4,
st_shndx: 1,
},
{ st_name: 21,
- st_value: (Elf32_Addr) &android_dlerror,
+ st_value: (Elf_Addr) &android_dlerror,
st_info: STB_GLOBAL << 4,
st_shndx: 1,
},
{ st_name: 29,
- st_value: (Elf32_Addr) &android_dladdr,
+ st_value: (Elf_Addr) &android_dladdr,
st_info: STB_GLOBAL << 4,
st_shndx: 1,
},
#ifdef ANDROID_ARM_LINKER
{ st_name: 36,
- st_value: (Elf32_Addr) &android_dl_unwind_find_exidx,
+ st_value: (Elf_Addr) &android_dl_unwind_find_exidx,
st_info: STB_GLOBAL << 4,
st_shndx: 1,
},
@@ -233,7 +233,7 @@
#else
{ st_name: 36,
#endif
- st_value: (Elf32_Addr) &android_dl_iterate_phdr,
+ st_value: (Elf_Addr) &android_dl_iterate_phdr,
st_info: STB_GLOBAL << 4,
st_shndx: 1,
},
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.17.tar.bz2/upstream/hybris/common/jb/linker.c
^
|
@@ -380,10 +380,10 @@
return rv;
}
-static Elf32_Sym *_elf_lookup(soinfo *si, unsigned hash, const char *name)
+static Elf_Sym *_elf_lookup(soinfo *si, unsigned hash, const char *name)
{
- Elf32_Sym *s;
- Elf32_Sym *symtab = si->symtab;
+ Elf_Sym *s;
+ Elf_Sym *symtab = si->symtab;
const char *strtab = si->strtab;
unsigned n;
@@ -425,11 +425,11 @@
return h;
}
-static Elf32_Sym *
+static Elf_Sym *
_do_lookup(soinfo *si, const char *name, unsigned *base)
{
unsigned elf_hash = elfhash(name);
- Elf32_Sym *s;
+ Elf_Sym *s;
unsigned *d;
soinfo *lsi = si;
int i;
@@ -501,17 +501,17 @@
/* This is used by dl_sym(). It performs symbol lookup only within the
specified soinfo object and not in any of its dependencies.
*/
-Elf32_Sym *lookup_in_library(soinfo *si, const char *name)
+Elf_Sym *lookup_in_library(soinfo *si, const char *name)
{
return _elf_lookup(si, elfhash(name), name);
}
/* This is used by dl_sym(). It performs a global symbol lookup.
*/
-Elf32_Sym *lookup(const char *name, soinfo **found, soinfo *start)
+Elf_Sym *lookup(const char *name, soinfo **found, soinfo *start)
{
unsigned elf_hash = elfhash(name);
- Elf32_Sym *s = NULL;
+ Elf_Sym *s = NULL;
soinfo *si;
if(start == NULL) {
@@ -552,7 +552,7 @@
return NULL;
}
-Elf32_Sym *find_containing_symbol(const void *addr, soinfo *si)
+Elf_Sym *find_containing_symbol(const void *addr, soinfo *si)
{
unsigned int i;
unsigned soaddr = (unsigned)addr - si->base;
@@ -560,7 +560,7 @@
/* Search the library's symbol table for any defined symbol which
* contains this address */
for(i=0; i<si->nchain; i++) {
- Elf32_Sym *sym = &si->symtab[i];
+ Elf_Sym *sym = &si->symtab[i];
if(sym->st_shndx != SHN_UNDEF &&
soaddr >= sym->st_value &&
@@ -575,7 +575,7 @@
#if 0
static void dump(soinfo *si)
{
- Elf32_Sym *s = si->symtab;
+ Elf_Sym *s = si->symtab;
unsigned n;
for(n = 0; n < si->nchain; n++) {
@@ -704,7 +704,7 @@
static int
verify_elf_object(void *base, const char *name)
{
- Elf32_Ehdr *hdr = (Elf32_Ehdr *) base;
+ Elf_Ehdr *hdr = (Elf_Ehdr *) base;
if (hdr->e_ident[EI_MAG0] != ELFMAG0) return -1;
if (hdr->e_ident[EI_MAG1] != ELFMAG1) return -1;
@@ -749,8 +749,8 @@
unsigned min_vaddr = 0xffffffff;
unsigned max_vaddr = 0;
unsigned char *_hdr = (unsigned char *)__hdr;
- Elf32_Ehdr *ehdr = (Elf32_Ehdr *)_hdr;
- Elf32_Phdr *phdr;
+ Elf_Ehdr *ehdr = (Elf_Ehdr *)_hdr;
+ Elf_Phdr *phdr;
int cnt;
TRACE("[ %5d Computing extents for '%s'. ]\n", pid, name);
@@ -769,7 +769,7 @@
TRACE("[ %5d - Non-prelinked library '%s' found. ]\n", pid, name);
}
- phdr = (Elf32_Phdr *)(_hdr + ehdr->e_phoff);
+ phdr = (Elf_Phdr *)(_hdr + ehdr->e_phoff);
/* find the min/max p_vaddrs from all the PT_LOAD segments so we can
* get the range. */
@@ -884,12 +884,12 @@
static int
load_segments(int fd, void *header, soinfo *si)
{
- Elf32_Ehdr *ehdr = (Elf32_Ehdr *)header;
- Elf32_Phdr *phdr = (Elf32_Phdr *)((unsigned char *)header + ehdr->e_phoff);
- Elf32_Addr base = (Elf32_Addr) si->base;
+ Elf_Ehdr *ehdr = (Elf_Ehdr *)header;
+ Elf_Phdr *phdr = (Elf_Phdr *)((unsigned char *)header + ehdr->e_phoff);
+ Elf_Addr base = (Elf_Addr) si->base;
int cnt;
unsigned len;
- Elf32_Addr tmp;
+ Elf_Addr tmp;
unsigned char *pbase;
unsigned char *extra_base;
unsigned extra_len;
@@ -955,7 +955,7 @@
* | |
* _+---------------------+ page boundary
*/
- tmp = (Elf32_Addr)(((unsigned)pbase + len + PAGE_SIZE - 1) &
+ tmp = (Elf_Addr)(((unsigned)pbase + len + PAGE_SIZE - 1) &
(~PAGE_MASK));
if (tmp < (base + phdr->p_vaddr + phdr->p_memsz)) {
extra_len = base + phdr->p_vaddr + phdr->p_memsz - tmp;
@@ -1019,7 +1019,7 @@
phdr->p_vaddr, phdr->p_memsz);
goto fail;
}
- si->gnu_relro_start = (Elf32_Addr) (base + phdr->p_vaddr);
+ si->gnu_relro_start = (Elf_Addr) (base + phdr->p_vaddr);
si->gnu_relro_len = (unsigned) phdr->p_memsz;
} else {
#ifdef ANDROID_ARM_LINKER
@@ -1066,11 +1066,11 @@
*/
#if 0
static unsigned
-get_wr_offset(int fd, const char *name, Elf32_Ehdr *ehdr)
+get_wr_offset(int fd, const char *name, Elf_Ehdr *ehdr)
{
- Elf32_Shdr *shdr_start;
- Elf32_Shdr *shdr;
- int shdr_sz = ehdr->e_shnum * sizeof(Elf32_Shdr);
+ Elf_Shdr *shdr_start;
+ Elf_Shdr *shdr;
+ int shdr_sz = ehdr->e_shnum * sizeof(Elf_Shdr);
int cnt;
unsigned wr_offset = 0xffffffff;
@@ -1103,7 +1103,7 @@
unsigned req_base;
const char *bname;
soinfo *si = NULL;
- Elf32_Ehdr *hdr;
+ Elf_Ehdr *hdr;
if(fd == -1) {
DL_ERR("Library '%s' not found", name);
@@ -1160,8 +1160,8 @@
/* this might not be right. Technically, we don't even need this info
* once we go through 'load_segments'. */
- hdr = (Elf32_Ehdr *)si->base;
- si->phdr = (Elf32_Phdr *)((unsigned char *)si->base + hdr->e_phoff);
+ hdr = (Elf_Ehdr *)si->base;
+ si->phdr = (Elf_Phdr *)((unsigned char *)si->base + hdr->e_phoff);
si->phnum = hdr->e_phnum;
/**/
@@ -1260,7 +1260,7 @@
* in link_image. This is needed to undo the DT_NEEDED hack below.
*/
if ((si->gnu_relro_start != 0) && (si->gnu_relro_len != 0)) {
- Elf32_Addr start = (si->gnu_relro_start & ~PAGE_MASK);
+ Elf_Addr start = (si->gnu_relro_start & ~PAGE_MASK);
unsigned len = (si->gnu_relro_start - start) + si->gnu_relro_len;
if (mprotect((void *) start, len, PROT_READ | PROT_WRITE) < 0)
DL_ERR("%5d %s: could not undo GNU_RELRO protections. "
@@ -1303,16 +1303,16 @@
}
/* TODO: don't use unsigned for addrs below. It works, but is not
- * ideal. They should probably be either uint32_t, Elf32_Addr, or unsigned
+ * ideal. They should probably be either uint32_t, Elf_Addr, or unsigned
* long.
*/
-static int reloc_library(soinfo *si, Elf32_Rel *rel, unsigned count)
+static int reloc_library(soinfo *si, Elf_Rel *rel, unsigned count)
{
- Elf32_Sym *symtab = si->symtab;
+ Elf_Sym *symtab = si->symtab;
const char *strtab = si->strtab;
- Elf32_Sym *s;
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.17.tar.bz2/upstream/hybris/common/jb/linker.h
^
|
@@ -38,6 +38,26 @@
#define PAGE_SIZE 4096
#define PAGE_MASK 4095
+#if defined(__x86_64__)
+typedef Elf64_Ehdr Elf_Ehdr;
+typedef Elf64_Shdr Elf_Shdr;
+typedef Elf64_Sym Elf_Sym;
+typedef Elf64_Addr Elf_Addr;
+typedef Elf64_Phdr Elf_Phdr;
+typedef Elf64_Half Elf_Half;
+typedef Elf64_Rel Elf_Rel;
+typedef Elf64_Rela Elf_Rela;
+#else
+typedef Elf32_Ehdr Elf_Ehdr;
+typedef Elf32_Shdr Elf_Shdr;
+typedef Elf32_Sym Elf_Sym;
+typedef Elf32_Addr Elf_Addr;
+typedef Elf32_Phdr Elf_Phdr;
+typedef Elf32_Half Elf_Half;
+typedef Elf32_Rel Elf_Rel;
+typedef Elf32_Rela Elf_Rela;
+#endif
+
void debugger_init();
const char *addr_to_name(unsigned addr);
@@ -55,10 +75,10 @@
/* needed for dl_iterate_phdr to be passed to the callbacks provided */
struct dl_phdr_info
{
- Elf32_Addr dlpi_addr;
+ Elf_Addr dlpi_addr;
const char *dlpi_name;
- const Elf32_Phdr *dlpi_phdr;
- Elf32_Half dlpi_phnum;
+ const Elf_Phdr *dlpi_phdr;
+ Elf_Half dlpi_phnum;
};
@@ -90,7 +110,7 @@
struct soinfo
{
const char name[SOINFO_NAME_LEN];
- Elf32_Phdr *phdr;
+ Elf_Phdr *phdr;
int phnum;
unsigned entry;
unsigned base;
@@ -107,7 +127,7 @@
unsigned flags;
const char *strtab;
- Elf32_Sym *symtab;
+ Elf_Sym *symtab;
unsigned nbucket;
unsigned nchain;
@@ -116,10 +136,10 @@
unsigned *plt_got;
- Elf32_Rel *plt_rel;
+ Elf_Rel *plt_rel;
unsigned plt_rel_count;
- Elf32_Rel *rel;
+ Elf_Rel *rel;
unsigned rel_count;
unsigned *preinit_array;
@@ -144,7 +164,7 @@
int constructors_called;
- Elf32_Addr gnu_relro_start;
+ Elf_Addr gnu_relro_start;
unsigned gnu_relro_len;
};
@@ -202,10 +222,10 @@
soinfo *find_library(const char *name);
unsigned unload_library(soinfo *si);
-Elf32_Sym *lookup_in_library(soinfo *si, const char *name);
-Elf32_Sym *lookup(const char *name, soinfo **found, soinfo *start);
+Elf_Sym *lookup_in_library(soinfo *si, const char *name);
+Elf_Sym *lookup(const char *name, soinfo **found, soinfo *start);
soinfo *find_containing_library(const void *addr);
-Elf32_Sym *find_containing_symbol(const void *addr, soinfo *si);
+Elf_Sym *find_containing_symbol(const void *addr, soinfo *si);
const char *linker_get_error(void);
void call_constructors_recursive(soinfo *si);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.17.tar.bz2/upstream/hybris/configure.ac
^
|
@@ -181,6 +181,7 @@
AM_CONDITIONAL([HAS_ANDROID_5_0_0], [test $android_headers_major -ge 5 -a $android_headers_minor -ge 0 ])
AM_CONDITIONAL([HAS_ANDROID_4_2_0], [test $android_headers_major -ge 4 -a $android_headers_minor -ge 2 ])
AM_CONDITIONAL([HAS_ANDROID_4_1_0], [test $android_headers_major -ge 4 -a $android_headers_minor -ge 1 ])
+AM_CONDITIONAL([HAS_ANDROID_4_0_3], [test $android_headers_major -ge 4 -a $android_headers_patch -ge 3 ])
AM_CONDITIONAL([HAS_ANDROID_4_0_0], [test $android_headers_major -ge 4 -a $android_headers_minor -ge 0 ])
AM_CONDITIONAL([HAS_ANDROID_2_3_0], [test $android_headers_major -ge 2 -a $android_headers_minor -ge 3 ])
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.17.tar.bz2/upstream/hybris/libnfc_nxp/libnfc_nxp.c
^
|
@@ -138,10 +138,17 @@
HYBRIS_IMPLEMENT_FUNCTION2(libnfc_so, NFCSTATUS, phFriNfc_LlcpTransport_SocketGetLocalOptions, phFriNfc_LlcpTransport_Socket_t *, phLibNfc_Llcp_sSocketOptions_t *);
HYBRIS_IMPLEMENT_FUNCTION3(libnfc_so, NFCSTATUS, phLibNfc_Llcp_SocketGetRemoteOptions, phLibNfc_Handle, phLibNfc_Handle, phLibNfc_Llcp_sSocketOptions_t *);
HYBRIS_IMPLEMENT_FUNCTION2(libnfc_so, NFCSTATUS, phFriNfc_LlcpTransport_SocketGetRemoteOptions, phFriNfc_LlcpTransport_Socket_t *, phLibNfc_Llcp_sSocketOptions_t *);
+#if (ANDROID_VERSION_MAJOR == 4 && ANDROID_VERSION_MINOR >= 1) || (ANDROID_VERSION_MAJOR >= 5)
HYBRIS_IMPLEMENT_FUNCTION3(libnfc_so, NFCSTATUS, phLibNfc_Llcp_Bind, phLibNfc_Handle, uint8_t, phNfc_sData_t *);
HYBRIS_IMPLEMENT_FUNCTION3(libnfc_so, NFCSTATUS, phFriNfc_LlcpTransport_Bind, phFriNfc_LlcpTransport_Socket_t *, uint8_t, phNfc_sData_t *);
HYBRIS_IMPLEMENT_FUNCTION3(libnfc_so, NFCSTATUS, phLibNfc_Llcp_Listen, phLibNfc_Handle, pphLibNfc_LlcpSocketListenCb_t, void *);
HYBRIS_IMPLEMENT_FUNCTION3(libnfc_so, NFCSTATUS, phFriNfc_LlcpTransport_Listen, phFriNfc_LlcpTransport_Socket_t *, pphFriNfc_LlcpTransportSocketListenCb_t, void *);
+#else
+HYBRIS_IMPLEMENT_FUNCTION2(libnfc_so, NFCSTATUS, phLibNfc_Llcp_Bind, phLibNfc_Handle, uint8_t);
+HYBRIS_IMPLEMENT_FUNCTION2(libnfc_so, NFCSTATUS, phFriNfc_LlcpTransport_Bind, phFriNfc_LlcpTransport_Socket_t *, uint8_t);
+HYBRIS_IMPLEMENT_FUNCTION4(libnfc_so, NFCSTATUS, phLibNfc_Llcp_Listen, phLibNfc_Handle, phNfc_sData_t *, pphLibNfc_LlcpSocketListenCb_t, void *);
+HYBRIS_IMPLEMENT_FUNCTION4(libnfc_so, NFCSTATUS, phFriNfc_LlcpTransport_Listen, phFriNfc_LlcpTransport_Socket_t *, phNfc_sData_t *, pphFriNfc_LlcpTransportSocketListenCb_t, void *);
+#endif
HYBRIS_IMPLEMENT_FUNCTION6(libnfc_so, NFCSTATUS, phLibNfc_Llcp_Accept, phLibNfc_Handle, phLibNfc_Llcp_sSocketOptions_t *, phNfc_sData_t *, pphLibNfc_LlcpSocketErrCb_t, pphLibNfc_LlcpSocketAcceptCb_t, void *);
HYBRIS_IMPLEMENT_FUNCTION6(libnfc_so, NFCSTATUS, phFriNfc_LlcpTransport_Accept, phFriNfc_LlcpTransport_Socket_t *, phFriNfc_LlcpTransport_sSocketOptions_t *, phNfc_sData_t *, pphFriNfc_LlcpTransportSocketErrCb_t, pphFriNfc_LlcpTransportSocketAcceptCb_t, void *);
HYBRIS_IMPLEMENT_FUNCTION4(libnfc_so, NFCSTATUS, phLibNfc_Llcp_Reject, phLibNfc_Handle, phLibNfc_Handle, pphLibNfc_LlcpSocketRejectCb_t, void *);
@@ -184,7 +191,11 @@
HYBRIS_IMPLEMENT_FUNCTION6(libnfc_so, NFCSTATUS, phFriNfc_NdefSmtCrd_Reset, phFriNfc_sNdefSmtCrdFmt_t *, void *, phHal_sRemoteDevInformation_t *, phHal_sDevInputParam_t *, uint8_t *, uint16_t *);
HYBRIS_IMPLEMENT_FUNCTION4(libnfc_so, NFCSTATUS, phFriNfc_NdefSmtCrd_SetCR, phFriNfc_sNdefSmtCrdFmt_t *, uint8_t, pphFriNfc_Cr_t, void *);
HYBRIS_IMPLEMENT_FUNCTION2(libnfc_so, NFCSTATUS, phFriNfc_NdefSmtCrd_Format, phFriNfc_sNdefSmtCrdFmt_t *, const uint8_t *);
+#if (ANDROID_VERSION_MAJOR == 4 && ANDROID_VERSION_MINOR >= 1) || (ANDROID_VERSION_MAJOR >= 5)
HYBRIS_IMPLEMENT_FUNCTION4(libnfc_so, NFCSTATUS, phLibNfc_ConvertToReadOnlyNdef, phLibNfc_Handle, phNfc_sData_t *, pphLibNfc_RspCb_t, void *);
+#else
+HYBRIS_IMPLEMENT_FUNCTION3(libnfc_so, NFCSTATUS, phLibNfc_ConvertToReadOnlyNdef, phLibNfc_Handle, pphLibNfc_RspCb_t, void *);
+#endif
HYBRIS_IMPLEMENT_FUNCTION1(libnfc_so, NFCSTATUS, phFriNfc_NdefMap_ConvertToReadOnly, phFriNfc_NdefMap_t *);
HYBRIS_IMPLEMENT_FUNCTION1(libnfc_so, NFCSTATUS, phFriNfc_NdefSmtCrd_ConvertToReadOnly, phFriNfc_sNdefSmtCrdFmt_t *);
HYBRIS_IMPLEMENT_FUNCTION2(libnfc_so, NFCSTATUS, phFriNfc_MifareStdMap_ConvertToReadOnly, phFriNfc_NdefMap_t *, const uint8_t *);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.17.tar.bz2/upstream/hybris/tests/Makefile.am
^
|
@@ -16,14 +16,22 @@
if HAS_LIBNFC_NXP_HEADERS
+# test_nfc depends on NFC hardware HAL interface, which is only
+# available until Android API level 15 (v4.0.3, v4.0.4).
+if HAS_ANDROID_4_0_3
+bin_PROGRAMS += test_nfc
+else
+if HAS_ANDROID_4_1_0
+bin_PROGRAMS += test_nfc
+else
+if HAS_ANDROID_5_0_0
bin_PROGRAMS += test_nfc
endif
+endif
+endif
+endif
-# Please re-enable your test programs according to android
-# if HAS_ANDROID_X_Y_Z
-# bin_PROGRAMS += test_audio
-# endif
-
+bin_PROGRAMS += test_audio
test_audio_SOURCES = test_audio.c
test_audio_CFLAGS = \
-I$(top_srcdir)/include
@@ -108,13 +116,6 @@
test_gps_CFLAGS = -pthread \
-I$(top_srcdir)/include \
$(ANDROID_HEADERS_CFLAGS)
-
-if HAS_ANDROID_4_2_0
-test_gps_CFLAGS += -DHAS_ANDROID_4_2_0
-endif
-if HAS_ANDROID_5_0_0
-test_gps_CFLAGS += -DHAS_ANDROID_5_0_0
-endif
test_gps_LDFLAGS = -pthread
test_gps_LDADD = \
$(top_builddir)/common/libhybris-common.la \
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.17.tar.bz2/upstream/hybris/tests/test_audio.c
^
|
@@ -31,7 +31,11 @@
struct audio_hw_device *audiohw;
hw_get_module_by_class(AUDIO_HARDWARE_MODULE_ID,
+#if defined(AUDIO_HARDWARE_MODULE_ID_PRIMARY)
AUDIO_HARDWARE_MODULE_ID_PRIMARY,
+#else
+ "primary",
+#endif
(const hw_module_t**) &hwmod);
assert(hwmod != NULL);
@@ -39,17 +43,21 @@
assert(audiohw->init_check(audiohw) == 0);
printf("Audio Hardware Interface initialized.\n");
+#if (ANDROID_VERSION_MAJOR == 4 && ANDROID_VERSION_MINOR >= 1) || (ANDROID_VERSION_MAJOR >= 5)
if (audiohw->get_master_volume) {
float volume;
audiohw->get_master_volume(audiohw, &volume);
printf("Master Volume: %f\n", volume);
}
+#endif
+#if (ANDROID_VERSION_MAJOR == 4 && ANDROID_VERSION_MINOR >= 2) || (ANDROID_VERSION_MAJOR >= 5)
if (audiohw->get_master_mute) {
bool mute;
audiohw->get_master_mute(audiohw, &mute);
printf("Master Mute: %d\n", mute);
}
+#endif
audio_hw_device_close(audiohw);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.17.tar.bz2/upstream/hybris/tests/test_gps.c
^
|
@@ -288,19 +288,11 @@
{
case GPS_REQUEST_AGPS_DATA_CONN:
fprintf(stdout, "*** data_conn_open\n");
-#if ! defined(HAS_ANDROID_4_2_0) && ! defined(HAS_ANDROID_5_0_0)
- AGps->data_conn_open(AGPS_TYPE_SUPL, apn, AGPS_APN_BEARER_IPV4);
-#else
AGps->data_conn_open(apn);
-#endif
break;
case GPS_RELEASE_AGPS_DATA_CONN:
fprintf(stdout, "*** data_conn_closed\n");
-#if ! defined(HAS_ANDROID_4_2_0) && ! defined(HAS_ANDROID_5_0_0)
- AGps->data_conn_closed(AGPS_TYPE_SUPL);
-#else
AGps->data_conn_closed();
-#endif
break;
case GPS_AGPS_DATA_CONNECTED:
fprintf(stdout, "*** data_conn_established\n");
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.17.tar.bz2/upstream/hybris/tests/test_nfc.c
^
|
@@ -227,7 +227,9 @@
phLibNfc_sADD_Cfg_t discoveryConfig;
discoveryConfig.NfcIP_Mode = phNfc_eP2P_ALL;
+#if (ANDROID_VERSION_MAJOR == 4 && ANDROID_VERSION_MINOR >= 1) || (ANDROID_VERSION_MAJOR >= 5)
discoveryConfig.NfcIP_Target_Mode = 0x0E;
+#endif
discoveryConfig.Duration = 300000;
discoveryConfig.NfcIP_Tgt_Disable = 0;
discoveryConfig.PollDevInfo.PollCfgInfo.EnableIso14443A = 1;
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.17.tar.bz2/upstream/hybris/tests/test_sensors.c
^
|
@@ -80,11 +80,19 @@
printf("Hardware module ID: %s\n", hwmod->id);
printf("Hardware module Name: %s\n", hwmod->name);
printf("Hardware module Author: %s\n", hwmod->author);
+#ifdef HARDWARE_HAL_API_VERSION
printf("Hardware module API version: 0x%x\n", hwmod->module_api_version);
printf("Hardware HAL API version: 0x%x\n", hwmod->hal_api_version);
+#else
+ printf("Hardware module API version: 0x%x\n", hwmod->version_major);
+ printf("Hardware HAL API version: 0x%x\n", hwmod->version_minor);
+#endif
printf("Poll device version: 0x%x\n", dev->common.version);
- printf("API VERSION 0.1 (legacy): 0x%x\n", HARDWARE_MODULE_API_VERSION(0, 1));
+#ifndef SENSORS_MODULE_API_VERSION_0_1
+#define SENSORS_MODULE_API_VERSION_0_1 0x0001
+#endif
+ printf("API VERSION 0.1 (legacy): 0x%x\n", SENSORS_MODULE_API_VERSION_0_1);
#ifdef SENSORS_DEVICE_API_VERSION_0_1
printf("API VERSION 0.1: 0x%d\n", SENSORS_DEVICE_API_VERSION_0_1);
#endif
@@ -94,6 +102,15 @@
#ifdef SENSORS_DEVICE_API_VERSION_1_1
printf("API VERSION 1.1: 0x%d\n", SENSORS_DEVICE_API_VERSION_1_1);
#endif
+#ifdef SENSORS_DEVICE_API_VERSION_1_2
+ printf("API VERSION 1.2: 0x%d\n", SENSORS_DEVICE_API_VERSION_1_2);
+#endif
+#ifdef SENSORS_DEVICE_API_VERSION_1_3
+ printf("API VERSION 1.3: 0x%d\n", SENSORS_DEVICE_API_VERSION_1_3);
+#endif
+#ifdef SENSORS_DEVICE_API_VERSION_1_4
+ printf("API VERSION 1.4: 0x%d\n", SENSORS_DEVICE_API_VERSION_1_4);
+#endif
struct sensors_module_t *smod = (struct sensors_module_t *)(hwmod);
|