Merge "Remove perfprofd reference."
diff --git a/adb/Android.bp b/adb/Android.bp
index 6558b1b..47dafff 100644
--- a/adb/Android.bp
+++ b/adb/Android.bp
@@ -221,6 +221,7 @@
target: {
windows: {
enabled: true,
+ ldflags: ["-municode"],
shared_libs: ["AdbWinApi"],
},
},
diff --git a/adb/sysdeps_test.cpp b/adb/sysdeps_test.cpp
index 79cebe6..0f4b39c 100644
--- a/adb/sysdeps_test.cpp
+++ b/adb/sysdeps_test.cpp
@@ -25,6 +25,21 @@
#include "sysdeps.h"
#include "sysdeps/chrono.h"
+#if defined(_WIN32)
+#include <windows.h>
+static bool IsWine() {
+ HMODULE ntdll = GetModuleHandleW(L"ntdll.dll");
+ if (!ntdll) {
+ return false;
+ }
+ return GetProcAddress(ntdll, "wine_get_version") != nullptr;
+}
+#else
+static bool IsWine() {
+ return false;
+}
+#endif
+
TEST(sysdeps_socketpair, smoke) {
int fds[2];
ASSERT_EQ(0, adb_socketpair(fds)) << strerror(errno);
@@ -182,8 +197,10 @@
EXPECT_EQ(1, adb_poll(&pfd, 1, 100));
- // Linux returns POLLIN | POLLHUP, Windows returns just POLLHUP.
- EXPECT_EQ(POLLHUP, pfd.revents & POLLHUP);
+ if (!IsWine()) {
+ // Linux returns POLLIN | POLLHUP, Windows returns just POLLHUP.
+ EXPECT_EQ(POLLHUP, pfd.revents & POLLHUP);
+ }
}
TEST_F(sysdeps_poll, fd_count) {
diff --git a/adb/sysdeps_win32.cpp b/adb/sysdeps_win32.cpp
index f86cd03..6372b3d 100644
--- a/adb/sysdeps_win32.cpp
+++ b/adb/sysdeps_win32.cpp
@@ -610,15 +610,6 @@
static int _fh_socket_close(FH f) {
if (f->fh_socket != INVALID_SOCKET) {
- /* gently tell any peer that we're closing the socket */
- if (shutdown(f->fh_socket, SD_BOTH) == SOCKET_ERROR) {
- // If the socket is not connected, this returns an error. We want to
- // minimize logging spam, so don't log these errors for now.
-#if 0
- D("socket shutdown failed: %s",
- android::base::SystemErrorCodeToString(WSAGetLastError()).c_str());
-#endif
- }
if (closesocket(f->fh_socket) == SOCKET_ERROR) {
// Don't set errno here, since adb_close will ignore it.
const DWORD err = WSAGetLastError();
diff --git a/libutils/include/utils/LightRefBase.h b/libutils/include/utils/LightRefBase.h
index e488e60..b04e5c1 100644
--- a/libutils/include/utils/LightRefBase.h
+++ b/libutils/include/utils/LightRefBase.h
@@ -47,8 +47,6 @@
return mCount.load(std::memory_order_relaxed);
}
- typedef LightRefBase<T> basetype;
-
protected:
inline ~LightRefBase() { }
diff --git a/libutils/include/utils/RefBase.h b/libutils/include/utils/RefBase.h
index 3a02a8a..42c6efb 100644
--- a/libutils/include/utils/RefBase.h
+++ b/libutils/include/utils/RefBase.h
@@ -296,8 +296,6 @@
getWeakRefs()->trackMe(enable, retain);
}
- typedef RefBase basetype;
-
protected:
RefBase();
virtual ~RefBase();
diff --git a/rootdir/init.rc b/rootdir/init.rc
index db48c68..b438124 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -295,6 +295,11 @@
chown system system /sys/power/wakeup_count
chmod 0660 /sys/power/state
+ chown radio wakelock /sys/power/wake_lock
+ chown radio wakelock /sys/power/wake_unlock
+ chmod 0660 /sys/power/wake_lock
+ chmod 0660 /sys/power/wake_unlock
+
# Start logd before any other services run to ensure we capture all of their logs.
start logd
@@ -688,10 +693,6 @@
chown radio system /sys/android_power/acquire_partial_wake_lock
chown radio system /sys/android_power/release_wake_lock
chown system system /sys/power/autosleep
- chown radio wakelock /sys/power/wake_lock
- chown radio wakelock /sys/power/wake_unlock
- chmod 0660 /sys/power/wake_lock
- chmod 0660 /sys/power/wake_unlock
chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate
chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/timer_rate