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

Commit e7fcfbcb authored by Steven Moreland's avatar Steven Moreland Committed by android-build-merger
Browse files

Merge "lshal: debug checks fqname" am: 9c3769fd am: 734c12c0

am: b0a2d2cd

Change-Id: I575c3dedb303d99a67452667bfd821447fdddc80
parents 16f90693 b0a2d2cd
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@

#include "Lshal.h"

#include <hidl-util/FQName.h>

namespace android {
namespace lshal {

@@ -46,7 +48,15 @@ Status DebugCommand::main(const Arg &arg) {
    if (status != OK) {
        return status;
    }

    auto pair = splitFirst(mInterfaceName, '/');

    FQName fqName(pair.first);
    if (!fqName.isValid() || fqName.isIdentifier() || !fqName.isFullyQualified()) {
        mLshal.err() << "Invalid fully-qualified name '" << pair.first << "'\n\n";
        return USAGE;
    }

    return mLshal.emitDebugInfo(
            pair.first, pair.second.empty() ? "default" : pair.second, mOptions,
            mLshal.out().buf(),