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

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

Snap for 4375922 from 208bef3a to pi-release

Change-Id: Ibcd98dd19df39c7942f8a9186b50f58b196ecb88
parents 2a747dcb 208bef3a
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<!-- This is the standard feature indicating that the device supports WiFi RTT (IEEE 802.11mc). -->
<permissions>
    <feature name="android.hardware.wifi.rtt" />
</permissions>
+2 −1
Original line number Diff line number Diff line
@@ -215,7 +215,7 @@ void worker_fx(int num,
        int target = cs_pair ? num % server_count : rand() % workers.size();
        int sz = payload_size;

        while (sz > sizeof(uint32_t)) {
        while (sz >= sizeof(uint32_t)) {
            data.writeInt32(0);
            sz -= sizeof(uint32_t);
        }
@@ -381,6 +381,7 @@ int main(int argc, char *argv[])
            // No need to run training round in this case.
            if (atoi(argv[i+1]) > 0) {
                max_time_bucket = strtoull(argv[i+1], (char **)NULL, 10) * 1000;
                time_per_bucket = max_time_bucket / num_buckets;
                i++;
            } else {
                cout << "Max latency -m must be positive." << endl;
+35 −0
Original line number Diff line number Diff line
// Copyright (C) 2017 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//
// Static library used in testing and executables
//
cc_library_static {
    name: "libserviceutils",

    cflags: [
        "-Wall",
        "-Wno-unused-parameter",
        "-Werror",
    ],

    srcs: [
        "PriorityDumper.cpp",
    ],

    clang: true,
    export_include_dirs: ["include"],
}

subdirs = ["tests"]
+46 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "include/PriorityDumper.h"

namespace android {

static void getStrippedArgs(Vector<String16>& dest, const Vector<String16>& source,
                            std::size_t numArgsToStrip) {
    for (auto it = source.begin() + numArgsToStrip; it != source.end(); it++) {
        dest.add(*it);
    }
}

void priorityDump(PriorityDumper& dumper, int fd, const Vector<String16>& args) {
    if (args.size() >= 2 && args[0] == PRIORITY_ARG) {
        String16 priority = args[1];
        Vector<String16> strippedArgs;
        getStrippedArgs(strippedArgs, args, 2);
        if (priority == PRIORITY_ARG_CRITICAL) {
            dumper.dumpCritical(fd, strippedArgs);
        } else if (priority == PRIORITY_ARG_HIGH) {
            dumper.dumpHigh(fd, strippedArgs);
        } else if (priority == PRIORITY_ARG_NORMAL) {
            dumper.dumpNormal(fd, strippedArgs);
        } else {
            dumper.dump(fd, args);
        }
    } else {
        dumper.dump(fd, args);
    }
}
} // namespace android
 No newline at end of file
+62 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef ANDROID_UTILS_PRIORITYDUMP_H
#define ANDROID_UTILS_PRIORITYDUMP_H

#include <utils/String16.h>
#include <utils/Vector.h>

namespace android {

constexpr const char16_t PRIORITY_ARG[] = u"--dump-priority";
constexpr const char16_t PRIORITY_ARG_CRITICAL[] = u"CRITICAL";
constexpr const char16_t PRIORITY_ARG_HIGH[] = u"HIGH";
constexpr const char16_t PRIORITY_ARG_NORMAL[] = u"NORMAL";

// Helper class to split dumps into various priority buckets.
class PriorityDumper {
public:
    // Dumps CRITICAL priority sections.
    virtual void dumpCritical(int fd, const Vector<String16>& args) {}

    // Dumps HIGH priority sections.
    virtual void dumpHigh(int fd, const Vector<String16>& args) {}

    // Dumps normal priority sections.
    virtual void dumpNormal(int fd, const Vector<String16>& args) {}

    // Dumps all sections.
    // This method is called when priorityDump is called without priority
    // arguments. By default, it calls all three dump methods.
    virtual void dump(int fd, const Vector<String16>& args) {
        dumpCritical(fd, args);
        dumpHigh(fd, args);
        dumpNormal(fd, args);
    }
    virtual ~PriorityDumper() = default;
};

// Parses the argument list checking if the first argument is --dump_priority and
// the second argument is the priority type (HIGH, CRITICAL or NORMAL). If the
// arguments are found, they are stripped and the appropriate PriorityDumper
// method is called.
// If --dump_priority argument is not passed, all supported sections are dumped.
void priorityDump(PriorityDumper& dumper, int fd, const Vector<String16>& args);

}; // namespace android

#endif // ANDROID_UTILS_PRIORITYDUMP_H
Loading