diff --git a/include/hardware/nvram.h b/include/hardware/nvram.h
index a1868b5..859ea47 100644
--- a/include/hardware/nvram.h
+++ b/include/hardware/nvram.h
@@ -21,6 +21,7 @@
 #include <sys/cdefs.h>
 
 #include <hardware/hardware.h>
+#include <hardware/nvram_defs.h>
 
 __BEGIN_DECLS
 
@@ -30,30 +31,7 @@
 
 /* The version of this module. */
 #define NVRAM_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1)
-#define NVRAM_DEVICE_API_VERSION_0_1 HARDWARE_DEVICE_API_VERSION(0, 1)
-
-/* Values returned by nvram_device methods. */
-typedef uint32_t nvram_result_t;
-
-const nvram_result_t NV_RESULT_SUCCESS = 0;
-const nvram_result_t NV_RESULT_INTERNAL_ERROR = 1;
-const nvram_result_t NV_RESULT_ACCESS_DENIED = 2;
-const nvram_result_t NV_RESULT_INVALID_PARAMETER = 3;
-const nvram_result_t NV_RESULT_SPACE_DOES_NOT_EXIST = 4;
-const nvram_result_t NV_RESULT_SPACE_ALREADY_EXISTS = 5;
-const nvram_result_t NV_RESULT_OPERATION_DISABLED = 6;
-
-/* Values describing available access controls. */
-typedef uint32_t nvram_control_t;
-
-const nvram_control_t NV_CONTROL_PERSISTENT_WRITE_LOCK = 1;
-const nvram_control_t NV_CONTROL_BOOT_WRITE_LOCK = 2;
-const nvram_control_t NV_CONTROL_BOOT_READ_LOCK = 3;
-const nvram_control_t NV_CONTROL_WRITE_AUTHORIZATION = 4;
-const nvram_control_t NV_CONTROL_READ_AUTHORIZATION = 5;
-const nvram_control_t NV_CONTROL_WRITE_EXTEND = 6;
-
-const uint32_t NV_UNLIMITED_SPACES = 0xFFFFFFFF;
+#define NVRAM_DEVICE_API_VERSION_1_1 HARDWARE_DEVICE_API_VERSION(1, 1)
 
 struct nvram_module {
     /**
@@ -99,6 +77,17 @@
         const struct nvram_device* device, uint64_t* available_size);
 
     /**
+     * Outputs the maximum number of bytes that can be allocated for a single
+     * space. This will always be at least 32. If an implementation does not
+     * limit the maximum size it may provide the total size.
+     *
+     *   device - The nvram_device instance.
+     *   max_space_size - Receives the output. Cannot be NULL.
+     */
+    nvram_result_t (*get_max_space_size_in_bytes)(
+        const struct nvram_device* device, uint64_t* max_space_size);
+
+    /**
      * Outputs the maximum total number of spaces that may be allocated.
      * This will always be at least 8. Outputs NV_UNLIMITED_SPACES if any
      * number of spaces are supported (limited only to available NVRAM
diff --git a/include/hardware/nvram_defs.h b/include/hardware/nvram_defs.h
new file mode 100644
index 0000000..0256a3c
--- /dev/null
+++ b/include/hardware/nvram_defs.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+/*
+ * This file contains data type definitions and constants that are useful to
+ * code interacting with and implementing the NVRAM HAL, even though it doesn't
+ * use the actual NVRAM HAL module interface. Keeping this in a separate file
+ * simplifies inclusion in low-level code which can't easily include the heavier
+ * hardware.h due to lacking standard headers.
+ */
+
+#ifndef ANDROID_HARDWARE_NVRAM_DEFS_H
+#define ANDROID_HARDWARE_NVRAM_DEFS_H
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif  // __cplusplus
+
+/* Values returned by nvram_device methods. */
+typedef uint32_t nvram_result_t;
+
+const nvram_result_t NV_RESULT_SUCCESS = 0;
+const nvram_result_t NV_RESULT_INTERNAL_ERROR = 1;
+const nvram_result_t NV_RESULT_ACCESS_DENIED = 2;
+const nvram_result_t NV_RESULT_INVALID_PARAMETER = 3;
+const nvram_result_t NV_RESULT_SPACE_DOES_NOT_EXIST = 4;
+const nvram_result_t NV_RESULT_SPACE_ALREADY_EXISTS = 5;
+const nvram_result_t NV_RESULT_OPERATION_DISABLED = 6;
+
+/* Values describing available access controls. */
+typedef uint32_t nvram_control_t;
+
+const nvram_control_t NV_CONTROL_PERSISTENT_WRITE_LOCK = 1;
+const nvram_control_t NV_CONTROL_BOOT_WRITE_LOCK = 2;
+const nvram_control_t NV_CONTROL_BOOT_READ_LOCK = 3;
+const nvram_control_t NV_CONTROL_WRITE_AUTHORIZATION = 4;
+const nvram_control_t NV_CONTROL_READ_AUTHORIZATION = 5;
+const nvram_control_t NV_CONTROL_WRITE_EXTEND = 6;
+
+const uint32_t NV_UNLIMITED_SPACES = 0xFFFFFFFF;
+
+#ifdef __cplusplus
+}  // extern "C"
+#endif  // __cplusplus
+
+#endif  // ANDROID_HARDWARE_NVRAM_DEFS_H
diff --git a/modules/camera/ExampleCamera.cpp b/modules/camera/ExampleCamera.cpp
index d873321..2b1f185 100644
--- a/modules/camera/ExampleCamera.cpp
+++ b/modules/camera/ExampleCamera.cpp
@@ -26,7 +26,7 @@
 
 #include "ExampleCamera.h"
 
