Compare commits
	
		
			5 Commits
		
	
	
		
			624bfa843d
			...
			6697470380
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 6697470380 | |||
| 
						 | 
					a9dfd6e453 | ||
| 
						 | 
					2439ff878d | ||
| 
						 | 
					8c65520173 | ||
| 
						 | 
					e3764d7002 | 
							
								
								
									
										10
									
								
								debian/Jenkinsfile
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								debian/Jenkinsfile
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,10 @@
 | 
			
		||||
@Library('ubports-build-tools') _
 | 
			
		||||
 | 
			
		||||
buildAndProvideDebianPackage()
 | 
			
		||||
 | 
			
		||||
// Or if the package consists entirely of arch-independent packages:
 | 
			
		||||
// (optional optimization, will confuse BlueOcean's live view at build stage)
 | 
			
		||||
// buildAndProvideDebianPackage(/* isArchIndependent */ true)
 | 
			
		||||
 | 
			
		||||
// Optionally, to skip building on some architectures (amd64 is always built):
 | 
			
		||||
// buildAndProvideDebianPackage(false, /* ignoredArchs */ ['arm64'])
 | 
			
		||||
							
								
								
									
										82
									
								
								debian/changelog
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										82
									
								
								debian/changelog
									
									
									
									
										vendored
									
									
								
							@@ -1,68 +1,26 @@
 | 
			
		||||
libgbinder (1.1.40) unstable; urgency=low
 | 
			
		||||
libgbinder (1.1.40-0ubports1) UNRELEASED; urgency=medium
 | 
			
		||||
 | 
			
		||||
  * Make stability field of local object configurable
 | 
			
		||||
  * Make more unit tests independent on system config
 | 
			
		||||
  * Use UNDECLARED stability for NULL binders
 | 
			
		||||
  * Upstream release v1.1.40
 | 
			
		||||
 | 
			
		||||
 -- Slava Monich <slava@monich.com>  Thu, 18 Jul 2024 05:14:28 +0300
 | 
			
		||||
 -- TheKit <thekit@disroot.org>  Thu, 15 Aug 2024 15:56:51 +0300
 | 
			
		||||
 | 
			
		||||
libgbinder (1.1.39) unstable; urgency=low
 | 
			
		||||
libgbinder (1.1.35-0ubports1) UNRELEASED; urgency=unknown
 | 
			
		||||
 | 
			
		||||
  * Eliminate defects found by Coverity
 | 
			
		||||
  * New upstream release v1.1.35 
 | 
			
		||||
 | 
			
		||||
 -- Slava Monich <slava@monich.com>  Sun, 05 May 2024 20:03:44 +0300
 | 
			
		||||
 -- UBports package upgrader bot <dev@ubports.com>  Thu, 23 Nov 2023 23:02:23 +0000
 | 
			
		||||
 | 
			
		||||
libgbinder (1.1.38) unstable; urgency=low
 | 
			
		||||
libgbinder (1.1.34-0ubports1) focal; urgency=medium
 | 
			
		||||
 | 
			
		||||
  * Fixed byte array padding
 | 
			
		||||
  * New upstream release v1.1.34
 | 
			
		||||
 | 
			
		||||
 -- Slava Monich <slava@monich.com>  Sat, 02 Mar 2024 02:11:50 +0200
 | 
			
		||||
 -- Marius Gripsgard <mariogrip@debian.org>  Thu, 31 Aug 2023 12:09:35 +0200
 | 
			
		||||
 | 
			
		||||
libgbinder (1.1.37) unstable; urgency=low
 | 
			
		||||
libgbinder (1.1.30-0ubports1) focal; urgency=medium
 | 
			
		||||
 | 
			
		||||
  * Fixed gbinder_driver_reply_data return value
 | 
			
		||||
  * Upstream release v1.1.30
 | 
			
		||||
 | 
			
		||||
 -- Slava Monich <slava@monich.com>  Mon, 26 Feb 2024 16:22:29 +0200
 | 
			
		||||
 | 
			
		||||
libgbinder (1.1.36) unstable; urgency=low
 | 
			
		||||
 | 
			
		||||
  * Support pkg-config cross-compilation
 | 
			
		||||
  * Fixed handling of UTF-16 surrogate pairs
 | 
			
		||||
 | 
			
		||||
 -- Slava Monich <slava@monich.com>  Sat, 10 Feb 2024 05:04:13 +0200
 | 
			
		||||
 | 
			
		||||
