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

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

Snap for 7199033 from 06c667b0 to sc-release

Change-Id: Ic9d223ba10d553e3c367784da88c5f2e60c88622
parents 3d51c4a7 06c667b0
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -2911,6 +2911,10 @@ Dumpstate::RunStatus Dumpstate::RunInternal(int32_t calling_uid,
        // own activity pushes out interesting data from the trace ring buffer.
        // The trace file is added to the zip by MaybeAddSystemTraceToZip().
        MaybeSnapshotSystemTrace();

        // If a winscope trace is running, snapshot it now. It will be pulled into bugreport later
        // from WMTRACE_DATA_DIR.
        MaybeSnapshotWinTrace();
    }
    onUiIntensiveBugreportDumpsFinished(calling_uid);
    MaybeCheckUserConsent(calling_uid, calling_package);
@@ -3022,6 +3026,14 @@ void Dumpstate::MaybeSnapshotSystemTrace() {
    // file in the later stages.
}

void Dumpstate::MaybeSnapshotWinTrace() {
    RunCommand(
        // Empty name because it's not intended to be classified as a bugreport section.
        // Actual tracing files can be found in "/data/misc/wmtrace/" in the bugreport.
        "", {"cmd", "window", "tracing", "save-for-bugreport"},
        CommandOptions::WithTimeout(10).Always().DropRoot().RedirectStderr().Build());
}

void Dumpstate::onUiIntensiveBugreportDumpsFinished(int32_t calling_uid) {
    if (calling_uid == AID_SHELL || !CalledByApi()) {
        return;
+1 −0
Original line number Diff line number Diff line
@@ -549,6 +549,7 @@ class Dumpstate {

    void MaybeTakeEarlyScreenshot();
    void MaybeSnapshotSystemTrace();
    void MaybeSnapshotWinTrace();

    void onUiIntensiveBugreportDumpsFinished(int32_t calling_uid);

+0 −34
Original line number Diff line number Diff line
@@ -349,9 +349,6 @@ private:
            }
        }

        // Clear cached artifacts.
        ClearDirectory(isa_path);

        // Check whether we have a boot image.
        // TODO: check that the files are correct wrt/ jars.
        std::string preopted_boot_art_path =
@@ -395,37 +392,6 @@ private:
        return false;
    }

    static void ClearDirectory(const std::string& dir) {
        DIR* c_dir = opendir(dir.c_str());
        if (c_dir == nullptr) {
            PLOG(WARNING) << "Unable to open " << dir << " to delete it's contents";
            return;
        }

        for (struct dirent* de = readdir(c_dir); de != nullptr; de = readdir(c_dir)) {
            const char* name = de->d_name;
            if (strcmp(name, ".") == 0 || strcmp(name, "..") == 0) {
                continue;
            }
            // We only want to delete regular files and symbolic links.
            std::string file = StringPrintf("%s/%s", dir.c_str(), name);
            if (de->d_type != DT_REG && de->d_type != DT_LNK) {
                LOG(WARNING) << "Unexpected file "
                             << file
                             << " of type "
                             << std::hex
                             << de->d_type
                             << " encountered.";
            } else {
                // Try to unlink the file.
                if (unlink(file.c_str()) != 0) {
                    PLOG(ERROR) << "Unable to unlink " << file;
                }
            }
        }
        CHECK_EQ(0, closedir(c_dir)) << "Unable to close directory.";
    }

    static const char* ParseNull(const char* arg) {
        return (strcmp(arg, "!") == 0) ? nullptr : arg;
    }
+13 −4
Original line number Diff line number Diff line
@@ -36,13 +36,18 @@ BlurFilter::BlurFilter() {
    SkString blurString(R"(
        in shader input;
        uniform float2 in_blurOffset;
        uniform float2 in_maxSizeXY;

        half4 main(float2 xy) {
            half4 c = sample(input, xy);
            c += sample(input, xy + float2( in_blurOffset.x,  in_blurOffset.y));
            c += sample(input, xy + float2( in_blurOffset.x, -in_blurOffset.y));
            c += sample(input, xy + float2(-in_blurOffset.x,  in_blurOffset.y));
            c += sample(input, xy + float2(-in_blurOffset.x, -in_blurOffset.y));
            c += sample(input, float2( clamp( in_blurOffset.x + xy.x, 0, in_maxSizeXY.x),
                                       clamp(in_blurOffset.y + xy.y, 0, in_maxSizeXY.y)));
            c += sample(input, float2( clamp( in_blurOffset.x + xy.x, 0, in_maxSizeXY.x),
                                       clamp(-in_blurOffset.y + xy.y, 0, in_maxSizeXY.y)));
            c += sample(input, float2( clamp( -in_blurOffset.x + xy.x, 0, in_maxSizeXY.x),
                                       clamp(in_blurOffset.y + xy.y, 0, in_maxSizeXY.y)));
            c += sample(input, float2( clamp( -in_blurOffset.x + xy.x, 0, in_maxSizeXY.x),
                                       clamp(-in_blurOffset.y + xy.y, 0, in_maxSizeXY.y)));

            return half4(c.rgb * 0.2, 1.0);
        }
@@ -99,6 +104,8 @@ sk_sp<SkImage> BlurFilter::generate(GrRecordingContext* context, const uint32_t
    blurBuilder.child("input") =
            input->makeShader(SkTileMode::kClamp, SkTileMode::kClamp, linear, blurMatrix);
    blurBuilder.uniform("in_blurOffset") = SkV2{stepX * kInputScale, stepY * kInputScale};
    blurBuilder.uniform("in_maxSizeXY") =
            SkV2{blurRect.width() * kInputScale - 1, blurRect.height() * kInputScale - 1};

    sk_sp<SkImage> tmpBlur(blurBuilder.makeImage(context, nullptr, scaledInfo, false));

@@ -108,6 +115,8 @@ sk_sp<SkImage> BlurFilter::generate(GrRecordingContext* context, const uint32_t
        blurBuilder.child("input") =
                tmpBlur->makeShader(SkTileMode::kClamp, SkTileMode::kClamp, linear);
        blurBuilder.uniform("in_blurOffset") = SkV2{stepX * stepScale, stepY * stepScale};
        blurBuilder.uniform("in_maxSizeXY") =
                SkV2{blurRect.width() * kInputScale - 1, blurRect.height() * kInputScale - 1};
        tmpBlur = blurBuilder.makeImage(context, nullptr, scaledInfo, false);
    }

+1 −0
Original line number Diff line number Diff line
@@ -3,3 +3,4 @@ cnorthrop@google.com
ianelliott@google.com
jessehall@google.com
lpy@google.com
timvp@google.com
Loading