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

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

Merge "Merge commit '3fd83afc' into...

Merge "Merge commit '3fd83afc' into manual_merge_d94b1e6" into oc-dr1-dev-plus-aosp
parents 07881cf1 01d1858f
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -8,8 +8,15 @@ ndk_headers {

subdirs = [
    "cmds/*",
    "headers",
    "libs/*",
    "opengl",
    "services/*",
    "vulkan",
]

cc_library_headers {
    name: "libandroid_sensor_headers",
    vendor: true,
    export_include_dirs: ["include_sensor"],
}
+4 −3
Original line number Diff line number Diff line
@@ -124,6 +124,7 @@ static const TracingCategory k_categories[] = {
        { OPT,      "events/sched/sched_waking/enable" },
        { OPT,      "events/sched/sched_blocked_reason/enable" },
        { OPT,      "events/sched/sched_cpu_hotplug/enable" },
        { OPT,      "events/cgroup/enable" },
    } },
    { "irq",        "IRQ Events",   0, {
        { REQ,      "events/irq/enable" },
@@ -480,8 +481,8 @@ static bool setClock()
        newClock = "global";
    }

    size_t begin = clockStr.find("[") + 1;
    size_t end = clockStr.find("]");
    size_t begin = clockStr.find('[') + 1;
    size_t end = clockStr.find(']');
    if (newClock.compare(0, std::string::npos, clockStr, begin, end-begin) == 0) {
        return true;
    }
@@ -542,7 +543,7 @@ static void pokeHalServices()
    auto listRet = sm->list([&](const auto &interfaces) {
        for (size_t i = 0; i < interfaces.size(); i++) {
            string fqInstanceName = interfaces[i];
            string::size_type n = fqInstanceName.find("/");
            string::size_type n = fqInstanceName.find('/');
            if (n == std::string::npos || interfaces[i].size() == n+1)
                continue;
            hidl_string fqInterfaceName = fqInstanceName.substr(0, n);
+4 −0
Original line number Diff line number Diff line
@@ -25,6 +25,8 @@ on post-fs
    chown root shell /sys/kernel/tracing/events/sched/sched_blocked_reason/enable
    chown root shell /sys/kernel/debug/tracing/events/sched/sched_cpu_hotplug/enable
    chown root shell /sys/kernel/tracing/events/sched/sched_cpu_hotplug/enable
    chown root shell /sys/kernel/debug/tracing/events/cgroup/enable
    chown root shell /sys/kernel/tracing/events/cgroup/enable
    chown root shell /sys/kernel/debug/tracing/events/power/cpu_frequency/enable
    chown root shell /sys/kernel/tracing/events/power/cpu_frequency/enable
    chown root shell /sys/kernel/debug/tracing/events/power/cpu_idle/enable
@@ -77,6 +79,8 @@ on post-fs
    chmod 0664 /sys/kernel/tracing/events/sched/sched_blocked_reason/enable
    chmod 0664 /sys/kernel/debug/tracing/events/sched/sched_cpu_hotplug/enable
    chmod 0664 /sys/kernel/tracing/events/sched/sched_cpu_hotplug/enable
    chmod 0664 /sys/kernel/debug/tracing/events/cgroup/enable
    chmod 0664 /sys/kernel/tracing/events/cgroup/enable
    chmod 0664 /sys/kernel/debug/tracing/events/power/cpu_frequency/enable
    chmod 0664 /sys/kernel/tracing/events/power/cpu_frequency/enable
    chmod 0664 /sys/kernel/debug/tracing/events/power/cpu_idle/enable
+130 −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.

cc_defaults {
    name: "dumpstate_defaults",
    cflags: [
        "-Wall",
        "-Werror",
        "-Wno-missing-field-initializers",
        "-Wno-unused-variable",
        "-Wunused-parameter",
    ],
}

cc_library_headers {
    name: "dumpstate_headers",
    vendor_available: true,
    export_include_dirs: ["."],
    header_libs: [
        "libbase_headers",
        "libutils_headers",
    ],
    export_header_lib_headers: [
        "libbase_headers",
        "libutils_headers",
    ],
}

cc_library_shared {
    name: "libdumpstateutil",
    defaults: ["dumpstate_defaults"],
    vendor_available: true,
    vndk: {
        enabled: true,
    },
    header_libs: ["dumpstate_headers"],
    export_header_lib_headers: ["dumpstate_headers"],
    srcs: [
        "DumpstateInternal.cpp",
        "DumpstateUtil.cpp",
    ],
    shared_libs: [
        "libbase",
        "liblog",
    ],
}

cc_library_shared {
    name: "libdumpstateaidl",
    defaults: ["dumpstate_defaults"],
    shared_libs: [
        "libbinder",
        "libutils",
    ],
    aidl: {
        local_include_dirs: ["binder"],
        export_aidl_headers: true,
    },
    srcs: [
        "binder/android/os/IDumpstate.aidl",
        "binder/android/os/IDumpstateListener.aidl",
        "binder/android/os/IDumpstateToken.aidl",
    ],
}

cc_binary {
    name: "dumpstate",
    defaults: ["dumpstate_defaults"],
    header_libs: ["dumpstate_headers"],
    shared_libs: [
        "android.hardware.dumpstate@1.0",
        "libziparchive",
        "libbase",
        "libbinder",
        "libcrypto",
        "libcutils",
        "libdebuggerd_client",
        "libdumpstateaidl",
        "libdumpstateutil",
        "libhidlbase",
        "libhidltransport",
        "liblog",
        "libutils",
    ],
    srcs: [
        "DumpstateInternal.cpp",
        "DumpstateService.cpp",
        "utils.cpp",
        "dumpstate.cpp",
    ],
    init_rc: ["dumpstate.rc"],
}

cc_test {
    name: "dumpstate_test",
    defaults: ["dumpstate_defaults"],
    header_libs: ["dumpstate_headers"],
    shared_libs: [
        "libziparchive",
        "libbase",
        "libbinder",
        "libcutils",
        "libdebuggerd_client",
        "libdumpstateaidl",
        "libdumpstateutil",
        "libhidlbase",
        "libhidltransport",
        "liblog",
        "libutils",
    ],
    srcs: [
        "DumpstateInternal.cpp",
        "DumpstateService.cpp",
        "utils.cpp",
        "tests/dumpstate_test.cpp",
    ],
    static_libs: ["libgmock"],
}
+2 −133
Original line number Diff line number Diff line
LOCAL_PATH:= $(call my-dir)

# ================#
# Common settings #
# ================#
# ZipArchive support, the order matters here to get all symbols.
COMMON_ZIP_LIBRARIES := libziparchive libz libcrypto

# TODO: ideally the tests should depend on a shared dumpstate library, but currently libdumpstate
# is used to define the device-specific HAL library. Instead, both dumpstate and dumpstate_test
# shares a lot of common settings
COMMON_LOCAL_CFLAGS := \
       -Wall -Werror -Wno-missing-field-initializers -Wno-unused-variable -Wunused-parameter
COMMON_SRC_FILES := \
        DumpstateInternal.cpp \
        utils.cpp
COMMON_SHARED_LIBRARIES := \
        android.hardware.dumpstate@1.0 \
        libhidlbase \
        libhidltransport \
        libbase \
        libbinder \
        libcutils \
        libdebuggerd_client \
        libdumpstateaidl \
        libdumpstateutil \
        liblog \
        libselinux \
        libutils \
        $(COMMON_ZIP_LIBRARIES)

# ====================#
# libdumpstateutil #
# ====================#
include $(CLEAR_VARS)

LOCAL_MODULE := libdumpstateutil

LOCAL_CFLAGS := $(COMMON_LOCAL_CFLAGS)
LOCAL_C_INCLUDES := $(LOCAL_PATH)
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
LOCAL_SRC_FILES := \
        DumpstateInternal.cpp \
        DumpstateUtil.cpp
LOCAL_SHARED_LIBRARIES := \
        libbase \
        liblog \

include $(BUILD_SHARED_LIBRARY)

# ====================#
# libdumpstateheaders #
# ====================#
# TODO: this module is necessary so the device-specific libdumpstate implementations do not
# need to add any other dependency (like libbase). Should go away once dumpstate HAL changes.
include $(CLEAR_VARS)

LOCAL_EXPORT_C_INCLUDE_DIRS = $(LOCAL_PATH)
LOCAL_MODULE := libdumpstateheaders
LOCAL_EXPORT_SHARED_LIBRARY_HEADERS := \
        $(COMMON_SHARED_LIBRARIES)
LOCAL_EXPORT_STATIC_LIBRARY_HEADERS := \
        $(COMMON_STATIC_LIBRARIES)
# Soong requires that whats is on LOCAL_EXPORTED_ is also on LOCAL_
LOCAL_SHARED_LIBRARIES := $(LOCAL_EXPORT_SHARED_LIBRARY_HEADERS)
LOCAL_STATIC_LIBRARIES := $(LOCAL_EXPORT_STATIC_LIBRARY_HEADERS)

include $(BUILD_STATIC_LIBRARY)

# ================ #
# libdumpstateaidl #
# =================#
include $(CLEAR_VARS)

LOCAL_MODULE := libdumpstateaidl

LOCAL_CFLAGS := $(COMMON_LOCAL_CFLAGS)

LOCAL_SHARED_LIBRARIES := \
        libbinder \
        libutils
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/binder
LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/binder
LOCAL_C_INCLUDES := $(LOCAL_PATH)/binder
LOCAL_SRC_FILES := \
        binder/android/os/IDumpstate.aidl \
        binder/android/os/IDumpstateListener.aidl \
        binder/android/os/IDumpstateToken.aidl

include $(BUILD_SHARED_LIBRARY)

# ==========#
# dumpstate #
# ==========#
include $(CLEAR_VARS)

LOCAL_SRC_FILES := $(COMMON_SRC_FILES) \
        DumpstateService.cpp \
        dumpstate.cpp

LOCAL_MODULE := dumpstate

LOCAL_SHARED_LIBRARIES := $(COMMON_SHARED_LIBRARIES)

LOCAL_STATIC_LIBRARIES := $(COMMON_STATIC_LIBRARIES)

LOCAL_CFLAGS += $(COMMON_LOCAL_CFLAGS)

LOCAL_INIT_RC := dumpstate.rc

include $(BUILD_EXECUTABLE)

# ===============#
# dumpstate_test #
# ===============#
include $(CLEAR_VARS)

LOCAL_MODULE := dumpstate_test

LOCAL_MODULE_TAGS := tests

LOCAL_CFLAGS := $(COMMON_LOCAL_CFLAGS)

LOCAL_SRC_FILES := $(COMMON_SRC_FILES) \
        DumpstateService.cpp \
        tests/dumpstate_test.cpp

LOCAL_STATIC_LIBRARIES := $(COMMON_STATIC_LIBRARIES) \
        libgmock

LOCAL_SHARED_LIBRARIES := $(COMMON_SHARED_LIBRARIES)

include $(BUILD_NATIVE_TEST)

# =======================#
# dumpstate_test_fixture #
# =======================#
@@ -141,7 +9,8 @@ LOCAL_MODULE := dumpstate_test_fixture
LOCAL_COMPATIBILITY_SUITE := device-tests
LOCAL_MODULE_TAGS := tests

LOCAL_CFLAGS := $(COMMON_LOCAL_CFLAGS)
LOCAL_CFLAGS := \
       -Wall -Werror -Wno-missing-field-initializers -Wno-unused-variable -Wunused-parameter

LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk

Loading