libgbinder (1.1.35) unstable; urgency=low
 | 
			
		||||
 | 
			
		||||
  * Make unit tests independent on system config
 | 
			
		||||
  * Use MAKE var instead of explicitly calling make
 | 
			
		||||
 | 
			
		||||
 -- Slava Monich <slava@monich.com>  Thu, 23 Nov 2023 01:42:56 +0200
 | 
			
		||||
 | 
			
		||||
libgbinder (1.1.34) unstable; urgency=low
 | 
			
		||||
 | 
			
		||||
  * Fixed binder-call help message
 | 
			
		||||
  * Require glib 2.32
 | 
			
		||||
 | 
			
		||||
 -- Slava Monich <slava@monich.com>  Sun, 30 Apr 2023 06:04:38 +0300
 | 
			
		||||
 | 
			
		||||
libgbinder (1.1.33) unstable; urgency=low
 | 
			
		||||
 | 
			
		||||
  * Fixed GBinderWriterType for byte and int32
 | 
			
		||||
 | 
			
		||||
 -- Slava Monich <slava@monich.com>  Sun, 26 Feb 2023 03:13:49 +0200
 | 
			
		||||
 | 
			
		||||
libgbinder (1.1.32) unstable; urgency=low
 | 
			
		||||
 | 
			
		||||
  * Improved reliability of unit tests
 | 
			
		||||
 | 
			
		||||
 -- Slava Monich <slava@monich.com>  Mon, 23 Jan 2023 11:48:00 +0200
 | 
			
		||||
 | 
			
		||||
libgbinder (1.1.31) unstable; urgency=low
 | 
			
		||||
 | 
			
		||||
  * Fixed serialization issues on big-endian
 | 
			
		||||
  * Refactored binder simulation for unit tests
 | 
			
		||||
 | 
			
		||||
 -- Slava Monich <slava@monich.com>  Wed, 04 Jan 2023 19:10:37 +0200
 | 
			
		||||
 -- Jami Kettunen <jami.kettunen@protonmail.com>  Wed, 07 Dec 2022 00:58:38 +0200
 | 
			
		||||
 | 
			
		||||
libgbinder (1.1.30) unstable; urgency=low
 | 
			
		||||
 | 
			
		||||
@@ -133,6 +91,16 @@ libgbinder (1.1.20) unstable; urgency=low
 | 
			
		||||
 | 
			
		||||
 -- Slava Monich <slava.monich@jolla.com>  Sat, 11 Jun 2022 02:49:49 +0300
 | 
			
		||||
 | 
			
		||||
