Merge "power: Adds a new power hint POWER_HINT_VR_MODE" into nyc-dev
am: bfa59e7

* commit 'bfa59e7fefab682c92fd0e8a2f25cc22b1252164':
  power: Adds a new power hint POWER_HINT_VR_MODE
diff --git a/include/hardware/bt_gatt_client.h b/include/hardware/bt_gatt_client.h
index 3462f51..2a473ce 100644
--- a/include/hardware/bt_gatt_client.h
+++ b/include/hardware/bt_gatt_client.h
@@ -137,23 +137,6 @@
  */
 typedef void (*search_complete_callback)(int conn_id, int status);
 
-/** Reports GATT services on a remote device */
-typedef void (*search_result_callback)( int conn_id, btgatt_srvc_id_t *srvc_id);
-
-/** GATT characteristic enumeration result callback */
-typedef void (*get_characteristic_callback)(int conn_id, int status,
-                btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *char_id,
-                int char_prop);
-
-/** GATT descriptor enumeration result callback */
-typedef void (*get_descriptor_callback)(int conn_id, int status,
-                btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *char_id,
-                btgatt_gatt_id_t *descr_id);
-
-/** GATT included service enumeration result callback */
-typedef void (*get_included_service_callback)(int conn_id, int status,
-                btgatt_srvc_id_t *srvc_id, btgatt_srvc_id_t *incl_srvc_id);
-
 /** Callback invoked in response to [de]register_for_notification */
 typedef void (*register_for_notification_callback)(int conn_id,
                 int registered, int status, btgatt_srvc_id_t *srvc_id,
@@ -260,10 +243,6 @@
     connect_callback                    open_cb;
     disconnect_callback                 close_cb;
     search_complete_callback            search_complete_cb;
-    search_result_callback              search_result_cb;
-    get_characteristic_callback         get_characteristic_cb;
-    get_descriptor_callback             get_descriptor_cb;
-    get_included_service_callback       get_included_service_cb;
     register_for_notification_callback  register_for_notification_cb;
     notify_callback                     notify_cb;
     read_characteristic_callback        read_characteristic_cb;
@@ -325,28 +304,6 @@
      */
     bt_status_t (*search_service)(int conn_id, bt_uuid_t *filter_uuid );
 
-    /**
-     * Enumerate included services for a given service.
-     * Set start_incl_srvc_id to NULL to get the first included service.
-     */
-    bt_status_t (*get_included_service)( int conn_id, btgatt_srvc_id_t *srvc_id,
-                                         btgatt_srvc_id_t *start_incl_srvc_id);
-
-    /**
-     * Enumerate characteristics for a given service.
-     * Set start_char_id to NULL to get the first characteristic.
-     */
-    bt_status_t (*get_characteristic)( int conn_id,
-                    btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *start_char_id);
-
-    /**
-     * Enumerate descriptors for a given characteristic.
-     * Set start_descr_id to NULL to get the first descriptor.
-     */
-    bt_status_t (*get_descriptor)( int conn_id,
-                    btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *char_id,
-                    btgatt_gatt_id_t *start_descr_id);
-
     /** Read a characteristic on a remote device */
     bt_status_t (*read_characteristic)( int conn_id,
                     btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *char_id,
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