Skip to content

Commit

Permalink
Use sensorfw for ambient light and proximity sensor input
Browse files Browse the repository at this point in the history
Tracks sensord D-Bus name on system bus to detect availability
of the sensors API.

While the D-Bus name is not reserved, ALS and PS enable states
are cached internally within MCE. When sensord startup / restart
is detected the cached state is used for opening sensor sessions
as needed.

[mce] Use sensorfw for ambient light and proximity sensor input
  • Loading branch information
spiiroin committed Sep 16, 2013
1 parent 5e536d1 commit 3b1468a
Show file tree
Hide file tree
Showing 7 changed files with 1,308 additions and 7 deletions.
18 changes: 18 additions & 0 deletions .depend
Expand Up @@ -234,6 +234,18 @@ mce-modules.pic.o:\
mce-modules.h\
mce.h\

mce-sensorfw.o:\
mce-sensorfw.c\
mce-dbus.h\
mce-log.h\
mce-sensorfw.h\

mce-sensorfw.pic.o:\
mce-sensorfw.c\
mce-dbus.h\
mce-log.h\
mce-sensorfw.h\

mce.o:\
mce.c\
datapipe.h\
Expand All @@ -246,6 +258,7 @@ mce.o:\
mce-gconf.h\
mce-log.h\
mce-modules.h\
mce-sensorfw.h\
mce.h\
modetransition.h\
powerkey.h\
Expand All @@ -263,6 +276,7 @@ mce.pic.o:\
mce-gconf.h\
mce-log.h\
mce-modules.h\
mce-sensorfw.h\
mce.h\
modetransition.h\
powerkey.h\
Expand Down Expand Up @@ -463,6 +477,7 @@ modules/filter-brightness-als.o:\
mce-io.h\
mce-lib.h\
mce-log.h\
mce-sensorfw.h\
mce.h\
median_filter.h\
mce-hybris.h\
Expand All @@ -479,6 +494,7 @@ modules/filter-brightness-als.pic.o:\
mce-io.h\
mce-lib.h\
mce-log.h\
mce-sensorfw.h\
mce.h\
median_filter.h\
mce-hybris.h\
Expand Down Expand Up @@ -600,6 +616,7 @@ modules/proximity.o:\
mce-hal.h\
mce-io.h\
mce-log.h\
mce-sensorfw.h\
mce.h\
mce-hybris.h\
modules/proximity.h\
Expand All @@ -612,6 +629,7 @@ modules/proximity.pic.o:\
mce-hal.h\
mce-io.h\
mce-log.h\
mce-sensorfw.h\
mce.h\
mce-hybris.h\
modules/proximity.h\
Expand Down
11 changes: 11 additions & 0 deletions Makefile
Expand Up @@ -69,6 +69,9 @@ endif
endif
PKG_CONFIG ?= pkg-config

# Whether to use sensorfw for ALS/PS
ENABLE_SENSORFW ?= y

# Whether to enable support for libhybris plugin
ENABLE_HYBRIS ?= y

Expand Down Expand Up @@ -212,6 +215,10 @@ ifeq ($(strip $(ENABLE_BUILTIN_GCONF)),y)
CPPFLAGS += -DENABLE_BUILTIN_GCONF
endif

ifeq ($(ENABLE_SENSORFW),y)
CPPFLAGS += -DENABLE_SENSORFW
endif

ifeq ($(ENABLE_HYBRIS),y)
CPPFLAGS += -DENABLE_HYBRIS
endif
Expand Down Expand Up @@ -297,6 +304,7 @@ MCE_CORE += mce-log.c
MCE_CORE += mce-conf.c
MCE_CORE += datapipe.c
MCE_CORE += mce-modules.c
MCE_CORE += mce-sensorfw.c
MCE_CORE += mce-io.c
MCE_CORE += mce-lib.c
MCE_CORE += median_filter.c
Expand All @@ -305,6 +313,9 @@ MCE_CORE += filewatcher.c
ifeq ($(ENABLE_HYBRIS),y)
MCE_CORE += mce-hybris.c
endif
ifeq ($(ENABLE_SENSORFW),y)
MCE_CORE += mce-sensorfw.c
endif
# HACK: do not link against libgconf-2
ifeq ($(strip $(ENABLE_BUILTIN_GCONF)),y)
MCE_CORE += builtin-gconf.c
Expand Down

0 comments on commit 3b1468a

Please sign in to comment.