diff options
author | 2020-05-04 14:59:19 -0700 | |
---|---|---|
committer | 2020-05-06 21:25:31 -0700 | |
commit | fb9fcdae2f67ebef2ab6522fd2b49a57f9c28dd2 (patch) | |
tree | 3abc0f411a98c65fc7a2cfba7338194949fa6fdf /libs/ui/Region.cpp | |
parent | 58dc474b3d5fbc5a34388789bc79b39254f84d73 (diff) |
Add test to call setInputWindows twice
Currently, I'm observing some strange behaviour, where calling
setInputWindows twice results in the touchable region becoming empty.
Add this test to R to see what's going on, and potentially bisect on
this.
Bug: 143459140
Test: atest inputflinger_tests
Change-Id: Ia0acef5d4ee4acc29d20174fe44c9f94172ccd96
Diffstat (limited to 'libs/ui/Region.cpp')
-rw-r--r-- | libs/ui/Region.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/ui/Region.cpp b/libs/ui/Region.cpp index 82ce757d5a..e01309b679 100644 --- a/libs/ui/Region.cpp +++ b/libs/ui/Region.cpp @@ -224,6 +224,11 @@ Region& Region::operator = (const Region& rhs) validate(*this, "this->operator="); validate(rhs, "rhs.operator="); #endif + if (this == &rhs) { + // Already equal to itself + return *this; + } + mStorage.clear(); mStorage.insert(mStorage.begin(), rhs.mStorage.begin(), rhs.mStorage.end()); return *this; |