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

Commit 0687ad03 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 11211173 from e6d4cbc4 to 24Q1-release

Change-Id: I17fa6c458bc47c7624cab6fe2a09be7153b95759
parents 87fd51e3 e6d4cbc4
Loading
Loading
Loading
Loading
+84 −15
Original line number Diff line number Diff line
@@ -22,23 +22,51 @@ package {
}

cc_library_headers {
    name: "libbinder_headers",
    name: "libbinder_headers_base",
    export_include_dirs: ["include"],
    vendor_available: true,
    recovery_available: true,
    host_supported: true,
    // TODO(b/153609531): remove when no longer needed.
    native_bridge_supported: true,

    header_libs: [
        "libbase_headers",
        "libbinder_headers_platform_shared",
    ],
    export_header_lib_headers: [
        "libbinder_headers_platform_shared",
    ],
    apex_available: [
        "//apex_available:platform",
        "com.android.media",
        "com.android.media.swcodec",
    ],
    min_sdk_version: "29",
    target: {
        darwin: {
            enabled: false,
        },
    },
    visibility: [
        ":__subpackages__",
    ],
}

cc_library_headers {
    name: "libbinder_headers",
    vendor_available: true,
    recovery_available: true,
    host_supported: true,
    native_bridge_supported: true,

    header_libs: [
        "libbase_headers",
        "libbinder_headers_base",
        "libcutils_headers",
        "libutils_headers",
    ],
    export_header_lib_headers: [
        "libbase_headers",
        "libbinder_headers_platform_shared",
        "libbinder_headers_base",
        "libcutils_headers",
        "libutils_headers",
    ],
@@ -87,6 +115,7 @@ cc_defaults {
        "RpcSession.cpp",
        "RpcServer.cpp",
        "RpcState.cpp",
        "RpcTransportRaw.cpp",
        "Stability.cpp",
        "Status.cpp",
        "TextOutput.cpp",
@@ -94,17 +123,8 @@ cc_defaults {
        "file.cpp",
    ],

    shared_libs: [
        "libcutils",
        "libutils",
    ],

    static_libs: [
        "libbase",
    ],

    header_libs: [
        "libbinder_headers",
        "libbinder_headers_base",
    ],

    cflags: [
@@ -131,7 +151,6 @@ cc_defaults {
    srcs: [
        "OS_android.cpp",
        "OS_unix_base.cpp",
        "RpcTransportRaw.cpp",
    ],

    target: {
@@ -156,11 +175,18 @@ cc_defaults {
    },

    shared_libs: [
        "libcutils",
        "liblog",
        "libutils",
    ],

    static_libs: [
        "libbase",
    ],

    header_libs: [
        "jni_headers",
        "libbinder_headers",
    ],

    export_header_lib_headers: [
@@ -217,10 +243,15 @@ cc_defaults {
    host_supported: true,

    header_libs: [
        "libbinder_headers_base",
        "liblog_stub",
        "trusty_mock_headers",
    ],

    shared_libs: [
        "libutils_binder_sdk",
    ],

    cflags: [
        "-DBINDER_RPC_SINGLE_THREADED",
        "-DBINDER_ENABLE_LIBLOG_ASSERT",
@@ -351,6 +382,44 @@ cc_library {
    afdo: true,
}

cc_library_host_shared {
    name: "libbinder_sdk",

    defaults: [
        "libbinder_common_defaults",
    ],

    shared_libs: [
        "libutils_binder_sdk",
    ],

    cflags: [
        "-DBINDER_ENABLE_LIBLOG_ASSERT",
        "-DBINDER_DISABLE_NATIVE_HANDLE",
        "-DBINDER_DISABLE_BLOB",
        "-DBINDER_NO_LIBBASE",
    ],

    header_libs: [
        "liblog_stub",
    ],

    srcs: [
        "OS_non_android_linux.cpp",
        "OS_unix_base.cpp",
    ],

    visibility: [
        ":__subpackages__",
    ],

    target: {
        windows: {
            enabled: false,
        },
    },
}

cc_library_static {
    name: "libbinder_rpc_no_kernel",
    vendor_available: true,
+57 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2023 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 "OS.h"

#include <log/log.h>

#include <syscall.h>
#include <cstdarg>

#ifdef __ANDROID__
#error "This module is not intended for Android, just bare Linux"
#endif
#ifdef __APPLE__
#error "This module is not intended for MacOS"
#endif
#ifdef _WIN32
#error "This module is not intended for Windows"
#endif

namespace android::binder::os {

void trace_begin(uint64_t, const char*) {}

void trace_end(uint64_t) {}

uint64_t GetThreadId() {
    return syscall(__NR_gettid);
}

bool report_sysprop_change() {
    return false;
}

} // namespace android::binder::os

int __android_log_print(int /*prio*/, const char* /*tag*/, const char* fmt, ...) {
    va_list args;
    va_start(args, fmt);
    vfprintf(stderr, fmt, args);
    va_end(args);

    return 1;
}
+0 −5
Original line number Diff line number Diff line
@@ -126,8 +126,3 @@ int __android_log_print(int prio [[maybe_unused]], const char* tag, const char*

    return 1;
}

// TODO(b/285204695): remove once trusty mock doesn't depend on libbase
extern "C" int __android_log_buf_print(int, int, const char*, const char*, ...) {
    return -ENOSYS;
}
+1 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ enum {
    BATTERY_PROP_MANUFACTURING_DATE = 8, // equals BATTERY_PROPERTY_MANUFACTURING_DATE
    BATTERY_PROP_FIRST_USAGE_DATE = 9, // equals BATTERY_PROPERTY_FIRST_USAGE_DATE
    BATTERY_PROP_STATE_OF_HEALTH = 10, // equals BATTERY_PROPERTY_STATE_OF_HEALTH
    BATTERY_PROP_PART_STATUS = 12, // equals BATTERY_PROPERTY_PART_STATUS
};

struct BatteryProperties {
+18 −4
Original line number Diff line number Diff line
@@ -327,14 +327,23 @@ void PointerChoreographer::updatePointerControllersLocked() {
    std::set<DeviceId> touchDevicesToKeep;
    std::set<DeviceId> stylusDevicesToKeep;

    // Mark the displayIds or deviceIds of PointerControllers currently needed.
    // Mark the displayIds or deviceIds of PointerControllers currently needed, and create
    // new PointerControllers if necessary.
    for (const auto& info : mInputDeviceInfos) {
        const uint32_t sources = info.getSources();
        if (isFromSource(sources, AINPUT_SOURCE_MOUSE) ||
            isFromSource(sources, AINPUT_SOURCE_MOUSE_RELATIVE)) {
            const int32_t resolvedDisplayId =
                    getTargetMouseDisplayLocked(info.getAssociatedDisplayId());
            mouseDisplaysToKeep.insert(resolvedDisplayId);
            const int32_t displayId = getTargetMouseDisplayLocked(info.getAssociatedDisplayId());
            mouseDisplaysToKeep.insert(displayId);
            // For mice, show the cursor immediately when the device is first connected or
            // when it moves to a new display.
            auto [mousePointerIt, isNewMousePointer] =
                    mMousePointersByDisplay.try_emplace(displayId,
                                                        getMouseControllerConstructor(displayId));
            auto [_, isNewMouseDevice] = mMouseDevices.emplace(info.getId());
            if (isNewMouseDevice || isNewMousePointer) {
                mousePointerIt->second->unfade(PointerControllerInterface::Transition::IMMEDIATE);
            }
        }
        if (isFromSource(sources, AINPUT_SOURCE_TOUCHSCREEN) && mShowTouchesEnabled &&
            info.getAssociatedDisplayId() != ADISPLAY_ID_NONE) {
@@ -356,6 +365,11 @@ void PointerChoreographer::updatePointerControllersLocked() {
    std::erase_if(mStylusPointersByDevice, [&stylusDevicesToKeep](const auto& pair) {
        return stylusDevicesToKeep.find(pair.first) == stylusDevicesToKeep.end();
    });
    std::erase_if(mMouseDevices, [&](DeviceId id) REQUIRES(mLock) {
        return std::find_if(mInputDeviceInfos.begin(), mInputDeviceInfos.end(),
                            [id](const auto& info) { return info.getId() == id; }) ==
                mInputDeviceInfos.end();
    });

    // Notify the policy if there's a change on the pointer display ID.
    notifyPointerDisplayIdChangedLocked();
Loading