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

Commit 375d2f2b authored by Yifan Hong's avatar Yifan Hong Committed by Automerger Merge Worker
Browse files

Merge changes I7d5ab9fb,Ib34d291f am: 6091a2d6 am: c547fe54 am: 684895e9...

Merge changes I7d5ab9fb,Ib34d291f am: 6091a2d6 am: c547fe54 am: 684895e9 am: 8f4ca3f2 am: 0ea0dbe9

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1360880

Change-Id: Ie2c6b3c147eee88062f0e040e3b4dbcd966b9aed
parents fafd8069 0ea0dbe9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ cc_test {
    defaults: ["lshal_defaults"],
    gtest: true,
    static_libs: [
        "android.hardware.tests.baz@1.0",
        "android.hardware.tests.inheritance@1.0",
        "libgmock",
    ],
    shared_libs: [
+2 −2
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ Status DebugCommand::parseArgs(const Arg &arg) {
    // Optargs cannnot be used because the flag should not be considered set
    // if it should really be contained in mOptions.
    if (std::string(arg.argv[optind]) == "-E") {
        mExcludesParentInstances = true;
        mParentDebugInfoLevel = ParentDebugInfoLevel::NOTHING;
        optind++;
    }

@@ -67,7 +67,7 @@ Status DebugCommand::main(const Arg &arg) {

    return mLshal.emitDebugInfo(
            pair.first, pair.second.empty() ? "default" : pair.second, mOptions,
            mExcludesParentInstances,
            mParentDebugInfoLevel,
            mLshal.out().buf(),
            mLshal.err());
}
+3 −3
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include <android-base/macros.h>

#include "Command.h"
#include "ParentDebugInfoLevel.h"
#include "utils.h"

namespace android {
@@ -42,9 +43,8 @@ private:
    std::string mInterfaceName;
    std::vector<std::string> mOptions;

    // Outputs the actual descriptor of a hal instead of the debug output
    // if the arguments provided are a superclass of the actual hal impl.
    bool mExcludesParentInstances;
    // See comment on ParentDebugInfoLevel.
    ParentDebugInfoLevel mParentDebugInfoLevel = ParentDebugInfoLevel::FULL;

    DISALLOW_COPY_AND_ASSIGN(DebugCommand);
};
+1 −1
Original line number Diff line number Diff line
@@ -555,7 +555,7 @@ void ListCommand::dumpTable(const NullableOStream<std::ostream>& out) const {
                std::stringstream ss;
                auto pair = splitFirst(iName, '/');
                mLshal.emitDebugInfo(pair.first, pair.second, {},
                                     false /* excludesParentInstances */, ss,
                                     ParentDebugInfoLevel::FQNAME_ONLY, ss,
                                     NullableOStream<std::ostream>(nullptr));
                return ss.str();
            };
+5 −2
Original line number Diff line number Diff line
@@ -101,7 +101,7 @@ Status Lshal::emitDebugInfo(
        const std::string &interfaceName,
        const std::string &instanceName,
        const std::vector<std::string> &options,
        bool excludesParentInstances,
        ParentDebugInfoLevel parentDebugInfoLevel,
        std::ostream &out,
        NullableOStream<std::ostream> err) const {
    using android::hidl::base::V1_0::IBase;
@@ -126,7 +126,7 @@ Status Lshal::emitDebugInfo(
        return NO_INTERFACE;
    }

    if (excludesParentInstances) {
    if (parentDebugInfoLevel != ParentDebugInfoLevel::FULL) {
        const std::string descriptor = getDescriptor(base.get());
        if (descriptor.empty()) {
            std::string msg = interfaceName + "/" + instanceName + " getDescriptor failed";
@@ -134,6 +134,9 @@ Status Lshal::emitDebugInfo(
            LOG(ERROR) << msg;
        }
        if (descriptor != interfaceName) {
            if (parentDebugInfoLevel == ParentDebugInfoLevel::FQNAME_ONLY) {
                out << "[See " << descriptor << "/" << instanceName << "]";
            }
            return OK;
        }
    }
Loading