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

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

Snap for 5027604 from 74df4906 to qt-release

Change-Id: I5aa6ad3e291195d39f2bc5161551c8060bebe15b
parents bcda2b41 74df4906
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -108,7 +108,7 @@ public:
        OP_MANAGE_IPSEC_TUNNELS = 75,
        OP_START_FOREGROUND = 76,
        OP_BLUETOOTH_SCAN = 77,
        OP_USE_FACE = 78,
        OP_USE_BIOMETRIC = 78,
    };

    AppOpsManager();
+3 −3
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ bool LayerStats::isEnabled() {
}

void LayerStats::traverseLayerTreeStatsLocked(
        const std::vector<std::unique_ptr<LayerProtoParser::Layer>>& layerTree,
        const std::vector<LayerProtoParser::Layer*>& layerTree,
        const LayerProtoParser::LayerGlobal& layerGlobal,
        std::vector<std::string>* const outLayerShapeVec) {
    for (const auto& layer : layerTree) {
@@ -82,7 +82,7 @@ void LayerStats::traverseLayerTreeStatsLocked(
        base::StringAppendF(&key, ",%s",
                            destinationSize(layer->hwcFrame.bottom - layer->hwcFrame.top,
                                            layerGlobal.resolution[1], false));
        base::StringAppendF(&key, ",%s", scaleRatioWH(layer.get()).c_str());
        base::StringAppendF(&key, ",%s", scaleRatioWH(layer).c_str());
        base::StringAppendF(&key, ",%s", alpha(static_cast<float>(layer->color.a)));

        outLayerShapeVec->push_back(key);
@@ -98,7 +98,7 @@ void LayerStats::logLayerStats(const LayersProto& layersProto) {
    std::vector<std::string> layerShapeVec;

    std::lock_guard<std::mutex> lock(mMutex);
    traverseLayerTreeStatsLocked(layerTree, layerGlobal, &layerShapeVec);
    traverseLayerTreeStatsLocked(layerTree.topLevelLayers, layerGlobal, &layerShapeVec);

    std::string layerShapeKey =
            base::StringPrintf("%d,%s,%s,%s", static_cast<int32_t>(layerShapeVec.size()),
+1 −1
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ public:
private:
    // Traverse layer tree to get all visible layers' stats
    void traverseLayerTreeStatsLocked(
            const std::vector<std::unique_ptr<LayerProtoParser::Layer>>& layerTree,
            const std::vector<LayerProtoParser::Layer*>& layerTree,
            const LayerProtoParser::LayerGlobal& layerGlobal,
            std::vector<std::string>* const outLayerShapeVec);
    // Convert layer's top-left position into 8x8 percentage of the display
+6 −4
Original line number Diff line number Diff line
@@ -4620,10 +4620,12 @@ void SurfaceFlinger::dumpAllLocked(const Vector<String16>& args, size_t& index,
                        mGraphicBufferProducerList.size(), mMaxGraphicBufferProducerListSize);
    colorizer.reset(result);

    {
        LayersProto layersProto = dumpProtoInfo(LayerVector::StateSet::Current);
        auto layerTree = LayerProtoParser::generateLayerTree(layersProto);
    result.append(LayerProtoParser::layersToString(std::move(layerTree)).c_str());
        result.append(LayerProtoParser::layerTreeToString(layerTree).c_str());
        result.append("\n");
    }

    result.append("\nFrame-Composition information:\n");
    dumpFrameCompositionInfo(result);
+17 −13
Original line number Diff line number Diff line
@@ -27,32 +27,36 @@
namespace android {

void SurfaceTracing::enable() {
    ATRACE_CALL();
    std::lock_guard<std::mutex> protoGuard(mTraceMutex);

    if (mEnabled) {
        return;
    }
    ATRACE_CALL();
    mEnabled = true;
    std::lock_guard<std::mutex> protoGuard(mTraceMutex);

    mTrace.set_magic_number(uint64_t(LayersTraceFileProto_MagicNumber_MAGIC_NUMBER_H) << 32 |
    mTrace = std::make_unique<LayersTraceFileProto>();
    mTrace->set_magic_number(uint64_t(LayersTraceFileProto_MagicNumber_MAGIC_NUMBER_H) << 32 |
                             LayersTraceFileProto_MagicNumber_MAGIC_NUMBER_L);
}

status_t SurfaceTracing::disable() {
    ATRACE_CALL();
    std::lock_guard<std::mutex> protoGuard(mTraceMutex);

    if (!mEnabled) {
        return NO_ERROR;
    }
    ATRACE_CALL();
    std::lock_guard<std::mutex> protoGuard(mTraceMutex);
    mEnabled = false;
    status_t err(writeProtoFileLocked());
    ALOGE_IF(err == PERMISSION_DENIED, "Could not save the proto file! Permission denied");
    ALOGE_IF(err == NOT_ENOUGH_DATA, "Could not save the proto file! There are missing fields");
    mTrace.Clear();
    mTrace.reset();
    return err;
}

bool SurfaceTracing::isEnabled() const {
    std::lock_guard<std::mutex> protoGuard(mTraceMutex);
    return mEnabled;
}

@@ -61,29 +65,29 @@ void SurfaceTracing::traceLayers(const char* where, LayersProto layers) {
    if (!mEnabled) {
        return;
    }
    LayersTraceProto* entry = mTrace.add_entry();
    LayersTraceProto* entry = mTrace->add_entry();
    entry->set_elapsed_realtime_nanos(elapsedRealtimeNano());
    entry->set_where(where);
    entry->mutable_layers()->Swap(&layers);

    constexpr int maxBufferedEntryCount = 3600;
    if (mTrace.entry_size() >= maxBufferedEntryCount) {
    if (mTrace->entry_size() >= maxBufferedEntryCount) {
        // TODO: flush buffered entries without disabling tracing
        ALOGE("too many buffered frames; force disable tracing");
        mEnabled = false;
        writeProtoFileLocked();
        mTrace.Clear();
        mTrace.reset();
    }
}

status_t SurfaceTracing::writeProtoFileLocked() {
    ATRACE_CALL();

    if (!mTrace.IsInitialized()) {
    if (!mTrace->IsInitialized()) {
        return NOT_ENOUGH_DATA;
    }
    std::string output;
    if (!mTrace.SerializeToString(&output)) {
    if (!mTrace->SerializeToString(&output)) {
        return PERMISSION_DENIED;
    }
    if (!android::base::WriteStringToFile(output, mOutputFileName, true)) {
@@ -97,7 +101,7 @@ void SurfaceTracing::dump(String8& result) const {
    std::lock_guard<std::mutex> protoGuard(mTraceMutex);

    result.appendFormat("Tracing state: %s\n", mEnabled ? "enabled" : "disabled");
    result.appendFormat("  number of entries: %d\n", mTrace.entry_size());
    result.appendFormat("  number of entries: %d\n", mTrace ? mTrace->entry_size() : 0);
}

} // namespace android
Loading