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

Commit c7404f3b authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Allow SurfaceFlinger to dump to proto"

parents 14c0e8d5 a3d7bd39
Loading
Loading
Loading
Loading
+7 −12
Original line number Diff line number Diff line
@@ -3490,11 +3490,6 @@ status_t SurfaceFlinger::doDump(int fd, const Vector<String16>& args, bool asPro
    const int pid = ipc->getCallingPid();
    const int uid = ipc->getCallingUid();

    if (asProto) {
        // Return early as SurfaceFlinger does not support dumping sections in proto format
        return OK;
    }

    if ((uid != AID_SHELL) &&
            !PermissionCache::checkPermission(sDump, pid, uid)) {
        result.appendFormat("Permission Denial: "
@@ -3514,6 +3509,13 @@ status_t SurfaceFlinger::doDump(int fd, const Vector<String16>& args, bool asPro
        bool dumpAll = true;
        size_t index = 0;
        size_t numArgs = args.size();

        if (asProto) {
            LayersProto layersProto = dumpProtoInfo();
            result.append(layersProto.SerializeAsString().c_str(), layersProto.ByteSize());
            dumpAll = false;
        }

        if (numArgs) {
            if ((index < numArgs) &&
                    (args[index] == String16("--list"))) {
@@ -3562,13 +3564,6 @@ status_t SurfaceFlinger::doDump(int fd, const Vector<String16>& args, bool asPro
                dumpWideColorInfo(result);
                dumpAll = false;
            }

            if ((index < numArgs) && (args[index] == String16("--proto"))) {
                index++;
                LayersProto layersProto = dumpProtoInfo();
                result.append(layersProto.SerializeAsString().c_str(), layersProto.ByteSize());
                dumpAll = false;
            }
        }

        if (dumpAll) {