-#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
 
 namespace default_camera_hal {
 
diff --git a/modules/consumerir/consumerir.c b/modules/consumerir/consumerir.c
index f3eac0b..b0ff940 100644
--- a/modules/consumerir/consumerir.c
+++ b/modules/consumerir/consumerir.c
@@ -22,7 +22,7 @@
 #include <hardware/hardware.h>
 #include <hardware/consumerir.h>
 
-#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
 
 static const consumerir_freq_range_t consumerir_freqs[] = {
     {.min = 30000, .max = 30000},
diff --git a/modules/usbcamera/UsbCamera.cpp b/modules/usbcamera/UsbCamera.cpp
index 82a1145..d0aaded 100644
--- a/modules/usbcamera/UsbCamera.cpp
+++ b/modules/usbcamera/UsbCamera.cpp
@@ -26,7 +26,7 @@
 #include "Camera.h"
 #include "UsbCamera.h"
 
-#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
 
 namespace usb_camera_hal {
 
diff --git a/modules/vibrator/vibrator.c b/modules/vibrator/vibrator.c
index 6b3ce57..c3c2951 100644
--- a/modules/vibrator/vibrator.c
+++ b/modules/vibrator/vibrator.c
@@ -21,11 +21,15 @@
 
 #include <malloc.h>
 #include <stdio.h>
+#include <stdbool.h>
+#include <string.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <errno.h>
 #include <math.h>
 
+#define TIMEOUT_STR_LEN         20
+
 static const char THE_DEVICE[] = "/sys/class/timed_output/vibrator/enable";
 
 static int vibra_exists() {
@@ -33,7 +37,6 @@
 
     fd = TEMP_FAILURE_RETRY(open(THE_DEVICE, O_RDWR));
     if(fd < 0) {
-        ALOGE("Vibrator file does not exist : %d", fd);
         return 0;
     }
 
@@ -41,27 +44,24 @@
     return 1;
 }
 
-static int sendit(unsigned int timeout_ms)
+static int write_value(const char *file, const char *value)
 {
     int to_write, written, ret, fd;
 
-    char value[20]; /* large enough for millions of years */
-
-    fd = TEMP_FAILURE_RETRY(open(THE_DEVICE, O_RDWR));
-    if(fd < 0) {
+    fd = TEMP_FAILURE_RETRY(open(file, O_WRONLY));
+    if (fd < 0) {
         return -errno;
     }
 
-    to_write = snprintf(value, sizeof(value), "%u\n", timeout_ms);
+    to_write = strlen(value) + 1;
     written = TEMP_FAILURE_RETRY(write(fd, value, to_write));
-
     if (written == -1) {
         ret = -errno;
     } else if (written != to_write) {
         /* even though EAGAIN is an errno value that could be set
            by write() in some cases, none of them apply here.  So, this return
            value can be clearly identified when debugging and suggests the
-           caller that it may try to call vibraror_on() again */
+           caller that it may try to call vibrator_on() again */
         ret = -EAGAIN;
     } else {
         ret = 0;
@@ -73,6 +73,14 @@
     return ret;
 }
 
+static int sendit(unsigned int timeout_ms)
+{
+    char value[TIMEOUT_STR_LEN]; /* large enough for millions of years */
+
+    snprintf(value, sizeof(value), "%u", timeout_ms);
+    return write_value(THE_DEVICE, value);
+}
+
 static int vibra_on(vibrator_device_t* vibradev __unused, unsigned int timeout_ms)
 {
     /* constant on, up to maximum allowed time */
@@ -84,6 +92,43 @@
     return sendit(0);
 }
 
+static const char LED_DEVICE[] = "/sys/class/leds/vibrator";
+
+static int write_led_file(const char *file, const char *value)
+{
+    char file_str[50];
+
+    snprintf(file_str, sizeof(file_str), "%s/%s", LED_DEVICE, file);
+    return write_value(file_str, value);
+}
+
+static int vibra_led_exists()
+{
+    return !write_led_file("trigger", "transient");
+}
+
+static int vibra_led_on(vibrator_device_t* vibradev __unused, unsigned int timeout_ms)
+{
+    int ret;
+    char value[TIMEOUT_STR_LEN]; /* large enough for millions of years */
+
+    ret = write_led_file("state", "1");
+    if (ret)
+        return ret;
+
+    snprintf(value, sizeof(value), "%u\n", timeout_ms);
+    ret = write_led_file("duration", value);
+    if (ret)
+        return ret;
+
+    return write_led_file("activate", "1");
+}
+
+static int vibra_led_off(vibrator_device_t* vibradev __unused)
+{
+    return write_led_file("activate", "0");
+}
+
 static int vibra_close(hw_device_t *device)
 {
     free(device);
@@ -92,7 +137,15 @@
 
 static int vibra_open(const hw_module_t* module, const char* id __unused,
                       hw_device_t** device __unused) {
-    if (!vibra_exists()) {
+    bool use_led;
+
+    if (vibra_exists()) {
+        ALOGD("Vibrator using timed_output");
+        use_led = false;
+    } else if (vibra_led_exists()) {
+        ALOGD("Vibrator using LED trigger");
+        use_led = true;
+    } else {
         ALOGE("Vibrator device does not exist. Cannot start vibrator");
         return -ENODEV;
     }
@@ -109,8 +162,13 @@
     vibradev->common.version = HARDWARE_DEVICE_API_VERSION(1,0);
     vibradev->common.close = vibra_close;
 
-    vibradev->vibrator_on = vibra_on;
-    vibradev->vibrator_off = vibra_off;
+    if (use_led) {
+        vibradev->vibrator_on = vibra_led_on;
+        vibradev->vibrator_off = vibra_led_off;
+    } else {
+        vibradev->vibrator_on = vibra_on;
+        vibradev->vibrator_off = vibra_off;
+    }
 
     *device = (hw_device_t *) vibradev;
 
diff --git a/tests/hwc/cnativewindow.c b/tests/hwc/cnativewindow.c
index 5c16afb..5b1d78e 100644
--- a/tests/hwc/cnativewindow.c
+++ b/tests/hwc/cnativewindow.c
@@ -37,7 +37,7 @@
 static int trace_level = 1;
 
 #define _TRACE(n,fmt...) \
-	do { if (trace_level >= n) fprintf(stderr, "CNW: " fmt); } while (0)
+	do { if (trace_level >= (n)) fprintf(stderr, "CNW: " fmt); } while (0)
 
 #define ERROR(fmt...) _TRACE(0, fmt)
 #define INFO(fmt...) _TRACE(1, fmt)
diff --git a/tests/keymaster/keymaster_test.cpp b/tests/keymaster/keymaster_test.cpp
index 6266d40..3040a5c 100644
--- a/tests/keymaster/keymaster_test.cpp
+++ b/tests/keymaster/keymaster_test.cpp
@@ -41,7 +41,7 @@
 
 class UniqueBlob : public UniquePtr<uint8_t[]> {
 public:
-    UniqueBlob(size_t length) :
+    explicit UniqueBlob(size_t length) :
             mLength(length) {
     }
 
