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

Commit d09c190b authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6199579 from f22c0ebb to rvc-release

Change-Id: I676f6867ac0130bcfe349b8cf60ea3a70f2e949a
parents 45e47e75 f22c0ebb
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -154,6 +154,7 @@ void add_mountinfo();
#define RECOVERY_DATA_DIR "/data/misc/recovery"
#define UPDATE_ENGINE_LOG_DIR "/data/misc/update_engine_log"
#define LOGPERSIST_DATA_DIR "/data/misc/logd"
#define PREREBOOT_DATA_DIR "/data/misc/prereboot"
#define PROFILE_DATA_DIR_CUR "/data/misc/profiles/cur"
#define PROFILE_DATA_DIR_REF "/data/misc/profiles/ref"
#define XFRM_STAT_PROC_FILE "/proc/net/xfrm_stat"
@@ -1585,6 +1586,7 @@ Dumpstate::RunStatus Dumpstate::DumpstateDefaultAfterCritical() {
        ds.AddDir(PROFILE_DATA_DIR_CUR, true);
        ds.AddDir(PROFILE_DATA_DIR_REF, true);
    }
    ds.AddDir(PREREBOOT_DATA_DIR, false);
    add_mountinfo();
    DumpIpTablesAsRoot();
    DumpDynamicPartitionInfo();
+18 −17
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@
#include <utils/Log.h>
#include <utils/Vector.h>

