Merge "The platform default is already newer than C++11."
diff --git a/cmds/atrace/atrace.cpp b/cmds/atrace/atrace.cpp
index 60be26f..913090d 100644
--- a/cmds/atrace/atrace.cpp
+++ b/cmds/atrace/atrace.cpp
@@ -197,7 +197,7 @@
{ REQ, "events/vmscan/mm_vmscan_direct_reclaim_end/enable" },
{ REQ, "events/vmscan/mm_vmscan_kswapd_wake/enable" },
{ REQ, "events/vmscan/mm_vmscan_kswapd_sleep/enable" },
- { REQ, "events/lowmemorykiller/enable" },
+ { OPT, "events/lowmemorykiller/enable" },
} },
{ "regulators", "Voltage and Current Regulators", 0, {
{ REQ, "events/regulator/enable" },
diff --git a/cmds/dumpsys/tests/dumpsys_test.cpp b/cmds/dumpsys/tests/dumpsys_test.cpp
index 16fefe6..221572d 100644
--- a/cmds/dumpsys/tests/dumpsys_test.cpp
+++ b/cmds/dumpsys/tests/dumpsys_test.cpp
@@ -73,7 +73,7 @@
explicit WriteOnFdAction(const std::string& output) : output_(output) {
}
virtual Result Perform(const ArgumentTuple& args) {
- int fd = ::std::tr1::get<0>(args);
+ int fd = ::testing::get<0>(args);
android::base::WriteStringToFd(output_, fd);
}
diff --git a/cmds/installd/otapreopt.cpp b/cmds/installd/otapreopt.cpp
index 4c75eb5..355fe45 100644
--- a/cmds/installd/otapreopt.cpp
+++ b/cmds/installd/otapreopt.cpp
@@ -88,6 +88,12 @@
"DEXOPT_MASK unexpected.");
+template<typename T>
+static constexpr bool IsPowerOfTwo(T x) {
+ static_assert(std::is_integral<T>::value, "T must be integral");
+ // TODO: assert unsigned. There is currently many uses with signed values.
+ return (x & (x - 1)) == 0;
+}
template<typename T>
static constexpr T RoundDown(T x, typename std::decay<T>::type n) {
diff --git a/cmds/surfacereplayer/replayer/Android.bp b/cmds/surfacereplayer/replayer/Android.bp
index 5caceec..7632311 100644
--- a/cmds/surfacereplayer/replayer/Android.bp
+++ b/cmds/surfacereplayer/replayer/Android.bp
@@ -1,6 +1,5 @@
cc_library_shared {
name: "libsurfacereplayer",
- clang: true,
srcs: [
"BufferQueueScheduler.cpp",
"Event.cpp",
@@ -16,7 +15,6 @@
"-Wno-float-equal",
"-Wno-sign-conversion",
"-Wno-padded",
- "-std=c++14",
],
static_libs: [
"libtrace_proto",
@@ -41,7 +39,6 @@
cc_binary {
name: "surfacereplayer",
- clang: true,
srcs: [
"Main.cpp",
],
@@ -61,6 +58,5 @@
"-Wno-float-conversion",
"-Wno-disabled-macro-expansion",
"-Wno-float-equal",
- "-std=c++14",
],
}
diff --git a/libs/binder/Android.bp b/libs/binder/Android.bp
index 715c1c1..ba542cb 100644
--- a/libs/binder/Android.bp
+++ b/libs/binder/Android.bp
@@ -28,7 +28,7 @@
],
}
-cc_library {
+cc_library_shared {
name: "libbinder",
// for vndbinder
diff --git a/libs/binder/BufferedTextOutput.cpp b/libs/binder/BufferedTextOutput.cpp
index 0946aca..d516eb1 100644
--- a/libs/binder/BufferedTextOutput.cpp
+++ b/libs/binder/BufferedTextOutput.cpp
@@ -25,6 +25,7 @@
#include <private/binder/Static.h>
+#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
@@ -87,7 +88,7 @@
Vector<sp<BufferedTextOutput::BufferState> > states;
};
-static mutex_t gMutex;
+static pthread_mutex_t gMutex = PTHREAD_MUTEX_INITIALIZER;
static thread_store_t tls;
@@ -113,7 +114,7 @@
{
int32_t res = -1;
- mutex_lock(&gMutex);
+ pthread_mutex_lock(&gMutex);
if (gFreeBufferIndex >= 0) {
res = gFreeBufferIndex;
@@ -125,17 +126,17 @@
gTextBuffers.add(-1);
}
- mutex_unlock(&gMutex);
+ pthread_mutex_unlock(&gMutex);
return res;
}
static void freeBufferIndex(int32_t idx)
{
- mutex_lock(&gMutex);
+ pthread_mutex_lock(&gMutex);
gTextBuffers.editItemAt(idx) = gFreeBufferIndex;
gFreeBufferIndex = idx;
- mutex_unlock(&gMutex);
+ pthread_mutex_unlock(&gMutex);
}
// ---------------------------------------------------------------------------
diff --git a/libs/binder/OWNERS b/libs/binder/OWNERS
new file mode 100644
index 0000000..350994a
--- /dev/null
+++ b/libs/binder/OWNERS
@@ -0,0 +1,5 @@
+arve@google.com
+ctate@google.com
+hackbod@google.com
+maco@google.com
+smoreland@google.com
diff --git a/libs/ui/GraphicBuffer.cpp b/libs/ui/GraphicBuffer.cpp
index c880500..2124dc6 100644
--- a/libs/ui/GraphicBuffer.cpp
+++ b/libs/ui/GraphicBuffer.cpp
@@ -122,7 +122,6 @@
ANativeWindowBuffer* GraphicBuffer::getNativeBuffer() const
{
- LOG_ALWAYS_FATAL_IF(this == NULL, "getNativeBuffer() called on NULL GraphicBuffer");
return static_cast<ANativeWindowBuffer*>(
const_cast<GraphicBuffer*>(this));
}
diff --git a/libs/vr/libpdx/service_tests.cpp b/libs/vr/libpdx/service_tests.cpp
index e623abf..938d737 100644
--- a/libs/vr/libpdx/service_tests.cpp
+++ b/libs/vr/libpdx/service_tests.cpp
@@ -51,22 +51,24 @@
// method(IoVecMatcher(IoVecArray{{ptr1, size1}, {ptr2, size2}})));
using IoVecArray = std::vector<iovec>;
MATCHER_P(IoVecMatcher, iovec_array, "") {
+ auto local_arg = arg;
for (const iovec& item : iovec_array) {
- if (arg->iov_base != item.iov_base || arg->iov_len != item.iov_len)
+ if (local_arg->iov_base != item.iov_base || local_arg->iov_len != item.iov_len)
return false;
- arg++;
+ local_arg++;
}
return true;
}
using IoVecData = std::vector<std::string>;
MATCHER_P(IoVecDataMatcher, iovec_data, "") {
+ auto local_arg = arg;
for (const std::string& item : iovec_data) {
- std::string data{reinterpret_cast<const char*>(arg->iov_base),
- arg->iov_len};
+ std::string data{reinterpret_cast<const char*>(local_arg->iov_base),
+ local_arg->iov_len};
if (data != item)
return false;
- arg++;
+ local_arg++;
}
return true;
}
diff --git a/libs/vr/libvr_manager/Android.bp b/libs/vr/libvr_manager/Android.bp
index 8784877..2cd6a28 100644
--- a/libs/vr/libvr_manager/Android.bp
+++ b/libs/vr/libvr_manager/Android.bp
@@ -12,25 +12,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-exported_include_dirs = [ "include" ]
-
-include_dirs = ["frameworks/native/include/vr/vr_manager"]
-
-src_files = [
- "vr_manager.cpp",
- "trusted_uids.cpp",
-]
-
-static_libs = [
- "libutils",
- "libbinder",
-]
-
cc_library_static {
- srcs: src_files,
- include_dirs: include_dirs,
- export_include_dirs: exported_include_dirs,
- cflags: ["-Wall", "-Werror", "-Wunused", "-Wunreachable-code"],
- static_libs: static_libs,
name: "libvr_manager",
+ srcs: [
+ "vr_manager.cpp",
+ "trusted_uids.cpp",
+ ],
+ include_dirs: ["frameworks/native/include/vr/vr_manager"],
+ export_include_dirs: [ "include" ],
+ cflags: ["-Wall", "-Werror", "-Wunused", "-Wunreachable-code"],
+ shared_libs: [
+ "libutils",
+ "libbinder",
+ ],
}
diff --git a/vulkan/libvulkan/Android.bp b/vulkan/libvulkan/Android.bp
index b55fa27..a888e6f 100644
--- a/vulkan/libvulkan/Android.bp
+++ b/vulkan/libvulkan/Android.bp
@@ -43,7 +43,6 @@
],
cppflags: [
- "-std=c++14",
"-Wno-c99-extensions",
"-Wno-c++98-compat-pedantic",
"-Wno-exit-time-destructors",