Merge changes from topic "libsnapshot_api_update_engine"
* changes:
libsnapshot: tests for public APIs.
fastbootd: skip COW group
libsnapshot: no overlayfs during virtual a/b ota.
libsnapshot: Also use empty space in super for COW
libsnapshot: APIs for all partitions
fs_mgr: CreateDmTable takes CreateLogicalPartitionParams
diff --git a/adb/adb.cpp b/adb/adb.cpp
index ba6df7a..1ec145b 100644
--- a/adb/adb.cpp
+++ b/adb/adb.cpp
@@ -1131,7 +1131,9 @@
if (service == "features") {
std::string error;
- atransport* t = acquire_one_transport(type, serial, transport_id, nullptr, &error);
+ atransport* t =
+ s->transport ? s->transport
+ : acquire_one_transport(type, serial, transport_id, nullptr, &error);
if (t != nullptr) {
SendOkay(reply_fd, FeatureSetToString(t->features()));
} else {
@@ -1190,7 +1192,9 @@
// These always report "unknown" rather than the actual error, for scripts.
if (service == "get-serialno") {
std::string error;
- atransport* t = acquire_one_transport(type, serial, transport_id, nullptr, &error);
+ atransport* t =
+ s->transport ? s->transport
+ : acquire_one_transport(type, serial, transport_id, nullptr, &error);
if (t) {
SendOkay(reply_fd, !t->serial.empty() ? t->serial : "unknown");
} else {
@@ -1200,7 +1204,9 @@
}
if (service == "get-devpath") {
std::string error;
- atransport* t = acquire_one_transport(type, serial, transport_id, nullptr, &error);
+ atransport* t =
+ s->transport ? s->transport
+ : acquire_one_transport(type, serial, transport_id, nullptr, &error);
if (t) {
SendOkay(reply_fd, !t->devpath.empty() ? t->devpath : "unknown");
} else {
@@ -1210,7 +1216,9 @@
}
if (service == "get-state") {
std::string error;
- atransport* t = acquire_one_transport(type, serial, transport_id, nullptr, &error);
+ atransport* t =
+ s->transport ? s->transport
+ : acquire_one_transport(type, serial, transport_id, nullptr, &error);
if (t) {
SendOkay(reply_fd, t->connection_state_name());
} else {
@@ -1234,7 +1242,9 @@
if (service == "reconnect") {
std::string response;
- atransport* t = acquire_one_transport(type, serial, transport_id, nullptr, &response, true);
+ atransport* t = s->transport ? s->transport
+ : acquire_one_transport(type, serial, transport_id, nullptr,
+ &response, true);
if (t != nullptr) {
kick_transport(t, true);
response =
@@ -1246,8 +1256,15 @@
// TODO: Switch handle_forward_request to string_view.
std::string service_str(service);
- if (handle_forward_request(
- service_str.c_str(), [=](std::string* error) { return s->transport; }, reply_fd)) {
+ auto transport_acquirer = [=](std::string* error) {
+ if (s->transport) {
+ return s->transport;
+ } else {
+ std::string error;
+ return acquire_one_transport(type, serial, transport_id, nullptr, &error);
+ }
+ };
+ if (handle_forward_request(service_str.c_str(), transport_acquirer, reply_fd)) {
return HostRequestResult::Handled;
}
diff --git a/adb/fastdeploy/deploypatchgenerator/deploy_patch_generator.cpp b/adb/fastdeploy/deploypatchgenerator/deploy_patch_generator.cpp
index 22c9243..154c9b9 100644
--- a/adb/fastdeploy/deploypatchgenerator/deploy_patch_generator.cpp
+++ b/adb/fastdeploy/deploypatchgenerator/deploy_patch_generator.cpp
@@ -46,10 +46,10 @@
void DeployPatchGenerator::APKEntryToLog(const APKEntry& entry) {
Log("Filename: %s", entry.filename().c_str());
- Log("CRC32: 0x%08llX", entry.crc32());
- Log("Data Offset: %lld", entry.dataoffset());
- Log("Compressed Size: %lld", entry.compressedsize());
- Log("Uncompressed Size: %lld", entry.uncompressedsize());
+ Log("CRC32: 0x%08" PRIX64, entry.crc32());
+ Log("Data Offset: %" PRId64, entry.dataoffset());
+ Log("Compressed Size: %" PRId64, entry.compressedsize());
+ Log("Uncompressed Size: %" PRId64, entry.uncompressedsize());
}
void DeployPatchGenerator::APKMetaDataToLog(const char* file, const APKMetaData& metadata) {
@@ -164,4 +164,4 @@
return lhs.localEntry->dataoffset() < rhs.localEntry->dataoffset();
});
return totalSize;
-}
\ No newline at end of file
+}
diff --git a/adb/sockets.cpp b/adb/sockets.cpp
index 75993b3..e78530c 100644
--- a/adb/sockets.cpp
+++ b/adb/sockets.cpp
@@ -757,6 +757,8 @@
#if ADB_HOST
service = std::string_view(s->smart_socket_data).substr(4);
+
+ // TODO: These should be handled in handle_host_request.
if (android::base::ConsumePrefix(&service, "host-serial:")) {
// serial number should follow "host:" and could be a host:port string.
if (!internal::parse_host_service(&serial, &service, service)) {
diff --git a/adb/test_device.py b/adb/test_device.py
index f95a5b3..dbd80ed 100755
--- a/adb/test_device.py
+++ b/adb/test_device.py
@@ -139,6 +139,25 @@
msg = self.device.forward_list()
self.assertEqual('', msg.strip())
+ def test_forward_old_protocol(self):
+ serialno = subprocess.check_output(self.device.adb_cmd + ['get-serialno']).strip()
+
+ msg = self.device.forward_list()
+ self.assertEqual('', msg.strip(),
+ 'Forwarding list must be empty to run this test.')
+
+ s = socket.create_connection(("localhost", 5037))
+ service = b"host-serial:%s:forward:tcp:5566;tcp:6655" % serialno
+ cmd = b"%04x%s" % (len(service), service)
+ s.sendall(cmd)
+
+ msg = self.device.forward_list()
+ self.assertTrue(re.search(r'tcp:5566.+tcp:6655', msg))
+
+ self.device.forward_remove_all()
+ msg = self.device.forward_list()
+ self.assertEqual('', msg.strip())
+
def test_forward_tcp_port_0(self):
self.assertEqual('', self.device.forward_list().strip(),
'Forwarding list must be empty to run this test.')
diff --git a/base/Android.bp b/base/Android.bp
index 357ce01..f5000c1 100644
--- a/base/Android.bp
+++ b/base/Android.bp
@@ -20,8 +20,14 @@
"-Wall",
"-Werror",
"-Wextra",
- "-D_FILE_OFFSET_BITS=64",
],
+ target: {
+ android: {
+ cflags: [
+ "-D_FILE_OFFSET_BITS=64",
+ ],
+ },
+ },
}
cc_library_headers {
diff --git a/libcutils/fs_config.cpp b/libcutils/fs_config.cpp
index b29638c..d0d83de 100644
--- a/libcutils/fs_config.cpp
+++ b/libcutils/fs_config.cpp
@@ -84,7 +84,7 @@
{ 00755, AID_ROOT, AID_ROOT, 0, "system/etc/ppp" },
{ 00755, AID_ROOT, AID_SHELL, 0, "system/vendor" },
{ 00751, AID_ROOT, AID_SHELL, 0, "system/xbin" },
- { 00755, AID_ROOT, AID_SHELL, 0, "system/apex/*/bin" },
+ { 00751, AID_ROOT, AID_SHELL, 0, "system/apex/*/bin" },
{ 00751, AID_ROOT, AID_SHELL, 0, "vendor/bin" },
{ 00755, AID_ROOT, AID_SHELL, 0, "vendor" },
{ 00755, AID_ROOT, AID_ROOT, 0, 0 },
diff --git a/rootdir/init.rc b/rootdir/init.rc
index 58db96c..d12096d 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -316,7 +316,7 @@
start vndservicemanager
# Run boringssl self test for each ABI so that later processes can skip it. http://b/139348610
-on init && property:ro.product.cpu.abilist32=*:
+on init && property:ro.product.cpu.abilist32=*
exec_reboot_on_failure boringssl-self-check-failed /system/bin/boringssl_self_test32
on init && property:ro.product.cpu.abilist64=*
exec_reboot_on_failure boringssl-self-check-failed /system/bin/boringssl_self_test64
diff --git a/rootdir/update_and_install_ld_config.mk b/rootdir/update_and_install_ld_config.mk
index dbe60e5..9d131dc 100644
--- a/rootdir/update_and_install_ld_config.mk
+++ b/rootdir/update_and_install_ld_config.mk
@@ -70,19 +70,30 @@
# /system image.
llndk_libraries_moved_to_apex_list:=$(LLNDK_MOVED_TO_APEX_LIBRARIES)
+# Returns the unique installed basenames of a module, or module.so if there are
+# none. The guess is to handle cases like libc, where the module itself is
+# marked uninstallable but a symlink is installed with the name libc.so.
# $(1): list of libraries
-# $(2): output file to write the list of libraries to
-define write-libs-to-file
-$(2): PRIVATE_LIBRARIES := $(1)
-$(2):
- echo -n > $$@ && $$(foreach lib,$$(PRIVATE_LIBRARIES),echo $$(lib).so >> $$@;)
+# $(2): suffix to to add to each library (not used for guess)
+define module-installed-files-or-guess
+$(foreach lib,$(1),$(or $(strip $(sort $(notdir $(call module-installed-files,$(lib)$(2))))),$(lib).so))
endef
-$(eval $(call write-libs-to-file,$(llndk_libraries_list),$(llndk_libraries_file)))
-$(eval $(call write-libs-to-file,$(vndksp_libraries_list),$(vndksp_libraries_file)))
-$(eval $(call write-libs-to-file,$(VNDK_CORE_LIBRARIES),$(vndkcore_libraries_file)))
-$(eval $(call write-libs-to-file,$(VNDK_PRIVATE_LIBRARIES),$(vndkprivate_libraries_file)))
+
+# $(1): list of libraries
+# $(2): suffix to add to each library
+# $(3): output file to write the list of libraries to
+define write-libs-to-file
+$(3): PRIVATE_LIBRARIES := $(1)
+$(3): PRIVATE_SUFFIX := $(2)
+$(3):
+ echo -n > $$@ && $$(foreach so,$$(call module-installed-files-or-guess,$$(PRIVATE_LIBRARIES),$$(PRIVATE_SUFFIX)),echo $$(so) >> $$@;)
+endef
+$(eval $(call write-libs-to-file,$(llndk_libraries_list),,$(llndk_libraries_file)))
+$(eval $(call write-libs-to-file,$(vndksp_libraries_list),.vendor,$(vndksp_libraries_file)))
+$(eval $(call write-libs-to-file,$(VNDK_CORE_LIBRARIES),.vendor,$(vndkcore_libraries_file)))
+$(eval $(call write-libs-to-file,$(VNDK_PRIVATE_LIBRARIES),.vendor,$(vndkprivate_libraries_file)))
ifeq ($(my_vndk_use_core_variant),true)
-$(eval $(call write-libs-to-file,$(VNDK_USING_CORE_VARIANT_LIBRARIES),$(vndk_using_core_variant_libraries_file)))
+$(eval $(call write-libs-to-file,$(VNDK_USING_CORE_VARIANT_LIBRARIES),,$(vndk_using_core_variant_libraries_file)))
endif
endif # ifneq ($(lib_list_from_prebuilts),true)