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

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

Merge "uwb: Default HAL implementation"

parents c18f82b1 80c3cc61
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ aidl_interface {
                enabled: true,
            },
            apex_available: [
                "//apex_available:platform",
                "com.android.uwb",
            ],
            min_sdk_version: "current",
+35 −0
Original line number Diff line number Diff line
package {
    // See: http://go/android-license-faq
    // A large-scale-change added 'default_applicable_licenses' to import
    // all of the 'license_kinds' from "hardware_interfaces_license"
    // to get the below license kinds:
    //   SPDX-license-identifier-Apache-2.0
    default_applicable_licenses: ["hardware_interfaces_license"],
}

cc_binary {
    name: "android.hardware.uwb-service",
    relative_install_path: "hw",
    init_rc: ["uwb-service.rc"],
    vintf_fragments: ["uwb-service.xml"],
    vendor: true,
    cflags: [
        "-Wall",
        "-Wextra",
        "-g",
    ],
    shared_libs: [
        "liblog",
        "libbinder_ndk",
    ],
    static_libs: [
        "libbase",
        "libutils",
        "android.hardware.uwb-V1-ndk",
    ],
    srcs: [
        "service.cpp",
        "uwb.cpp",
        "uwb_chip.cpp",
    ],
}
+2 −0
Original line number Diff line number Diff line
# Bug component: 1042770
include platform/packages/modules/Uwb:/OWNERS
+42 −0
Original line number Diff line number Diff line
/*
 * Copyright 2021, 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 <android-base/logging.h>
#include <android/binder_manager.h>
#include <android/binder_process.h>
#include <utils/StrongPointer.h>

#include "uwb.h"

using ::aidl::android::hardware::uwb::IUwb;
using ::android::sp;
using ::android::base::InitLogging;
using ::android::base::StderrLogger;
using ::android::hardware::uwb::impl::Uwb;

int main(int /*argc*/, char* argv[]) {
    InitLogging(argv, StderrLogger);
    LOG(INFO) << "UWB HAL starting up";

    ABinderProcess_setThreadPoolMaxThreadCount(0);
    std::shared_ptr<IUwb> uwb = ndk::SharedRefBase::make<Uwb>();
    const std::string instance = std::string() + IUwb::descriptor + "/default";
    binder_status_t status = AServiceManager_addService(uwb->asBinder().get(), instance.c_str());
    CHECK(status == STATUS_OK);

    ABinderProcess_joinThreadPool();
    return EXIT_FAILURE;  // should not reach
}
+3 −0
Original line number Diff line number Diff line
service vendor.uwb_hal /vendor/bin/hw/android.hardware.uwb-service
    class hal
    user uwb
Loading