summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmds/atrace/atrace.cpp2
-rw-r--r--cmds/cmd/Android.bp3
-rw-r--r--cmds/cmd/cmd.cpp7
-rw-r--r--cmds/installd/otapreopt.cpp3
-rw-r--r--cmds/servicemanager/OWNERS3
-rw-r--r--cmds/servicemanager/main.cpp2
-rw-r--r--data/etc/Android.bp6
-rw-r--r--libs/binder/rust/tests/parcel_fuzzer/read_utils.rs3
-rw-r--r--libs/binder/tests/parcel_fuzzer/test_fuzzer/Android.bp4
-rw-r--r--libs/gui/tests/GLTest.cpp16
-rw-r--r--libs/input/KeyCharacterMap.cpp2
-rw-r--r--libs/input/PropertyMap.cpp2
-rw-r--r--libs/input/VirtualKeyMap.cpp2
-rw-r--r--libs/sensor/Sensor.cpp2
-rw-r--r--services/sensorservice/SensorService.cpp8
15 files changed, 41 insertions, 24 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/cmds/cmd/Android.bp b/cmds/cmd/Android.bp
index c3d2601444..27ef78854c 100644
--- a/cmds/cmd/Android.bp
+++ b/cmds/cmd/Android.bp
@@ -27,6 +27,9 @@ cc_library_static {
"libselinux",
"libbinder",
],
+ whole_static_libs: [
+ "libc++fs",
+ ],
cflags: [
"-Wall",
diff --git a/cmds/cmd/cmd.cpp b/cmds/cmd/cmd.cpp
index b7273987b6..0ce7711574 100644
--- a/cmds/cmd/cmd.cpp
+++ b/cmds/cmd/cmd.cpp
@@ -27,6 +27,7 @@
#include <utils/Mutex.h>
#include <utils/Vector.h>
+#include <filesystem>
#include <getopt.h>
#include <stdlib.h>
#include <stdio.h>
@@ -69,10 +70,8 @@ public:
virtual int openFile(const String16& path, const String16& seLinuxContext,
const String16& mode) {
String8 path8(path);
- char cwd[256];
- getcwd(cwd, 256);
- String8 fullPath(cwd);
- fullPath.appendPath(path8);
+ auto fullPath = std::filesystem::current_path();
+ fullPath /= path8.c_str();
if (!mActive) {
mErrorLog << "Open attempt after active for: " << fullPath << endl;
return -EPERM;
diff --git a/cmds/installd/otapreopt.cpp b/cmds/installd/otapreopt.cpp
index 27ae8f6e6f..a447cda492 100644
--- a/cmds/installd/otapreopt.cpp
+++ b/cmds/installd/otapreopt.cpp
@@ -422,7 +422,8 @@ private:
bool IsAotCompilation() const {
if (std::find(std::begin(kAotCompilerFilters), std::end(kAotCompilerFilters),
- parameters_.compiler_filter) == std::end(kAotCompilerFilters)) {
+ std::string_view(parameters_.compiler_filter)) ==
+ std::end(kAotCompilerFilters)) {
return false;
}
diff --git a/cmds/servicemanager/OWNERS b/cmds/servicemanager/OWNERS
new file mode 100644
index 0000000000..7f5a8115d1
--- /dev/null
+++ b/cmds/servicemanager/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 32456
+
+smoreland@google.com
diff --git a/cmds/servicemanager/main.cpp b/cmds/servicemanager/main.cpp
index 86a45e61ea..ae56cb0ed3 100644
--- a/cmds/servicemanager/main.cpp
+++ b/cmds/servicemanager/main.cpp
@@ -125,6 +125,8 @@ int main(int argc, char** argv) {
ps->setThreadPoolMaxThreadCount(0);
ps->setCallRestriction(ProcessState::CallRestriction::FATAL_IF_NOT_ONEWAY);
+ IPCThreadState::self()->disableBackgroundScheduling(true);
+
sp<ServiceManager> manager = sp<ServiceManager>::make(std::make_unique<Access>());
if (!manager->addService("manager", manager, false /*allowIsolated*/, IServiceManager::DUMP_FLAG_PRIORITY_DEFAULT).isOk()) {
LOG(ERROR) << "Could not self register servicemanager";
diff --git a/data/etc/Android.bp b/data/etc/Android.bp
index ba6f671aeb..58a2dc9eae 100644
--- a/data/etc/Android.bp
+++ b/data/etc/Android.bp
@@ -107,6 +107,12 @@ prebuilt_etc {
}
prebuilt_etc {
+ name: "android.hardware.nfc.hce.prebuilt.xml",
+ src: "android.hardware.nfc.hce.xml",
+ defaults: ["frameworks_native_data_etc_defaults"],
+}
+
+prebuilt_etc {
name: "android.hardware.reboot_escrow.prebuilt.xml",
src: "android.hardware.reboot_escrow.xml",
defaults: ["frameworks_native_data_etc_defaults"],
diff --git a/libs/binder/rust/tests/parcel_fuzzer/read_utils.rs b/libs/binder/rust/tests/parcel_fuzzer/read_utils.rs
index a2d48b6115..2c8d05facd 100644
--- a/libs/binder/rust/tests/parcel_fuzzer/read_utils.rs
+++ b/libs/binder/rust/tests/parcel_fuzzer/read_utils.rs
@@ -89,14 +89,17 @@ pub const READ_FUNCS: &[fn(&BorrowedParcel<'_>)] = &[
read_parcel_interface!(Option<Vec<u64>>),
read_parcel_interface!(Option<Vec<String>>),
read_parcel_interface!(ParcelFileDescriptor),
+ read_parcel_interface!(Vec<ParcelFileDescriptor>),
read_parcel_interface!(Vec<Option<ParcelFileDescriptor>>),
read_parcel_interface!(Option<Vec<ParcelFileDescriptor>>),
read_parcel_interface!(Option<Vec<Option<ParcelFileDescriptor>>>),
read_parcel_interface!(SpIBinder),
+ read_parcel_interface!(Vec<SpIBinder>),
read_parcel_interface!(Vec<Option<SpIBinder>>),
read_parcel_interface!(Option<Vec<SpIBinder>>),
read_parcel_interface!(Option<Vec<Option<SpIBinder>>>),
read_parcel_interface!(SomeParcelable),
+ read_parcel_interface!(Vec<SomeParcelable>),
read_parcel_interface!(Vec<Option<SomeParcelable>>),
read_parcel_interface!(Option<Vec<SomeParcelable>>),
read_parcel_interface!(Option<Vec<Option<SomeParcelable>>>),
diff --git a/libs/binder/tests/parcel_fuzzer/test_fuzzer/Android.bp b/libs/binder/tests/parcel_fuzzer/test_fuzzer/Android.bp
index 690c39afc9..96092b10d3 100644
--- a/libs/binder/tests/parcel_fuzzer/test_fuzzer/Android.bp
+++ b/libs/binder/tests/parcel_fuzzer/test_fuzzer/Android.bp
@@ -36,8 +36,8 @@ cc_fuzz {
triage_assignee: "waghpawan@google.com",
// This fuzzer should be used only test fuzzService locally
- fuzz_on_haiku_host: false,
- fuzz_on_haiku_device: false,
+ fuzz_on_haiku_host: true,
+ fuzz_on_haiku_device: true,
},
}
diff --git a/libs/gui/tests/GLTest.cpp b/libs/gui/tests/GLTest.cpp
index 73e8fbebcc..449cbf9f75 100644
--- a/libs/gui/tests/GLTest.cpp
+++ b/libs/gui/tests/GLTest.cpp
@@ -191,24 +191,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();
@@ -223,24 +223,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 7a379f530b..f98de34632 100644
--- a/libs/input/KeyCharacterMap.cpp
+++ b/libs/input/KeyCharacterMap.cpp
@@ -1345,7 +1345,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 fc020cae4a..9f72c86a11 100644
--- a/libs/input/PropertyMap.cpp
+++ b/libs/input/PropertyMap.cpp
@@ -155,7 +155,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/libs/sensor/Sensor.cpp b/libs/sensor/Sensor.cpp
index f76d5cffcc..1d61805204 100644
--- a/libs/sensor/Sensor.cpp
+++ b/libs/sensor/Sensor.cpp
@@ -631,7 +631,7 @@ bool Sensor::unflattenString8(void const*& buffer, size_t& size, String8& output
if (size < len) {
return false;
}
- outputString8.setTo(static_cast<char const*>(buffer), len);
+ outputString8 = String8(static_cast<char const*>(buffer), len);
if (size < FlattenableUtils::align<4>(len)) {
ALOGE("Malformed Sensor String8 field. Should be in a 4-byte aligned buffer but is not.");
diff --git a/services/sensorservice/SensorService.cpp b/services/sensorservice/SensorService.cpp
index 260e61a35d..3d613596f5 100644
--- a/services/sensorservice/SensorService.cpp
+++ b/services/sensorservice/SensorService.cpp
@@ -472,7 +472,7 @@ status_t SensorService::dump(int fd, const Vector<String16>& args) {
mCurrentOperatingMode = RESTRICTED;
// temporarily stop all sensor direct report and disable sensors
disableAllSensorsLocked(&connLock);
- mWhiteListedPackage.setTo(String8(args[1]));
+ mWhiteListedPackage = String8(args[1]);
return status_t(NO_ERROR);
} else if (args.size() == 1 && args[0] == String16("enable")) {
// If currently in restricted mode, reset back to NORMAL mode else ignore.
@@ -496,7 +496,7 @@ status_t SensorService::dump(int fd, const Vector<String16>& args) {
// Re-enable sensors.
dev.enableAllSensors();
}
- mWhiteListedPackage.setTo(String8(args[1]));
+ mWhiteListedPackage = String8(args[1]);
return NO_ERROR;
} else if (mCurrentOperatingMode == DATA_INJECTION) {
// Already in DATA_INJECTION mode. Treat this as a no_op.
@@ -531,7 +531,7 @@ status_t SensorService::dump(int fd, const Vector<String16>& args) {
for (auto&& i : mRecentEvent) {
sp<SensorInterface> s = mSensors.getInterface(i.first);
if (!i.second->isEmpty()) {
- if (privileged || s->getSensor().getRequiredPermission().isEmpty()) {
+ if (privileged || s->getSensor().getRequiredPermission().empty()) {
i.second->setFormat("normal");
} else {
i.second->setFormat("mask_data");
@@ -649,7 +649,7 @@ status_t SensorService::dumpProtoLocked(int fd, ConnectionSafeAutolock* connLock
for (auto&& i : mRecentEvent) {
sp<SensorInterface> s = mSensors.getInterface(i.first);
if (!i.second->isEmpty()) {
- 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,