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

Commit ef204717 authored by Nicolas Geoffray's avatar Nicolas Geoffray Committed by android-build-merger
Browse files

Merge "Revert "Remove empty ScopedArray constructor."" am: f6a0a749 am: 73fce739

am: d3e197a1

Change-Id: Idf3497ce71c0a03ed440bb35c09f5247a977f6ba
parents 15ee5ebf d3e197a1
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -155,6 +155,11 @@ public:
            return;
            return;
        }
        }


        ScopedIntArrayRO tags(env);
        if (jTags != nullptr) {
            tags.reset(jTags);
        }

        while (1) {
        while (1) {
            log_msg log_msg;
            log_msg log_msg;
            int ret = android_logger_list_read(logger_list.get(), &log_msg);
            int ret = android_logger_list_read(logger_list.get(), &log_msg);
@@ -182,7 +187,6 @@ public:


            if (jTags != nullptr) {
            if (jTags != nullptr) {
                bool found = false;
                bool found = false;
                ScopedIntArrayRO tags(env, jTags);
                for (size_t i = 0; !found && i < tags.size(); ++i) {
                for (size_t i = 0; !found && i < tags.size(); ++i) {
                    found = (tag == tags[i]);
                    found = (tag == tags[i]);
                }
                }
+8 −6
Original line number Original line Diff line number Diff line
@@ -41,11 +41,14 @@ static jlong createDump(JNIEnv*, jobject, jint fd, jboolean isProto) {
static void addToDump(JNIEnv* env, jobject, jlong dumpPtr, jstring jpath, jstring jpackage,
static void addToDump(JNIEnv* env, jobject, jlong dumpPtr, jstring jpath, jstring jpackage,
        jint versionCode, jlong startTime, jlong endTime, jbyteArray jdata) {
        jint versionCode, jlong startTime, jlong endTime, jbyteArray jdata) {
    std::string path;
    std::string path;
    const ProfileData* data = nullptr;
    LOG_ALWAYS_FATAL_IF(jdata == nullptr && jpath == nullptr, "Path and data can't both be null");
    LOG_ALWAYS_FATAL_IF(jdata == nullptr && jpath == nullptr, "Path and data can't both be null");
    ScopedNullableByteArrayRO buffer(env, jdata);
    ScopedByteArrayRO buffer{env};
    if (buffer.size() != -1) {
    if (jdata != nullptr) {
        buffer.reset(jdata);
        LOG_ALWAYS_FATAL_IF(buffer.size() != sizeof(ProfileData),
        LOG_ALWAYS_FATAL_IF(buffer.size() != sizeof(ProfileData),
                "Buffer size %zd doesn't match expected %zu!", buffer.size(), sizeof(ProfileData));
                "Buffer size %zu doesn't match expected %zu!", buffer.size(), sizeof(ProfileData));
        data = reinterpret_cast<const ProfileData*>(buffer.get());
    }
    }
    if (jpath != nullptr) {
    if (jpath != nullptr) {
        ScopedUtfChars pathChars(env, jpath);
        ScopedUtfChars pathChars(env, jpath);
@@ -58,8 +61,7 @@ static void addToDump(JNIEnv* env, jobject, jlong dumpPtr, jstring jpath, jstrin
    LOG_ALWAYS_FATAL_IF(!dump, "null passed for dump pointer");
    LOG_ALWAYS_FATAL_IF(!dump, "null passed for dump pointer");


    const std::string package(packageChars.c_str(), packageChars.size());
    const std::string package(packageChars.c_str(), packageChars.size());
    GraphicsStatsService::addToDump(dump, path, package, versionCode, startTime, endTime,
    GraphicsStatsService::addToDump(dump, path, package, versionCode, startTime, endTime, data);
                                    reinterpret_cast<const ProfileData*>(buffer.get()));
}
}


static void addFileToDump(JNIEnv* env, jobject, jlong dumpPtr, jstring jpath) {
static void addFileToDump(JNIEnv* env, jobject, jlong dumpPtr, jstring jpath) {