summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Tomasz Wasilczyk <twasilczyk@google.com> 2023-08-14 17:59:56 +0000
committer Tomasz Wasilczyk <twasilczyk@google.com> 2023-08-24 19:13:35 +0000
commit5c0887b8f1c5c535b861441a372ca1b4d7e9f614 (patch)
tree553f5a24e34b4f1425f0054df9eeeeafa14b8fc1
parent34b915e1419a2fa18c8815d9b3193a02968c2047 (diff)
Migrate from android::String isEmpty to empty [process]
This empty method is different from the old one - it aligns with std::string definition. Bug: 295394788 Test: make checkbuild Change-Id: I1900997f36327af8c3d12b4f77971fdd96080616
-rw-r--r--cmds/app_process/app_main.cpp10
-rw-r--r--core/jni/android_util_Process.cpp2
2 files changed, 6 insertions, 6 deletions
diff --git a/cmds/app_process/app_main.cpp b/cmds/app_process/app_main.cpp
index 28db61f7d98a..66248128ff29 100644
--- a/cmds/app_process/app_main.cpp
+++ b/cmds/app_process/app_main.cpp
@@ -49,7 +49,7 @@ public:
virtual void onVmCreated(JNIEnv* env)
{
- if (mClassName.isEmpty()) {
+ if (mClassName.empty()) {
return; // Zygote. Nothing to do here.
}
@@ -98,7 +98,7 @@ public:
virtual void onExit(int code)
{
- if (mClassName.isEmpty()) {
+ if (mClassName.empty()) {
// if zygote
IPCThreadState::self()->stopProcess();
hardware::IPCThreadState::self()->stopProcess();
@@ -282,7 +282,7 @@ int main(int argc, char* const argv[])
}
Vector<String8> args;
- if (!className.isEmpty()) {
+ if (!className.empty()) {
// We're not in zygote mode, the only argument we need to pass
// to RuntimeInit is the application argument.
//
@@ -328,13 +328,13 @@ int main(int argc, char* const argv[])
}
}
- if (!niceName.isEmpty()) {
+ if (!niceName.empty()) {
runtime.setArgv0(niceName.string(), true /* setProcName */);
}
if (zygote) {
runtime.start("com.android.internal.os.ZygoteInit", args, zygote);
- } else if (!className.isEmpty()) {
+ } else if (!className.empty()) {
runtime.start("com.android.internal.os.RuntimeInit", args, zygote);
} else {
fprintf(stderr, "Error: no class name or --zygote supplied.\n");
diff --git a/core/jni/android_util_Process.cpp b/core/jni/android_util_Process.cpp
index b9d5ee4b3015..e9dd75b28fbd 100644
--- a/core/jni/android_util_Process.cpp
+++ b/core/jni/android_util_Process.cpp
@@ -583,7 +583,7 @@ void android_os_Process_setArgV0(JNIEnv* env, jobject clazz, jstring name)
env->ReleaseStringCritical(name, str);
}
- if (!name8.isEmpty()) {
+ if (!name8.empty()) {
AndroidRuntime::getRuntime()->setArgv0(name8.string(), true /* setProcName */);
}
}