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

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

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

am: 734c12c0

Change-Id: I0418b439ef15ccf531818ebd45fa426f463f94ee
parents 50704e6d 734c12c0
Loading
Loading
Loading
Loading
+10 −0
Original line number Original line Diff line number Diff line
@@ -18,6 +18,8 @@


#include "Lshal.h"
#include "Lshal.h"


#include <hidl-util/FQName.h>

namespace android {
namespace android {
namespace lshal {
namespace lshal {


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

    auto pair = splitFirst(mInterfaceName, '/');
    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(
    return mLshal.emitDebugInfo(
            pair.first, pair.second.empty() ? "default" : pair.second, mOptions,
            pair.first, pair.second.empty() ? "default" : pair.second, mOptions,
            mLshal.out().buf(),
            mLshal.out().buf(),