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

Commit 3e26b136 authored by Jesse Hall's avatar Jesse Hall
Browse files

GpuService: handle null shell command

Test: for cmd in "" help vkjson foo; do adb shell cmd gpu $cmd; done
Bug: 33747292
Change-Id: Iaed396cc5157e17bf72b53566fb3e38c64182c44
parent f4237c11
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -71,12 +71,15 @@ status_t GpuService::shellCommand(int /*in*/, int out, int err,
    for (size_t i = 0, n = args.size(); i < n; i++)
        ALOGV("  arg[%zu]: '%s'", i, String8(args[i]).string());

    if (args.size() >= 1) {
        if (args[0] == String16("vkjson"))
            return cmd_vkjson(out, err);
    else if (args[0] == String16("help"))
        if (args[0] == String16("help"))
            return cmd_help(out);

    return NO_ERROR;
    }
    // no command, or unrecognized command
    cmd_help(err);
    return BAD_VALUE;
}

// ----------------------------------------------------------------------------