libgbinder (1.1.19-0ubports1) xenial; urgency=medium
 | 
			
		||||
 | 
			
		||||
  * New upstream version 1.1.19.
 | 
			
		||||
  * debian/ubports.source_location: update the location for 1.1.19
 | 
			
		||||
  * debian/*: bring in upstream Debian packaging changes where appropriate
 | 
			
		||||
  * debian/rules: pass KEEP_SYMBOLS to let dh do the strip (& auto dbgsym)
 | 
			
		||||
  * debian/libgbinder-tools.install: add the missing .install file
 | 
			
		||||
 | 
			
		||||
 -- Ratchanan Srirattanamet <ratchanan@ubports.com>  Thu, 21 Apr 2022 17:22:20 +0700
 | 
			
		||||
 | 
			
		||||
libgbinder (1.1.19) unstable; urgency=low
 | 
			
		||||
 | 
			
		||||
  * Added reader and writer for aidl parcelables
 | 
			
		||||
@@ -227,6 +195,12 @@ libgbinder (1.1.7) unstable; urgency=low
 | 
			
		||||
 | 
			
		||||
 -- Slava Monich <slava.monich@jolla.com>  Wed, 31 Mar 2021 23:10:37 +0300
 | 
			
		||||
 | 
			
		||||
libgbinder (1.1.6-0ubports1) xenial; urgency=medium
 | 
			
		||||
 | 
			
		||||
  * Import v1.1.6 to ubports
 | 
			
		||||
 | 
			
		||||
 -- Marius Gripsgard <marius@ubports.com>  Fri, 05 Mar 2021 01:02:27 +0100
 | 
			
		||||
 | 
			
		||||
libgbinder (1.1.6) unstable; urgency=low
 | 
			
		||||
 | 
			
		||||
  * Implemented support for passing object over the bridge
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								debian/control
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								debian/control
									
									
									
									
										vendored
									
									
								
							@@ -14,7 +14,7 @@ Description: Binder client library
 | 
			
		||||
Package: libgbinder-dev
 | 
			
		||||
Section: libdevel
 | 
			
		||||
Architecture: any
 | 
			
		||||
Depends: libgbinder (= ${binary:Version}), libglibutil-dev (>= 1.0.52)
 | 
			
		||||
Depends: libgbinder (= ${binary:Version}), libglibutil-dev (>= 1.0.52), ${misc:Depends}
 | 
			
		||||
Description: Development files for libgbinder
 | 
			
		||||
 | 
			
		||||
Package: libgbinder-tools
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										6
									
								
								debian/copyright
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								debian/copyright
									
									
									
									
										vendored
									
									
								
							@@ -1,5 +1,7 @@
 | 
			
		||||
Copyright (C) 2018-2024 Jolla Ltd.
 | 
			
		||||
Copyright (C) 2018-2024 Slava Monich <slava@monich.com>
 | 
			
		||||
Copyright (C) 2018-2022 Jolla Ltd.
 | 
			
		||||
Copyright (C) 2018-2022 Slava Monich <slava.monich@jolla.com>
 | 
			
		||||
 | 
			
		||||
You may use this file under the terms of BSD license as follows:
 | 
			
		||||
 | 
			
		||||
Redistribution and use in source and binary forms, with or without
 | 
			
		||||
modification, are permitted provided that the following conditions
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										37
									
								
								debian/gbinder.conf
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								debian/gbinder.conf
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,37 @@
 | 
			
		||||
# Android keeps changing both low-level RPC and service manager
 | 
			
		||||
# protocols from version to version. To counter that, libgbinder
 | 
			
		||||
# implements configirable backends for different variants of those,
 | 
			
		||||
# and yet keeping its own API unchanged.
 | 
			
		||||
 | 
			
		||||
# Configuration is loaded from [Protocol] and [ServiceManager] sections
 | 
			
		||||
# of /etc/gbinder.conf file. The keys are binder device names or the
 | 
			
		||||
# special Default value, the value is the identifier of the protocol
 | 
			
		||||
# or service manager variant, respectively.
 | 
			
		||||
 | 
			
		||||
# In addition to reading /etc/gbinder.conf if it exists, /etc/gbinder.d
 | 
			
		||||
# directory is scanned for .conf files, the file list is sorted, files are
 | 
			
		||||
# loaded one by one, overwriting the entries loaded from /etc/gbinder.conf
 | 
			
		||||
# or from the previously processed file.
 | 
			
		||||
 | 
			
		||||
# Known protocol and service manager variants are aidl, aidl2, aidl3 and
 | 
			
		||||
# hidl. This list is expected to expand further in the future. The default
 | 
			
		||||
# configuration is as follows:
 | 
			
		||||
 | 
			
		||||
#   [Protocol]
 | 
			
		||||
#   Default = aidl
 | 
			
		||||
#   /dev/binder = aidl
 | 
			
		||||
#   /dev/hwbinder = hidl
 | 
			
		||||
 | 
			
		||||
#   [ServiceManager]
 | 
			
		||||
#   Default = aidl
 | 
			
		||||
#   /dev/binder = aidl
 | 
			
		||||
#   /dev/hwbinder = hidl
 | 
			
		||||
 | 
			
		||||
# Alternatively and preferably, one can specify the desired Android API
 | 
			
		||||
# level:
 | 
			
		||||
 | 
			
		||||
#   [General]
 | 
			
		||||
#   ApiLevel = 29
 | 
			
		||||
 | 
			
		||||
# and let libgbinder pick the appropriate preset. Full list of presets can
 | 
			
		||||
# be found in src/gbinder_config.c
 | 
			
		||||
							
								
								
									
										2
									
								
								debian/libgbinder-tools.install
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								debian/libgbinder-tools.install
									
									
									
									
										vendored
									
									
								
							@@ -1 +1 @@
 | 
			
		||||
debian/tmp/usr/bin/* usr/bin
 | 
			
		||||
debian/tmp/usr/bin/* usr/bin/
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										1
									
								
								debian/libgbinder.dirs
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								debian/libgbinder.dirs
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
/etc/gbinder.d/
 | 
			
		||||
							
								
								
									
										1
									
								
								debian/libgbinder.install.in
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								debian/libgbinder.install.in
									
									
									
									
										vendored
									
									
								
							@@ -1 +1,2 @@
 | 
			
		||||
debian/tmp/@LIBDIR@/libgbinder.so.* @LIBDIR@
 | 
			
		||||
debian/gbinder.conf /etc/
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								debian/rules
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								debian/rules
									
									
									
									
										vendored
									
									
								
							@@ -7,7 +7,7 @@
 | 
			
		||||
LIBDIR=usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 | 
			
		||||
 | 
			
		||||
override_dh_auto_build:
 | 
			
		||||
	dh_auto_build -- LIBDIR=$(LIBDIR) release pkgconfig debian/libgbinder.install debian/libgbinder-dev.install
 | 
			
		||||
	dh_auto_build -- LIBDIR=$(LIBDIR) KEEP_SYMBOLS=1 release pkgconfig debian/libgbinder.install debian/libgbinder-dev.install
 | 
			
		||||
	dh_auto_build -- -C test/binder-bridge release
 | 
			
		||||
	dh_auto_build -- -C test/binder-call release
 | 
			
		||||
	dh_auto_build -- -C test/binder-list release
 | 
			
		||||
 
 | 
			
		||||
@@ -135,21 +135,30 @@ static const GBinderConfigPresetGroup gbinder_config_30[] = {
 | 
			
		||||
 | 
			
		||||
/* API level 31 */
 | 
			
		||||
 | 
			
		||||
