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

Commit 684895e9 authored by Yifan Hong's avatar Yifan Hong Committed by Automerger Merge Worker
Browse files

Merge changes I7d5ab9fb,Ib34d291f am: 6091a2d6 am: c547fe54

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

Change-Id: I8a0812d1451b9c02f852a1920c25e8669ab733eb
parents 1feaa2a1 c547fe54
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -75,7 +75,7 @@ cc_test {
    defaults: ["lshal_defaults"],
    defaults: ["lshal_defaults"],
    gtest: true,
    gtest: true,
    static_libs: [
    static_libs: [
        "android.hardware.tests.baz@1.0",
        "android.hardware.tests.inheritance@1.0",
        "libgmock",
        "libgmock",
    ],
    ],
    shared_libs: [
    shared_libs: [
+2 −2
Original line number Original line 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
    // Optargs cannnot be used because the flag should not be considered set
    // if it should really be contained in mOptions.
    // if it should really be contained in mOptions.
    if (std::string(arg.argv[optind]) == "-E") {
    if (std::string(arg.argv[optind]) == "-E") {
        mExcludesParentInstances = true;
        mParentDebugInfoLevel = ParentDebugInfoLevel::NOTHING;
        optind++;
        optind++;
    }
    }


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


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


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


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


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


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


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