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

Commit 15bd7517 authored by Luke Song's avatar Luke Song
Browse files

Allow replacing of sensord

If a makefile variable is set.

Bug: None
Test: None
Change-Id: I416428efc0b6127048e3ef3860ed5ba7f94efe88
parent 47ec2864
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -14,6 +14,8 @@

LOCAL_PATH := $(call my-dir)

SENSORD_EXTEND ?= libsensordextensionstub

sourceFiles := \
	pose_service.cpp \
	sensord.cpp \
@@ -42,6 +44,7 @@ sharedLibraries := \
	liblog \
	libhardware \
	libutils \
	$(SENSORD_EXTEND) \

cFlags := -DLOG_TAG=\"sensord\" \
          -DTRACE=0
@@ -67,3 +70,8 @@ LOCAL_SHARED_LIBRARIES := $(sharedLibraries)
LOCAL_SRC_FILES := test/poselatencytest.cpp
LOCAL_MODULE := poselatencytest
include $(BUILD_EXECUTABLE)

include $(CLEAR_VARS)
LOCAL_MODULE := libsensordextensionstub
LOCAL_SRC_FILES := sensord_extension.cpp
include $(BUILD_SHARED_LIBRARY)
+4 −0
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@
#include "sensor_ndk_thread.h"
#include "sensor_service.h"
#include "sensor_thread.h"
#include "sensord_extension.h"

using android::dvr::PoseService;
using android::dvr::SensorHalThread;
@@ -22,10 +23,13 @@ using android::dvr::SensorService;
using android::dvr::SensorThread;
using android::pdx::Service;
using android::pdx::ServiceDispatcher;
using android::dvr::SensordExtension;

int main(int, char**) {
  ALOGI("Starting up...");

  SensordExtension::run();

  // We need to be able to create endpoints with full perms.
  umask(0000);

+4 −0
Original line number Diff line number Diff line
#include "sensord_extension.h"

void android::dvr::SensordExtension::run() {
}
+16 −0
Original line number Diff line number Diff line
#ifndef ANDROID_DVR_SENSORD_EXTENSION_H_
#define ANDROID_DVR_SENSORD_EXTENSION_H_

namespace android {
namespace dvr {

// Allows sensord to be extended with additional code.
class SensordExtension {
 public:
  static void run();
};

} // namespace dvr
} // namespace android

#endif // ANDROID_DVR_SENSORD_EXTENSION_H_