Merge "adb: bump server version to prevent feature mismatch."
diff --git a/adb/adb.cpp b/adb/adb.cpp
index e973603..0e1859c 100644
--- a/adb/adb.cpp
+++ b/adb/adb.cpp
@@ -239,6 +239,10 @@
// "device::ro.product.name=x;ro.product.model=y;ro.product.device=z;".
std::vector<std::string> pieces = android::base::Split(banner, ":");
+ // Reset the features list or else if the server sends no features we may
+ // keep the existing feature set (http://b/24405971).
+ t->SetFeatures("");
+
if (pieces.size() > 2) {
const std::string& props = pieces[2];
for (auto& prop : android::base::Split(props, ";")) {
diff --git a/adb/transport.cpp b/adb/transport.cpp
index 940480b..2a2fac7 100644
--- a/adb/transport.cpp
+++ b/adb/transport.cpp
@@ -799,6 +799,10 @@
}
FeatureSet StringToFeatureSet(const std::string& features_string) {
+ if (features_string.empty()) {
+ return FeatureSet();
+ }
+
auto names = android::base::Split(features_string,
{kFeatureStringDelimiter});
return FeatureSet(names.begin(), names.end());
diff --git a/adb/transport_test.cpp b/adb/transport_test.cpp
index 7d69c3e..97fc069 100644
--- a/adb/transport_test.cpp
+++ b/adb/transport_test.cpp
@@ -167,6 +167,9 @@
ASSERT_FALSE(t.has_feature("foo"));
ASSERT_TRUE(t.has_feature("bar"));
ASSERT_TRUE(t.has_feature("baz"));
+
+ t.SetFeatures("");
+ ASSERT_EQ(0U, t.features().size());
}
TEST(transport, parse_banner_no_features) {
diff --git a/include/utils/Compat.h b/include/utils/Compat.h
index c5f9d6a..b2ba55e 100644
--- a/include/utils/Compat.h
+++ b/include/utils/Compat.h
@@ -33,6 +33,10 @@
return pread(fd, buf, nbytes, offset);
}
+static inline ssize_t pwrite64(int fd, const void* buf, size_t nbytes, off64_t offset) {
+ return pwrite(fd, buf, nbytes, offset);
+}
+
#endif /* __APPLE__ */
#if defined(_WIN32)
diff --git a/logd/main.cpp b/logd/main.cpp
index 9b88983..f90da37 100644
--- a/logd/main.cpp
+++ b/logd/main.cpp
@@ -422,7 +422,7 @@
LogListener *swl = new LogListener(logBuf, reader);
// Backlog and /proc/sys/net/unix/max_dgram_qlen set to large value
- if (swl->startListener(300)) {
+ if (swl->startListener(600)) {
exit(1);
}
diff --git a/rootdir/init.rc b/rootdir/init.rc
index 5f1169d..dc85d98 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -86,7 +86,7 @@
write /proc/sys/kernel/kptr_restrict 2
write /proc/sys/vm/mmap_min_addr 32768
write /proc/sys/net/ipv4/ping_group_range "0 2147483647"
- write /proc/sys/net/unix/max_dgram_qlen 300
+ write /proc/sys/net/unix/max_dgram_qlen 600
write /proc/sys/kernel/sched_rt_runtime_us 950000
write /proc/sys/kernel/sched_rt_period_us 1000000