#include <iostream>
#include <fcntl.h>
#include <getopt.h>
#include <stdio.h>
@@ -231,14 +232,14 @@ int Dumpsys::main(int argc, char* const argv[]) {
    const size_t N = services.size();
    if (N > 1) {
        // first print a list of the current services
        aout << "Currently running services:" << endl;
        std::cout << "Currently running services:" << std::endl;

        for (size_t i=0; i<N; i++) {
            sp<IBinder> service = sm_->checkService(services[i]);

            if (service != nullptr) {
                bool skipped = IsSkipped(skippedServices, services[i]);
                aout << "  " << services[i] << (skipped ? " (skipped)" : "") << endl;
                std::cout << "  " << services[i] << (skipped ? " (skipped)" : "") << std::endl;
            }
        }
    }
@@ -263,10 +264,10 @@ int Dumpsys::main(int argc, char* const argv[]) {
                          asProto, elapsedDuration, bytesWritten);

            if (status == TIMED_OUT) {
                aout << endl
                std::cout << std::endl
                     << "*** SERVICE '" << serviceName << "' DUMP TIMEOUT (" << timeoutArgMs
                     << "ms) EXPIRED ***" << endl
                     << endl;
                     << "ms) EXPIRED ***" << std::endl
                     << std::endl;
            }

            if (addSeparator) {
@@ -332,14 +333,14 @@ status_t Dumpsys::startDumpThread(Type type, const String16& serviceName,
                                  const Vector<String16>& args) {
    sp<IBinder> service = sm_->checkService(serviceName);
    if (service == nullptr) {
        aerr << "Can't find service: " << serviceName << endl;
        std::cerr << "Can't find service: " << serviceName << std::endl;
        return NAME_NOT_FOUND;
    }

    int sfd[2];
    if (pipe(sfd) != 0) {
        aerr << "Failed to create pipe to dump service info for " << serviceName << ": "
             << strerror(errno) << endl;
        std::cerr << "Failed to create pipe to dump service info for " << serviceName << ": "
             << strerror(errno) << std::endl;
        return -errno;
    }

@@ -359,13 +360,13 @@ status_t Dumpsys::startDumpThread(Type type, const String16& serviceName,
            err = dumpPidToFd(service, remote_end);
            break;
        default:
            aerr << "Unknown dump type" << static_cast<int>(type) << endl;
            std::cerr << "Unknown dump type" << static_cast<int>(type) << std::endl;
            return;
        }

        if (err != OK) {
            aerr << "Error dumping service info status_t: " << statusToString(err) << " "
                 << serviceName << endl;
            std::cerr << "Error dumping service info status_t: " << statusToString(err) << " "
                 << serviceName << std::endl;
        }
    });
    return OK;
@@ -422,8 +423,8 @@ status_t Dumpsys::writeDump(int fd, const String16& serviceName, std::chrono::mi

        int rc = TEMP_FAILURE_RETRY(poll(&pfd, 1, time_left_ms()));
        if (rc < 0) {
            aerr << "Error in poll while dumping service " << serviceName << " : "
                 << strerror(errno) << endl;
            std::cerr << "Error in poll while dumping service " << serviceName << " : "
                 << strerror(errno) << std::endl;
            status = -errno;
            break;
        } else if (rc == 0) {
@@ -434,8 +435,8 @@ status_t Dumpsys::writeDump(int fd, const String16& serviceName, std::chrono::mi
        char buf[4096];
        rc = TEMP_FAILURE_RETRY(read(redirectFd_.get(), buf, sizeof(buf)));
        if (rc < 0) {
            aerr << "Failed to read while dumping service " << serviceName << ": "
                 << strerror(errno) << endl;
            std::cerr << "Failed to read while dumping service " << serviceName << ": "
                 << strerror(errno) << std::endl;
            status = -errno;
            break;
        } else if (rc == 0) {
@@ -444,8 +445,8 @@ status_t Dumpsys::writeDump(int fd, const String16& serviceName, std::chrono::mi
        }

        if (!WriteFully(fd, buf, rc)) {
            aerr << "Failed to write while dumping service " << serviceName << ": "
                 << strerror(errno) << endl;
            std::cerr << "Failed to write while dumping service " << serviceName << ": "
                 << strerror(errno) << std::endl;
            status = -errno;
            break;
        }
+2 −3
Original line number Diff line number Diff line
@@ -21,10 +21,9 @@
#include "dumpsys.h"

#include <binder/IServiceManager.h>
#include <binder/TextOutput.h>

#include <iostream>
#include <signal.h>
#include <stdio.h>

using namespace android;

@@ -34,7 +33,7 @@ int main(int argc, char* const argv[]) {
    fflush(stdout);
    if (sm == nullptr) {
        ALOGE("Unable to get default service manager!");
        aerr << "dumpsys: Unable to get default service manager!" << endl;
        std::cerr << "dumpsys: Unable to get default service manager!" << std::endl;
        return 20;
    }

+5 −0
Original line number Diff line number Diff line
@@ -1230,6 +1230,11 @@ status_t IPCThreadState::executeCommand(int32_t cmd)
                if (error < NO_ERROR) reply.setError(error);
                sendReply(reply, 0);
            } else {
                if (error != OK || reply.dataSize() != 0) {
                    alog << "oneway function results will be dropped but finished with status "
                         << statusToString(error)
                         << " and parcel size " << reply.dataSize() << endl;
                }
                LOG_ONEWAY("NOT sending reply to %d!", mCallingPid);
            }

+53 −12
Original line number Diff line number Diff line
@@ -734,12 +734,7 @@ status_t encodePlaneLayout(const PlaneLayout& input, OutputHidlVec* output) {
    if (err) {
        return err;
    }
    err = encodeInteger<int64_t>(static_cast<int32_t>(input.verticalSubsampling), output);
    if (err) {
        return err;
    }

    return encodeRect(input.crop, output);
    return encodeInteger<int64_t>(static_cast<int32_t>(input.verticalSubsampling), output);
}

status_t decodePlaneLayout(InputHidlVec* input, PlaneLayout* output) {
@@ -780,12 +775,7 @@ status_t decodePlaneLayout(InputHidlVec* input, PlaneLayout* output) {
    if (err) {
        return err;
    }
    err = decodeInteger<int64_t>(input, &output->verticalSubsampling);
    if (err) {
        return err;
    }

    return decodeRect(input, &output->crop);
    return decodeInteger<int64_t>(input, &output->verticalSubsampling);
}

status_t encodePlaneLayoutsHelper(const std::vector<PlaneLayout>& planeLayouts, OutputHidlVec* outOutputHidlVec) {
@@ -831,6 +821,49 @@ void clearPlaneLayouts(std::vector<PlaneLayout>* output) {
    output->clear();
}

status_t encodeCropHelper(const std::vector<Rect>& crops, OutputHidlVec* outOutputHidlVec) {
    status_t err = encodeInteger<int64_t>(static_cast<int64_t>(crops.size()), outOutputHidlVec);
    if (err) {
        return err;
    }

    for (const auto& crop : crops) {
        err = encodeRect(crop, outOutputHidlVec);
        if (err) {
            return err;
        }
    }

    return NO_ERROR;
}

status_t decodeCropHelper(InputHidlVec* inputHidlVec, std::vector<Rect>* outCrops) {
    int64_t size = 0;
    status_t err = decodeInteger<int64_t>(inputHidlVec, &size);
    if (err) {
        return err;
    }
    if (size < 0) {
        return BAD_VALUE;
    }

    for (size_t i = 0; i < size; i++) {
        outCrops->emplace_back();
        err = decodeRect(inputHidlVec, &outCrops->back());
        if (err) {
            return err;
        }
    }
    return NO_ERROR;
}

void clearCrop(std::vector<Rect>* output) {
    if (!output) {
        return;
    }
    output->clear();
}

status_t encodeSmpte2086Helper(const Smpte2086& smpte2086, OutputHidlVec* outOutputHidlVec) {
    status_t err = encodeXyColor(smpte2086.primaryRed, outOutputHidlVec);
    if (err) {
@@ -1043,6 +1076,14 @@ status_t decodePlaneLayouts(const hidl_vec<uint8_t>& planeLayouts, std::vector<P
                  decodePlaneLayoutsHelper, clearPlaneLayouts);
}

status_t encodeCrop(const std::vector<Rect>& crop, hidl_vec<uint8_t>* outCrop) {
    return encodeMetadata(MetadataType_Crop, crop, outCrop, encodeCropHelper);
}

status_t decodeCrop(const hidl_vec<uint8_t>& crop, std::vector<Rect>* outCrop) {
    return decodeMetadata(MetadataType_Crop, crop, outCrop, decodeCropHelper, clearCrop);
}

status_t encodeDataspace(const Dataspace& dataspace, hidl_vec<uint8_t>* outDataspace) {
    return encodeMetadata(MetadataType_Dataspace, static_cast<int32_t>(dataspace), outDataspace,
                  encodeInteger);
Loading