[-]
[+]
|
Changed |
_service:tar_git:mce-plugin-libhybris.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:mce-plugin-libhybris.spec
^
|
|
[-]
[+]
|
Changed |
_service:tar_git:mce-plugin-libhybris-1.14.5.tar.bz2/Makefile
^
|
@@ -9,6 +9,16 @@
_LIBDIR ?= /usr/lib
# ----------------------------------------------------------------------------
+# CONFIG
+# ----------------------------------------------------------------------------
+
+ENABLE_HYBRIS_SUPPPORT ?= 0
+
+ifeq ($(ENABLE_HYBRIS_SUPPORT),1)
+CPPFLAGS += -DENABLE_HYBRIS_SUPPORT
+endif
+
+# ----------------------------------------------------------------------------
# List of targets to build
# ----------------------------------------------------------------------------
@@ -64,8 +74,10 @@
# ----------------------------------------------------------------------------
PKG_NAMES += glib-2.0
+ifeq ($(ENABLE_HYBRIS_SUPPORT),1)
PKG_NAMES += libhardware
PKG_NAMES += android-headers
+endif
maintenance = normalize clean distclean mostlyclean
intersection = $(strip $(foreach w,$1, $(filter $w,$2)))
@@ -114,10 +126,12 @@
# Explicit dependencies
# ----------------------------------------------------------------------------
+ifeq ($(ENABLE_HYBRIS_SUPPORT),1)
hybris_OBJS += hybris-fb.pic.o
hybris_OBJS += hybris-lights.pic.o
hybris_OBJS += hybris-sensors.pic.o
hybris_OBJS += hybris-thread.pic.o
+endif
hybris_OBJS += plugin-api.pic.o
hybris_OBJS += plugin-config.pic.o
hybris_OBJS += plugin-logging.pic.o
@@ -134,12 +148,15 @@
hybris_OBJS += sysfs-led-white.pic.o
hybris_OBJS += sysfs-val.pic.o
-hybris.so : LDLIBS += -lhardware -lm
+ifeq ($(ENABLE_HYBRIS_SUPPORT),1)
+hybris.so : LDLIBS += -lhardware
+endif
+hybris.so : LDLIBS += -lm
hybris.so : $(hybris_OBJS)
install:: hybris.so
install -d -m755 $(DESTDIR)$(_LIBDIR)/mce/modules
- install -m644 hybris.so $(DESTDIR)$(_LIBDIR)/mce/modules/
+ install -m755 hybris.so $(DESTDIR)$(_LIBDIR)/mce/modules/
# ----------------------------------------------------------------------------
# Source code normalization
|
[-]
[+]
|
Changed |
_service:tar_git:mce-plugin-libhybris-1.14.5.tar.bz2/hybris-fb.c
^
|
@@ -26,6 +26,7 @@
#include "plugin-api.h"
+#include <android-config.h>
#include <system/window.h>
#include <hardware/gralloc.h>
#include <hardware/fb.h>
|
[-]
[+]
|
Changed |
_service:tar_git:mce-plugin-libhybris-1.14.5.tar.bz2/hybris-lights.c
^
|
@@ -26,6 +26,7 @@
#include "plugin-api.h"
+#include <android-config.h>
#include <system/window.h>
#include <hardware/lights.h>
|
[-]
[+]
|
Changed |
_service:tar_git:mce-plugin-libhybris-1.14.5.tar.bz2/hybris-sensors.c
^
|
@@ -25,6 +25,7 @@
#include "plugin-logging.h"
#include "hybris-thread.h"
+#include <android-config.h>
#include <hardware/sensors.h>
#include <glib.h>
|
[-]
[+]
|
Changed |
_service:tar_git:mce-plugin-libhybris-1.14.5.tar.bz2/plugin-api.c
^
|
@@ -116,6 +116,8 @@
void mce_hybris_quit (void);
+#ifdef ENABLE_HYBRIS_SUPPORT
+
/* ========================================================================= *
* FRAME_BUFFER_POWER_STATE
* ========================================================================= */
@@ -218,6 +220,8 @@
return hybris_device_keypad_set_brightness(level);
}
+#endif //ENABLE_HYBRIS_SUPPORT
+
/* ========================================================================= *
* INDICATOR_LED_PATTERN
* ========================================================================= */
@@ -258,9 +262,15 @@
if( sysfs_led_init() ) {
mce_hybris_indicator_uses_sysfs = true;
}
+#ifdef ENABLE_HYBRIS_SUPPORT
else if( !hybris_device_indicator_init() ) {
goto cleanup;
}
+#else
+ else {
+ goto cleanup;
+ }
+#endif
ack = true;
@@ -280,10 +290,12 @@
/* Release sysfs controls */
sysfs_led_quit();
}
+#ifdef ENABLE_HYBRIS_SUPPORT
else {
/* Release libhybris controls */
hybris_device_indicator_quit();
}
+#endif
}
/** Set indicator led pattern via libhybris
@@ -329,9 +341,11 @@
if( mce_hybris_indicator_uses_sysfs ) {
ack = sysfs_led_set_pattern(r, g, b, ms_on, ms_off);
}
+#ifdef ENABLE_HYBRIS_SUPPORT
else {
ack = hybris_device_indicator_set_pattern(r, g, b, ms_on, ms_off);
}
+#endif
mce_log(LL_DEBUG, "pattern(%d,%d,%d,%d,%d) -> %s",
r,g,b, ms_on, ms_off , ack ? "success" : "failure");
@@ -409,6 +423,7 @@
return true;
}
+#ifdef ENABLE_HYBRIS_SUPPORT
/* ========================================================================= *
* PROXIMITY_SENSOR
* ========================================================================= */
@@ -496,6 +511,7 @@
{
hybris_device_als_set_hook(cb);
}
+#endif //ENABLE_HYBRIS_SUPPORT
/* ========================================================================= *
* GENERIC
@@ -506,7 +522,9 @@
void
mce_hybris_quit(void)
{
+#ifdef ENABLE_HYBRIS_SUPPORT
hybris_plugin_fb_unload();
hybris_plugin_lights_unload();
hybris_plugin_sensors_unload();
+#endif
}
|