static const GBinderConfigPresetEntry gbinder_config_31_servicemanager[] = {
 | 
			
		||||
static const GBinderConfigPresetEntry gbinder_config_31_protocol[] = {
 | 
			
		||||
    { "/dev/binder", "aidl4" },
 | 
			
		||||
    { "/dev/vndbinder", "aidl4" },
 | 
			
		||||
    { NULL, NULL }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static const GBinderConfigPresetGroup gbinder_config_31[] = {
 | 
			
		||||
    { GBINDER_CONFIG_GROUP_PROTOCOL, gbinder_config_31_protocol },
 | 
			
		||||
    { GBINDER_CONFIG_GROUP_SERVICEMANAGER, gbinder_config_30_servicemanager },
 | 
			
		||||
    { NULL, NULL }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* API level 33 - reverts back to AIDL3 protocol */
 | 
			
		||||
 | 
			
		||||
static const GBinderConfigPresetGroup gbinder_config_33[] = {
 | 
			
		||||
    { GBINDER_CONFIG_GROUP_PROTOCOL, gbinder_config_30_protocol },
 | 
			
		||||
    { GBINDER_CONFIG_GROUP_SERVICEMANAGER, gbinder_config_31_servicemanager },
 | 
			
		||||
    { GBINDER_CONFIG_GROUP_SERVICEMANAGER, gbinder_config_30_servicemanager },
 | 
			
		||||
    { NULL, NULL }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* Presets sorted by API level in descending order */
 | 
			
		||||
 | 
			
		||||
static const GBinderConfigPreset gbinder_config_presets[] = {
 | 
			
		||||
    { 33, gbinder_config_33 },
 | 
			
		||||
    { 31, gbinder_config_31 },
 | 
			
		||||
    { 30, gbinder_config_30 },
 | 
			
		||||
    { 29, gbinder_config_29 },
 | 
			
		||||
 
 | 
			
		||||
@@ -175,12 +175,10 @@ GBINDER_IO_FN(encode_local_object)(
 | 
			
		||||
    struct flat_binder_object* dest = out;
 | 
			
		||||
 | 
			
		||||
    memset(dest, 0, sizeof(*dest));
 | 
			
		||||
    dest->hdr.type = BINDER_TYPE_BINDER;
 | 
			
		||||
    if (obj) {
 | 
			
		||||
        dest->hdr.type = BINDER_TYPE_BINDER;
 | 
			
		||||
        dest->flags = 0x7f | FLAT_BINDER_FLAG_ACCEPTS_FDS;
 | 
			
		||||
        dest->binder = (uintptr_t)obj;
 | 
			
		||||
    } else {
 | 
			
		||||
        dest->hdr.type = BINDER_TYPE_HANDLE;
 | 
			
		||||
    }
 | 
			
		||||
    if (protocol->finish_flatten_binder) {
 | 
			
		||||
        protocol->finish_flatten_binder(dest + 1, obj);
 | 
			
		||||
 
 | 
			
		||||
@@ -37,6 +37,8 @@
 | 
			
		||||
#include "gbinder_log.h"
 | 
			
		||||
#include "gbinder_local_object_p.h"
 | 
			
		||||
 | 
			
		||||
#include <string.h>
 | 
			
		||||
 | 
			
		||||
#define STRICT_MODE_PENALTY_GATHER (0x40 << 16)
 | 
			
		||||
#define BINDER_RPC_FLAGS (STRICT_MODE_PENALTY_GATHER)
 | 
			
		||||
#define UNSET_WORK_SOURCE (-1)
 | 
			
		||||
@@ -236,6 +238,44 @@ static const GBinderRpcProtocol gbinder_rpc_protocol_aidl3 = {
 | 
			
		||||
    .finish_flatten_binder = gbinder_rpc_protocol_aidl3_finish_flatten_binder
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/*==========================================================================*
 | 
			
		||||
 * AIDL protocol appeared in Android 12 (API level 31), but reverted in
 | 
			
		||||
 * Android 13 (API level 33).
 | 
			
		||||
 *==========================================================================*/
 | 
			
		||||
 | 
			
		||||
#define BINDER_WIRE_FORMAT_VERSION_AIDL4 1
 | 
			
		||||
struct stability_category {
 | 
			
		||||
    guint8 binder_wire_format_version;
 | 
			
		||||
    guint8 reserved[2];
 | 
			
		||||
    guint8 stability_level;
 | 
			
		||||
};
 | 
			
		||||
G_STATIC_ASSERT(sizeof(struct stability_category) == sizeof(guint32));
 | 
			
		||||
 | 
			
		||||
static
 | 
			
		||||
void
 | 
			
		||||
gbinder_rpc_protocol_aidl4_finish_flatten_binder(
 | 
			
		||||
    void* out,
 | 
			
		||||
    GBinderLocalObject* obj)
 | 
			
		||||
{
 | 
			
		||||
    struct stability_category cat = {
 | 
			
		||||
        .binder_wire_format_version = BINDER_WIRE_FORMAT_VERSION_AIDL4,
 | 
			
		||||
        .reserved = { 0, 0, },
 | 
			
		||||
        .stability_level = obj ? obj->stability : GBINDER_STABILITY_UNDECLARED,
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    memcpy(out, &cat, sizeof(cat));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static const GBinderRpcProtocol gbinder_rpc_protocol_aidl4 = {
 | 
			
		||||
    .name = "aidl4",
 | 
			
		||||
    .ping_tx = GBINDER_PING_TRANSACTION,
 | 
			
		||||
    .write_ping = gbinder_rpc_protocol_aidl_write_ping, /* no payload */
 | 
			
		||||
    .write_rpc_header = gbinder_rpc_protocol_aidl3_write_rpc_header,
 | 
			
		||||
    .read_rpc_header = gbinder_rpc_protocol_aidl3_read_rpc_header,
 | 
			
		||||
    .flat_binder_object_extra = 4,
 | 
			
		||||
    .finish_flatten_binder = gbinder_rpc_protocol_aidl4_finish_flatten_binder
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/*==========================================================================*
 | 
			
		||||
 * The original /dev/hwbinder protocol.
 | 
			
		||||
 *==========================================================================*/
 | 
			
		||||
@@ -289,6 +329,7 @@ static const GBinderRpcProtocol* gbinder_rpc_protocol_list[] = {
 | 
			
		||||
    &gbinder_rpc_protocol_aidl,
 | 
			
		||||
    &gbinder_rpc_protocol_aidl2,
 | 
			
		||||
    &gbinder_rpc_protocol_aidl3,
 | 
			
		||||
    &gbinder_rpc_protocol_aidl4,
 | 
			
		||||
    &gbinder_rpc_protocol_hidl
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1176,8 +1176,11 @@ gbinder_writer_data_append_local_object(
 | 
			
		||||
    n = data->io->encode_local_object(buf->data + offset, obj, data->protocol);
 | 
			
		||||
    /* Fix the data size */
 | 
			
		||||
    g_byte_array_set_size(buf, offset + n);
 | 
			
		||||
    /* Record the offset */
 | 
			
		||||
    gbinder_writer_data_record_offset(data, offset);
 | 
			
		||||
 | 
			
		||||
    if (obj) {
 | 
			
		||||
        /* Record the offset */
 | 
			
		||||
        gbinder_writer_data_record_offset(data, offset);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
@@ -1308,8 +1311,11 @@ gbinder_writer_data_append_remote_object(
 | 
			
		||||
    n = data->io->encode_remote_object(buf->data + offset, obj);
 | 
			
		||||
    /* Fix the data size */
 | 
			
		||||
    g_byte_array_set_size(buf, offset + n);
 | 
			
		||||
    /* Record the offset */
 | 
			
		||||
    gbinder_writer_data_record_offset(data, offset);
 | 
			
		||||
 | 
			
		||||
    if (obj) {
 | 
			
		||||
        /* Record the offset */
 | 
			
		||||
        gbinder_writer_data_record_offset(data, offset);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static
 | 
			
		||||
 
 | 
			
		||||
@@ -531,11 +531,25 @@ static const TestPresetsData test_presets_data [] = {
 | 
			
		||||
        "[General]\n"
 | 
			
		||||
        "ApiLevel = 31\n"
 | 
			
		||||
        "[Protocol]\n"
 | 
			
		||||
        "/dev/binder = aidl4\n"
 | 
			
		||||
        "/dev/vndbinder = aidl4\n"
 | 
			
		||||
        "[ServiceManager]\n"
 | 
			
		||||
        "/dev/binder = aidl3\n"
 | 
			
		||||
        "/dev/vndbinder = aidl3\n"
 | 
			
		||||
    },{
 | 
			
		||||
        "33",
 | 
			
		||||
 | 
			
		||||
        "[General]\n"
 | 
			
		||||
        "ApiLevel = 33",
 | 
			
		||||
 | 
			
		||||
        "[General]\n"
 | 
			
		||||
        "ApiLevel = 33\n"
 | 
			
		||||
        "[Protocol]\n"
 | 
			
		||||
        "/dev/binder = aidl3\n"
 | 
			
		||||
        "/dev/vndbinder = aidl3\n"
 | 
			
		||||
        "[ServiceManager]\n"
 | 
			
		||||
        "/dev/binder = aidl4\n"
 | 
			
		||||
        "/dev/vndbinder = aidl4\n"
 | 
			
		||||
        "/dev/binder = aidl3\n"
 | 
			
		||||
        "/dev/vndbinder = aidl3\n"
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -454,10 +454,7 @@ test_local_object(
 | 
			
		||||
    reply = test_local_reply_new();
 | 
			
		||||
    gbinder_local_reply_append_local_object(reply, NULL);
 | 
			
		||||
    data = gbinder_local_reply_data(reply);
 | 
			
		||||
    offsets = gbinder_output_data_offsets(data);
 | 
			
		||||
    g_assert(offsets);
 | 
			
		||||
    g_assert_cmpuint(offsets->count, == ,1);
 | 
			
		||||
    g_assert_cmpuint(offsets->data[0], == ,0);
 | 
			
		||||
    g_assert(!gbinder_output_data_offsets(data));
 | 
			
		||||
    g_assert_cmpuint(gbinder_output_data_buffers_size(data), == ,0);
 | 
			
		||||
    g_assert_cmpuint(data->bytes->len, == ,BINDER_OBJECT_SIZE_32);
 | 
			
		||||
    gbinder_local_reply_unref(reply);
 | 
			
		||||
@@ -475,14 +472,10 @@ test_remote_object(
 | 
			
		||||
{
 | 
			
		||||
    GBinderLocalReply* reply = test_local_reply_new();
 | 
			
		||||
    GBinderOutputData* data;
 | 
			
		||||
    GUtilIntArray* offsets;
 | 
			
		||||
 | 
			
		||||
    gbinder_local_reply_append_remote_object(reply, NULL);
 | 
			
		||||
    data = gbinder_local_reply_data(reply);
 | 
			
		||||
    offsets = gbinder_output_data_offsets(data);
 | 
			
		||||
    g_assert(offsets);
 | 
			
		||||
    g_assert(offsets->count == 1);
 | 
			
		||||
    g_assert(offsets->data[0] == 0);
 | 
			
		||||
    g_assert(!gbinder_output_data_offsets(data));
 | 
			
		||||
    g_assert(!gbinder_output_data_buffers_size(data));
 | 
			
		||||
    g_assert(data->bytes->len == BINDER_OBJECT_SIZE_32);
 | 
			
		||||
    gbinder_local_reply_unref(reply);
 | 
			
		||||
 
 | 
			
		||||
@@ -33,6 +33,7 @@
 | 
			
		||||
#include "test_common.h"
 | 
			
		||||
#include "test_binder.h"
 | 
			
		||||
 | 
			
		||||
#include "gbinder_local_object.h"
 | 
			
		||||
#include "gbinder_local_request_p.h"
 | 
			
		||||
#include "gbinder_output_data.h"
 | 
			
		||||
#include "gbinder_rpc_protocol.h"
 | 
			
		||||
@@ -40,6 +41,7 @@
 | 
			
		||||
#include "gbinder_driver.h"
 | 
			
		||||
#include "gbinder_writer.h"
 | 
			
		||||
#include "gbinder_io.h"
 | 
			
		||||
#include "gbinder_ipc.h"
 | 
			
		||||
 | 
			
		||||
#include <gutil_intarray.h>
 | 
			
		||||
 | 
			
		||||
@@ -432,19 +434,36 @@ void
 | 
			
		||||
test_local_object(
 | 
			
		||||
    void)
 | 
			
		||||
{
 | 
			
		||||
    GBinderLocalRequest* req = test_local_request_new();
 | 
			
		||||
    GBinderLocalRequest* req;
 | 
			
		||||
    GBinderOutputData* data;
 | 
			
		||||
    GUtilIntArray* offsets;
 | 
			
		||||
    GBinderIpc* ipc = gbinder_ipc_new(NULL, NULL);
 | 
			
		||||
    const char* const ifaces[] = { "android.hidl.base@1.0::IBase", NULL };
 | 
			
		||||
    GBinderLocalObject* obj = gbinder_local_object_new(ipc, ifaces, NULL, NULL);
 | 
			
		||||
 | 
			
		||||
    gbinder_local_request_append_local_object(req, NULL);
 | 
			
		||||
    /* Append a real object */
 | 
			
		||||
    req = test_local_request_new();
 | 
			
		||||
    gbinder_local_request_append_local_object(req, obj);
 | 
			
		||||
    data = gbinder_local_request_data(req);
 | 
			
		||||
    offsets = gbinder_output_data_offsets(data);
 | 
			
		||||
    g_assert(offsets);
 | 
			
		||||
    g_assert(offsets->count == 1);
 | 
			
		||||
    g_assert(offsets->data[0] == 0);
 | 
			
		||||
    g_assert_cmpuint(offsets->count, == ,1);
 | 
			
		||||
    g_assert_cmpuint(offsets->data[0], == ,0);
 | 
			
		||||
    g_assert_cmpuint(gbinder_output_data_buffers_size(data), == ,0);
 | 
			
		||||
    g_assert_cmpuint(data->bytes->len, == ,BINDER_OBJECT_SIZE_32);
 | 
			
		||||
    gbinder_local_request_unref(req);
 | 
			
		||||
 | 
			
		||||
    /* Append NULL object */
 | 
			
		||||
    req = test_local_request_new();
 | 
			
		||||
    gbinder_local_request_append_local_object(req, NULL);
 | 
			
		||||
    data = gbinder_local_request_data(req);
 | 
			
		||||
    g_assert(!gbinder_output_data_offsets(data));
 | 
			
		||||
    g_assert(!gbinder_output_data_buffers_size(data));
 | 
			
		||||
    g_assert(data->bytes->len == BINDER_OBJECT_SIZE_32);
 | 
			
		||||
    gbinder_local_request_unref(req);
 | 
			
		||||
 | 
			
		||||
    gbinder_local_object_unref(obj);
 | 
			
		||||
    gbinder_ipc_unref(ipc);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*==========================================================================*
 | 
			
		||||
@@ -458,14 +477,10 @@ test_remote_object(
 | 
			
		||||
{
 | 
			
		||||
    GBinderLocalRequest* req = test_local_request_new();
 | 
			
		||||
    GBinderOutputData* data;
 | 
			
		||||
    GUtilIntArray* offsets;
 | 
			
		||||
 | 
			
		||||
    gbinder_local_request_append_remote_object(req, NULL);
 | 
			
		||||
    data = gbinder_local_request_data(req);
 | 
			
		||||
    offsets = gbinder_output_data_offsets(data);
 | 
			
		||||
    g_assert(offsets);
 | 
			
		||||
    g_assert(offsets->count == 1);
 | 
			
		||||
    g_assert(offsets->data[0] == 0);
 | 
			
		||||
    g_assert(!gbinder_output_data_offsets(data));
 | 
			
		||||
    g_assert(!gbinder_output_data_buffers_size(data));
 | 
			
		||||
    g_assert(data->bytes->len == BINDER_OBJECT_SIZE_32);
 | 
			
		||||
    gbinder_local_request_unref(req);
 | 
			
		||||
@@ -539,12 +554,10 @@ test_remote_request_obj_validate_data(
 | 
			
		||||
    const GByteArray* bytes = data->bytes;
 | 
			
		||||
    GUtilIntArray* offsets = gbinder_output_data_offsets(data);
 | 
			
		||||
 | 
			
		||||
    offsets = gbinder_output_data_offsets(data);
 | 
			
		||||
    g_assert(offsets);
 | 
			
		||||
    g_assert(offsets->count == 3);
 | 
			
		||||
    g_assert(offsets->count == 2);
 | 
			
		||||
    g_assert(offsets->data[0] == 4);
 | 
			
		||||
    g_assert(offsets->data[1] == 4 + BUFFER_OBJECT_SIZE_64);
 | 
			
		||||
    g_assert(offsets->data[2] == 4 + 2*BUFFER_OBJECT_SIZE_64);
 | 
			
		||||
    g_assert(bytes->len == 4 + 2*BUFFER_OBJECT_SIZE_64 + BINDER_OBJECT_SIZE_64);
 | 
			
		||||
    /* GBinderHidlString + the contents (2 bytes) aligned at 8-byte boundary */
 | 
			
		||||
    g_assert(gbinder_output_data_buffers_size(data) ==
 | 
			
		||||
 
 | 
			
		||||
@@ -1359,10 +1359,7 @@ test_local_object(
 | 
			
		||||
    gbinder_local_request_init_writer(req, &writer);
 | 
			
		||||
    gbinder_writer_append_local_object(&writer, NULL);
 | 
			
		||||
    data = gbinder_local_request_data(req);
 | 
			
		||||
    offsets = gbinder_output_data_offsets(data);
 | 
			
		||||
    g_assert(offsets);
 | 
			
		||||
    g_assert_cmpuint(offsets->count, == ,1);
 | 
			
		||||
    g_assert_cmpuint(offsets->data[0], == ,0);
 | 
			
		||||
    g_assert(!gbinder_output_data_offsets(data));
 | 
			
		||||
    g_assert_cmpuint(gbinder_output_data_buffers_size(data), == ,0);
 | 
			
		||||
    g_assert_cmpuint(data->bytes->len, == ,test->objsize);
 | 
			
		||||
    gbinder_local_request_unref(req);
 | 
			
		||||
@@ -1380,7 +1377,6 @@ test_remote_object(
 | 
			
		||||
{
 | 
			
		||||
    GBinderLocalRequest* req = test_local_request_new_64();
 | 
			
		||||
    GBinderOutputData* data;
 | 
			
		||||
    GUtilIntArray* offsets;
 | 
			
		||||
    GBinderWriter writer;
 | 
			
		||||
    TestContext test;
 | 
			
		||||
 | 
			
		||||
@@ -1388,10 +1384,7 @@ test_remote_object(
 | 
			
		||||
    gbinder_local_request_init_writer(req, &writer);
 | 
			
		||||
    gbinder_writer_append_remote_object(&writer, NULL);
 | 
			
		||||
    data = gbinder_local_request_data(req);
 | 
			
		||||
    offsets = gbinder_output_data_offsets(data);
 | 
			
		||||
    g_assert(offsets);
 | 
			
		||||
    g_assert(offsets->count == 1);
 | 
			
		||||
    g_assert(offsets->data[0] == 0);
 | 
			
		||||
    g_assert(!gbinder_output_data_offsets(data));
 | 
			
		||||
    g_assert(!gbinder_output_data_buffers_size(data));
 | 
			
		||||
    g_assert(data->bytes->len == BINDER_OBJECT_SIZE_64);
 | 
			
		||||
    gbinder_local_request_unref(req);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user