commit | ce124d3ca25535b8eac80c9321a7a3be164bda64 | [log] [tgz] |
---|---|---|
author | Treehugger Robot <treehugger-gerrit@google.com> | Tue Nov 17 01:50:00 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue Nov 17 01:50:00 2020 +0000 |
tree | 60b3c8dab8242f35b20b9a565cc956a8a3c94bd7 | |
parent | 4c2eeff7b3ce2b467e8d4efda9e0a4fc66bbf704 [diff] | |
parent | c63f6b055554fbe2748736dc8ec8828970d36973 [diff] |
Merge changes I4e5db32c,I2a448282 am: 5b4e68d756 am: 021cae6f1a am: c63f6b0555 Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1499831 Change-Id: Ib2840e65f8065a5638d9df73345e5b893a49731f
diff --git a/libs/binder/ndk/include_cpp/android/binder_auto_utils.h b/libs/binder/ndk/include_cpp/android/binder_auto_utils.h index 8d60226..2d85f90 100644 --- a/libs/binder/ndk/include_cpp/android/binder_auto_utils.h +++ b/libs/binder/ndk/include_cpp/android/binder_auto_utils.h
@@ -74,6 +74,9 @@ * ownership of that other object. */ SpAIBinder& operator=(const SpAIBinder& other) { + if (this == &other) { + return *this; + } AIBinder_incStrong(other.mBinder); set(other.mBinder); return *this; @@ -170,8 +173,10 @@ ScopedAResource& operator=(const ScopedAResource&) = delete; // move-constructing/assignment is okay - ScopedAResource(ScopedAResource&& other) : mT(std::move(other.mT)) { other.mT = DEFAULT; } - ScopedAResource& operator=(ScopedAResource&& other) { + ScopedAResource(ScopedAResource&& other) noexcept : mT(std::move(other.mT)) { + other.mT = DEFAULT; + } + ScopedAResource& operator=(ScopedAResource&& other) noexcept { set(other.mT); other.mT = DEFAULT; return *this;