From fb9fcdae2f67ebef2ab6522fd2b49a57f9c28dd2 Mon Sep 17 00:00:00 2001 From: Siarhei Vishniakou Date: Mon, 4 May 2020 14:59:19 -0700 Subject: 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 --- libs/ui/Region.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libs/ui/Region.cpp') 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; -- cgit v1.2.3-59-g8ed1b