diff options
author | 2023-08-29 19:54:30 +0000 | |
---|---|---|
committer | 2023-08-29 19:54:30 +0000 | |
commit | 1ffe14757c1f8f958cbee1f82c0e207eb3dd7247 (patch) | |
tree | 94b7e90b4782bc6a6cc1f9a9cc1121946bc532dd | |
parent | b827dab3b70e522153a0256aad27d508d8503875 (diff) | |
parent | b8b8fe01b65096cccff1e1c0a37b9f523b745b79 (diff) |
Merge "Migrate from android::String isEmpty to empty" into udc-dev-plus-aosp am: 07fd56cc13 am: b8b8fe01b6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/24541337
Change-Id: I481a5e870d4864be08c8b35a2a8bbf37f14152ef
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | cmds/atrace/atrace.cpp | 2 | ||||
-rw-r--r-- | libs/gui/tests/GLTest.cpp | 16 | ||||
-rw-r--r-- | libs/input/KeyCharacterMap.cpp | 2 | ||||
-rw-r--r-- | libs/input/PropertyMap.cpp | 2 | ||||
-rw-r--r-- | libs/input/VirtualKeyMap.cpp | 2 | ||||
-rw-r--r-- | services/sensorservice/SensorService.cpp | 4 |
6 files changed, 14 insertions, 14 deletions
diff --git a/cmds/atrace/atrace.cpp b/cmds/atrace/atrace.cpp index ea2dddad23..5719a09a16 100644 --- a/cmds/atrace/atrace.cpp +++ b/cmds/atrace/atrace.cpp @@ -796,7 +796,7 @@ static bool setCategoriesEnableFromFile(const char* categories_file) bool ok = true; while (!tokenizer->isEol()) { String8 token = tokenizer->nextToken(" "); - if (token.isEmpty()) { + if (token.empty()) { tokenizer->skipDelimiters(" "); continue; } diff --git a/libs/gui/tests/GLTest.cpp b/libs/gui/tests/GLTest.cpp index ae79e5bace..40af8e845a 100644 --- a/libs/gui/tests/GLTest.cpp +++ b/libs/gui/tests/GLTest.cpp @@ -183,24 +183,24 @@ EGLSurface GLTest::createWindowSurface(EGLDisplay display, EGLConfig config, msg += String8::format("r(%d isn't %d)", pixel[0], r); } if (g >= 0 && abs(g - int(pixel[1])) > tolerance) { - if (!msg.isEmpty()) { + if (!msg.empty()) { msg += " "; } msg += String8::format("g(%d isn't %d)", pixel[1], g); } if (b >= 0 && abs(b - int(pixel[2])) > tolerance) { - if (!msg.isEmpty()) { + if (!msg.empty()) { msg += " "; } msg += String8::format("b(%d isn't %d)", pixel[2], b); } if (a >= 0 && abs(a - int(pixel[3])) > tolerance) { - if (!msg.isEmpty()) { + if (!msg.empty()) { msg += " "; } msg += String8::format("a(%d isn't %d)", pixel[3], a); } - if (!msg.isEmpty()) { + if (!msg.empty()) { return ::testing::AssertionFailure(::testing::Message(msg.c_str())); } else { return ::testing::AssertionSuccess(); @@ -215,24 +215,24 @@ EGLSurface GLTest::createWindowSurface(EGLDisplay display, EGLConfig config, msg += String8::format("left(%d isn't %d)", r1.left, r2.left); } if (abs(r1.top - r2.top) > tolerance) { - if (!msg.isEmpty()) { + if (!msg.empty()) { msg += " "; } msg += String8::format("top(%d isn't %d)", r1.top, r2.top); } if (abs(r1.right - r2.right) > tolerance) { - if (!msg.isEmpty()) { + if (!msg.empty()) { msg += " "; } msg += String8::format("right(%d isn't %d)", r1.right, r2.right); } if (abs(r1.bottom - r2.bottom) > tolerance) { - if (!msg.isEmpty()) { + if (!msg.empty()) { msg += " "; } msg += String8::format("bottom(%d isn't %d)", r1.bottom, r2.bottom); } - if (!msg.isEmpty()) { + if (!msg.empty()) { msg += String8::format(" R1: [%d %d %d %d] R2: [%d %d %d %d]", r1.left, r1.top, r1.right, r1.bottom, r2.left, r2.top, r2.right, r2.bottom); diff --git a/libs/input/KeyCharacterMap.cpp b/libs/input/KeyCharacterMap.cpp index d571917ff9..a4cd239a92 100644 --- a/libs/input/KeyCharacterMap.cpp +++ b/libs/input/KeyCharacterMap.cpp @@ -1247,7 +1247,7 @@ status_t KeyCharacterMap::Parser::parseCharacterLiteral(char16_t* outCharacter) } // Ensure that we consumed the entire token. - if (mTokenizer->nextToken(WHITESPACE).isEmpty()) { + if (mTokenizer->nextToken(WHITESPACE).empty()) { return NO_ERROR; } diff --git a/libs/input/PropertyMap.cpp b/libs/input/PropertyMap.cpp index 315f5a6d4f..db0c98fc91 100644 --- a/libs/input/PropertyMap.cpp +++ b/libs/input/PropertyMap.cpp @@ -171,7 +171,7 @@ status_t PropertyMap::Parser::parse() { if (!mTokenizer->isEol() && mTokenizer->peekChar() != '#') { String8 keyToken = mTokenizer->nextToken(WHITESPACE_OR_PROPERTY_DELIMITER); - if (keyToken.isEmpty()) { + if (keyToken.empty()) { ALOGE("%s: Expected non-empty property key.", mTokenizer->getLocation().c_str()); return BAD_VALUE; } diff --git a/libs/input/VirtualKeyMap.cpp b/libs/input/VirtualKeyMap.cpp index de62c870ff..8b8af4290f 100644 --- a/libs/input/VirtualKeyMap.cpp +++ b/libs/input/VirtualKeyMap.cpp @@ -146,7 +146,7 @@ bool VirtualKeyMap::Parser::parseNextIntField(int32_t* outValue) { String8 token = mTokenizer->nextToken(WHITESPACE_OR_FIELD_DELIMITER); char* end; *outValue = strtol(token.c_str(), &end, 0); - if (token.isEmpty() || *end != '\0') { + if (token.empty() || *end != '\0') { ALOGE("Expected an integer, got '%s'.", token.c_str()); return false; } diff --git a/services/sensorservice/SensorService.cpp b/services/sensorservice/SensorService.cpp index 049528a330..104dfe2596 100644 --- a/services/sensorservice/SensorService.cpp +++ b/services/sensorservice/SensorService.cpp @@ -609,7 +609,7 @@ status_t SensorService::dump(int fd, const Vector<String16>& args) { for (auto&& i : mRecentEvent) { std::shared_ptr<SensorInterface> s = getSensorInterfaceFromHandle(i.first); if (!i.second->isEmpty() && s != nullptr) { - if (privileged || s->getSensor().getRequiredPermission().isEmpty()) { + if (privileged || s->getSensor().getRequiredPermission().empty()) { i.second->setFormat("normal"); } else { i.second->setFormat("mask_data"); @@ -735,7 +735,7 @@ status_t SensorService::dumpProtoLocked(int fd, ConnectionSafeAutolock* connLock for (auto&& i : mRecentEvent) { std::shared_ptr<SensorInterface> s = getSensorInterfaceFromHandle(i.first); if (!i.second->isEmpty() && s != nullptr) { - i.second->setFormat(privileged || s->getSensor().getRequiredPermission().isEmpty() ? + i.second->setFormat(privileged || s->getSensor().getRequiredPermission().empty() ? "normal" : "mask_data"); const uint64_t mToken = proto.start(service::SensorEventsProto::RECENT_EVENTS_LOGS); proto.write(service::SensorEventsProto::RecentEventsLog::NAME, |