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

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

Merge "SensorManager doesn't need to ping the remote service" into main

parents 9ecd6c1c 9b534db9
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -21,6 +21,18 @@ package {
    default_applicable_licenses: ["frameworks_native_license"],
}

aconfig_declarations {
    name: "libsensor_flags",
    package: "com.android.hardware.libsensor.flags",
    srcs: ["libsensor_flags.aconfig"],
}

cc_aconfig_library {
    name: "libsensor_flags_c_lib",
    host_supported: true,
    aconfig_declarations: "libsensor_flags",
}

cc_library {
    name: "libsensor",

@@ -52,6 +64,10 @@ cc_library {
        "android.companion.virtual.virtualdevice_aidl-cpp",
    ],

    static_libs: [
        "libsensor_flags_c_lib",
    ],

    export_include_dirs: ["include"],

    export_shared_lib_headers: [
+6 −0
Original line number Diff line number Diff line
@@ -37,6 +37,8 @@
#include <sensor/Sensor.h>
#include <sensor/SensorEventQueue.h>

#include <com_android_hardware_libsensor_flags.h>

// ----------------------------------------------------------------------------
namespace android {
// ----------------------------------------------------------------------------
@@ -192,6 +194,9 @@ void SensorManager::sensorManagerDied() {
}

status_t SensorManager::assertStateLocked() {
#if COM_ANDROID_HARDWARE_LIBSENSOR_FLAGS(SENSORMANAGER_PING_BINDER)
    if (mSensorServer == nullptr) {
#else
    bool initSensorManager = false;
    if (mSensorServer == nullptr) {
        initSensorManager = true;
@@ -203,6 +208,7 @@ status_t SensorManager::assertStateLocked() {
        }
    }
    if (initSensorManager) {
#endif
        waitForSensorService(&mSensorServer);
        LOG_ALWAYS_FATAL_IF(mSensorServer == nullptr, "getService(SensorService) NULL");

+9 −0
Original line number Diff line number Diff line
package: "com.android.hardware.libsensor.flags"

flag {
  name: "sensormanager_ping_binder"
  namespace: "libsensors"
  description: "Whether to pingBinder on SensorManager init"
  bug: "322228259"
  is_fixed_read_only: true
}
 No newline at end of file