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

Commit 0bf8f212 authored by Xin Li's avatar Xin Li
Browse files

Merge sc-v2-dev-plus-aosp-without-vendor@8084891

Bug: 214455710
Merged-In: Id9e06f88539b59480d5cf57a4ba67cef4676c1d5
Change-Id: Id6b1ea4f8700446b044255e80f21c137aeb7acf1
parents b55027e7 c2fc796e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -48,6 +48,8 @@ cc_defaults {
        "libhidlbase",
        "liblog",
        "libmedia_helper",
        "libmediautils_vendor",
        "libmemunreachable",
        "libutils",
        "android.hardware.audio.common-util",
    ],
+27 −2
Original line number Diff line number Diff line
@@ -30,6 +30,8 @@
#include <algorithm>

#include <android/log.h>
#include <mediautils/MemoryLeakTrackUtil.h>
#include <memunreachable/memunreachable.h>

#include <HidlUtils.h>

@@ -501,9 +503,32 @@ Return<void> Device::debugDump(const hidl_handle& fd) {
}
#endif

Return<void> Device::debug(const hidl_handle& fd, const hidl_vec<hidl_string>& /* options */) {
Return<void> Device::debug(const hidl_handle& fd, const hidl_vec<hidl_string>& options) {
    if (fd.getNativeHandle() != nullptr && fd->numFds == 1) {
        analyzeStatus("dump", mDevice->dump(mDevice, fd->data[0]));
        const int fd0 = fd->data[0];
        bool dumpMem = false;
        bool unreachableMemory = false;
        for (const auto& option : options) {
            if (option == "-m") {
                dumpMem = true;
            } else if (option == "--unreachable") {
                unreachableMemory = true;
            }
        }

        if (dumpMem) {
            dprintf(fd0, "\nDumping memory:\n");
            std::string s = dumpMemoryAddresses(100 /* limit */);
            write(fd0, s.c_str(), s.size());
        }
        if (unreachableMemory) {
            dprintf(fd0, "\nDumping unreachable memory:\n");
            // TODO - should limit be an argument parameter?
            std::string s = GetUnreachableMemoryString(true /* contents */, 100 /* limit */);
            write(fd0, s.c_str(), s.size());
        }

        analyzeStatus("dump", mDevice->dump(mDevice, fd0));
    }
    return Void();
}
+1 −0
Original line number Diff line number Diff line
@@ -64,4 +64,5 @@ cc_binary {
        "android.hardware.automotive@libc++fs",
        "libnl++",
    ],
    vintf_fragments: ["manifest_android.hardware.automotive.can@1.0.xml"],
}
+22 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2020 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<manifest version="1.0" type="device" >
    <hal format="hidl">
        <name>android.hardware.automotive.can</name>
        <transport>hwbinder</transport>
        <fqname>@1.0::ICanController/socketcan</fqname>
    </hal>
</manifest>
+129 −145

File changed.

Preview size limit exceeded, changes collapsed.

Loading