Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d35d3e5d authored by Narayan Kamath's avatar Narayan Kamath
Browse files

Dual zygote cleanup.

- Use different process names for the 32 / 64 bit zygote.
- Pass command line arguments correctly. The first unmatched
  argument must be passed through to the java main class.

Change-Id: I952ebbdbba941f118d992354b9bd0ada2dade417
parent 09e13cc5
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -138,8 +138,10 @@ static size_t computeArgBlockSize(int argc, char* const argv[]) {

#if defined(__LP64__)
static const char ABI_LIST_PROPERTY[] = "ro.product.cpu.abilist64";
static const char ZYGOTE_NICE_NAME[] = "zygote64";
#else
static const char ABI_LIST_PROPERTY[] = "ro.product.cpu.abilist32";
static const char ZYGOTE_NICE_NAME[] = "zygote";
#endif

int main(int argc, char* const argv[])
@@ -185,16 +187,19 @@ int main(int argc, char* const argv[])
        const char* arg = argv[i++];
        if (strcmp(arg, "--zygote") == 0) {
            zygote = true;
            niceName = "zygote";
            niceName = ZYGOTE_NICE_NAME;
        } else if (strcmp(arg, "--start-system-server") == 0) {
            startSystemServer = true;
        } else if (strcmp(arg, "--application") == 0) {
            application = true;
        } else if (strncmp(arg, "--nice-name=", 12) == 0) {
            niceName = arg + 12;
        } else {
        } else if (strncmp(arg, "--", 2) != 0) {
            className.setTo(arg);
            break;
        } else {
            --i;
            break;
        }
    }