diff --git a/Android.mk b/Android.mk
index 967a096..30b3337 100644
--- a/Android.mk
+++ b/Android.mk
@@ -1,6 +1,7 @@
 # Copyright 2006 The Android Open Source Project
 
 # Setting LOCAL_PATH will mess up all-subdir-makefiles, so do it beforehand.
+SUBDIR_MAKEFILES := $(call all-named-subdir-makefiles,modules tests)
 
 LOCAL_PATH:= $(call my-dir)
 include $(CLEAR_VARS)
@@ -31,8 +32,4 @@
 
 include $(BUILD_SHARED_LIBRARY)
 
-include $(addsuffix /Android.mk, $(addprefix $(LOCAL_PATH)/, \
-			modules/gralloc \
-			tests \
-		))
-		
\ No newline at end of file
+include $(SUBDIR_MAKEFILES)
diff --git a/hardware.c b/hardware.c
index d2e3b4c..2559237 100644
--- a/hardware.c
+++ b/hardware.c
@@ -117,13 +117,20 @@
     return status;
 }
 
-int hw_get_module(const char *id, const struct hw_module_t **module) 
+int hw_get_module_by_class(const char *class_id, const char *inst,
+                           const struct hw_module_t **module)
 {
     int status;
     int i;
     const struct hw_module_t *hmi = NULL;
     char prop[PATH_MAX];
     char path[PATH_MAX];
+    char name[PATH_MAX];
+
+    if (inst)
+        snprintf(name, PATH_MAX, "%s.%s", class_id, inst);
+    else
+        strlcpy(name, class_id, PATH_MAX);
 
     /*
      * Here we rely on the fact that calling dlopen multiple times on
@@ -139,15 +146,15 @@
                 continue;
             }
             snprintf(path, sizeof(path), "%s/%s.%s.so",
-                    HAL_LIBRARY_PATH1, id, prop);
+                    HAL_LIBRARY_PATH1, name, prop);
             if (access(path, R_OK) == 0) break;
 
             snprintf(path, sizeof(path), "%s/%s.%s.so",
-                     HAL_LIBRARY_PATH2, id, prop);
+                     HAL_LIBRARY_PATH2, name, prop);
             if (access(path, R_OK) == 0) break;
         } else {
             snprintf(path, sizeof(path), "%s/%s.default.so",
-                     HAL_LIBRARY_PATH1, id);
+                     HAL_LIBRARY_PATH1, name);
             if (access(path, R_OK) == 0) break;
         }
     }
@@ -156,8 +163,13 @@
     if (i < HAL_VARIANT_KEYS_COUNT+1) {
         /* load the module, if this fails, we're doomed, and we should not try
          * to load a different variant. */
-        status = load(id, path, module);
+        status = load(class_id, path, module);
     }
 
     return status;
 }
+
+int hw_get_module(const char *id, const struct hw_module_t **module)
+{
+    return hw_get_module_by_class(id, NULL, module);
+}
diff --git a/include/hardware/audio_hal.h b/include/hardware/audio_hal.h
new file mode 100644
index 0000000..c105370
--- /dev/null
+++ b/include/hardware/audio_hal.h
@@ -0,0 +1,298 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+
+#ifndef ANDROID_AUDIO_HAL_INTERFACE_H
+#define ANDROID_AUDIO_HAL_INTERFACE_H
+
+#include <stdint.h>
+#include <strings.h>
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+#include <cutils/bitops.h>
+
+#include <hardware/hardware.h>
+#include <system/audio.h>
+
+__BEGIN_DECLS
+
+/**
+ * The id of this module
+ */
+#define AUDIO_HARDWARE_MODULE_ID "audio"
+
+/**
+ * Name of the audio devices to open
+ */
+#define AUDIO_HARDWARE_INTERFACE "audio_hw_if"
+
+/**************************************/
+
+/* common audio stream parameters and operations */
+struct audio_stream {
+
+    /**
+     * sampling rate is in Hz - eg. 44100
+     */
+    uint32_t (*get_sample_rate)(const struct audio_stream *stream);
+    int (*set_sample_rate)(struct audio_stream *stream, uint32_t rate);
+
+    /**
+     * size of output buffer in bytes - eg. 4800
+     */
+    size_t (*get_buffer_size)(const struct audio_stream *stream);
+
+    /**
+     * the channel mask -
+     *  e.g. AUDIO_CHANNEL_OUT_STEREO or AUDIO_CHANNEL_IN_STEREO
+     */
+    uint32_t (*get_channels)(const struct audio_stream *stream);
+
+    /**
+     * audio format - eg. AUDIO_FORMAT_PCM_16_BIT
+     */
+    int (*get_format)(const struct audio_stream *stream);
+    int (*set_format)(struct audio_stream *stream, int format);
+
+    /**
+     * Put the audio hardware input/output into standby mode.
+     * Returns 0 on success and <0 on failure.
+     */
+    int (*standby)(struct audio_stream *stream);
+
+    /** dump the state of the audio input/output device */
+    int (*dump)(const struct audio_stream *stream, int fd);
+
+    audio_devices_t (*get_device)(const struct audio_stream *stream);
+    int (*set_device)(struct audio_stream *stream, audio_devices_t device);
+
+    /**
+     * set/get audio stream parameters. The function accepts a list of
+     * parameter key value pairs in the form: key1=value1;key2=value2;...
+     *
+     * Some keys are reserved for standard parameters (See AudioParameter class)
+     *
+     * If the implementation does not accept a parameter change while
+     * the output is active but the parameter is acceptable otherwise, it must
+     * return -ENOSYS.
+     *
+     * The audio flinger will put the stream in standby and then change the
+     * parameter value.
+     */
+    int (*set_parameters)(struct audio_stream *stream, const char *kv_pairs);
+
+    /*
+     * Returns a pointer to a heap allocated string. The caller is responsible
+     * for freeing the memory for it.
+     */
+    char * (*get_parameters)(const struct audio_stream *stream,
+                             const char *keys);
+};
+typedef struct audio_stream audio_stream_t;
+
+/**
+ * audio_stream_out is the abstraction interface for the audio output hardware.
+ *
+ * It provides information about various properties of the audio output
+ * hardware driver.
+ */
+
+struct audio_stream_out {
+    struct audio_stream common;
+
+    /**
+     * return the audio hardware driver latency in milli seconds.
+     */
+    uint32_t (*get_latency)(const struct audio_stream_out *stream);
+
+    /**
+     * Use this method in situations where audio mixing is done in the
+     * hardware. This method serves as a direct interface with hardware,
+     * allowing you to directly set the volume as apposed to via the framework.
+     * This method might produce multiple PCM outputs or hardware accelerated
+     * codecs, such as MP3 or AAC.
+     */
+    int (*set_volume)(struct audio_stream_out *stream, float left, float right);
+
+    /**
+     * write audio buffer to driver. Returns number of bytes written
+     */
+    ssize_t (*write)(struct audio_stream_out *stream, const void* buffer,
+                     size_t bytes);
+
+    /* return the number of audio frames written by the audio dsp to DAC since
+     * the output has exited standby
+     */
+    int (*get_render_position)(const struct audio_stream_out *stream,
+                               uint32_t *dsp_frames);
+};
+typedef struct audio_stream_out audio_stream_out_t;
+
+struct audio_stream_in {
+    struct audio_stream common;
+
+    /** set the input gain for the audio driver. This method is for
+     *  for future use */
+    int (*set_gain)(struct audio_stream_in *stream, float gain);
+
+    /** read audio buffer in from audio driver */
+    ssize_t (*read)(struct audio_stream_in *stream, void* buffer,
+                    size_t bytes);
+
+    /**
+     * Return the amount of input frames lost in the audio driver since the
+     * last call of this function.
+     * Audio driver is expected to reset the value to 0 and restart counting
+     * upon returning the current value by this function call.
+     * Such loss typically occurs when the user space process is blocked
+     * longer than the capacity of audio driver buffers.
+     *
+     * Unit: the number of input audio frames
+     */
+    uint32_t (*get_input_frames_lost)(struct audio_stream_in *stream);
+};
+typedef struct audio_stream_in audio_stream_in_t;
+
+/**
+ * return the frame size (number of bytes per sample).
+ */
+static inline uint32_t audio_stream_frame_size(struct audio_stream *s)
+{
+    int chan_samp_sz;
+
+    switch (s->get_format(s)) {
+    case AUDIO_FORMAT_PCM_16_BIT:
+        chan_samp_sz = sizeof(int16_t);
+        break;
+    case AUDIO_FORMAT_PCM_8_BIT:
+    default:
+        chan_samp_sz = sizeof(int8_t);
+        break;
+    }
+
+    return popcount(s->get_channels(s)) * chan_samp_sz;
+}
+
+
+/**********************************************************************/
+
+/**
+ * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM
+ * and the fields of this data structure must begin with hw_module_t
+ * followed by module specific information.
+ */
+struct audio_module {
+    struct hw_module_t common;
+};
+
+struct audio_hw_device {
+    struct hw_device_t common;
+
+    /**
+     * used by audio flinger to enumerate what devices are supported by
+     * each audio_hw_device implementation.
+     *
+     * Return value is a bitmask of 1 or more values of audio_devices_t
+     */
+    uint32_t (*get_supported_devices)(const struct audio_hw_device *dev);
+
+    /**
+     * check to see if the audio hardware interface has been initialized.
+     * returns 0 on success, -ENODEV on failure.
+     */
+    int (*init_check)(const struct audio_hw_device *dev);
+
+    /** set the audio volume of a voice call. Range is between 0.0 and 1.0 */
+    int (*set_voice_volume)(struct audio_hw_device *dev, float volume);
+
+    /**
+     * set the audio volume for all audio activities other than voice call.
+     * Range between 0.0 and 1.0. If any value other than 0 is returned,
+     * the software mixer will emulate this capability.
+     */
+    int (*set_master_volume)(struct audio_hw_device *dev, float volume);
+
+    /**
+     * setMode is called when the audio mode changes. AUDIO_MODE_NORMAL mode
+     * is for standard audio playback, AUDIO_MODE_RINGTONE when a ringtone is
+     * playing, and AUDIO_MODE_IN_CALL when a call is in progress.
+     */
+    int (*set_mode)(struct audio_hw_device *dev, int mode);
+
+    /* mic mute */
+    int (*set_mic_mute)(struct audio_hw_device *dev, bool state);
+    int (*get_mic_mute)(const struct audio_hw_device *dev, bool *state);
+
+    /* set/get global audio parameters */
+    int (*set_parameters)(struct audio_hw_device *dev, const char *kv_pairs);
+
+    /*
+     * Returns a pointer to a heap allocated string. The caller is responsible
+     * for freeing the memory for it.
+     */
+    char * (*get_parameters)(const struct audio_hw_device *dev,
+                             const char *keys);
+
+    /* Returns audio input buffer size according to parameters passed or
+     * 0 if one of the parameters is not supported
+     */
+    size_t (*get_input_buffer_size)(const struct audio_hw_device *dev,
+                                    uint32_t sample_rate, int format,
+                                    int channel_count);
+
+    /** This method creates and opens the audio hardware output stream */
+    int (*open_output_stream)(struct audio_hw_device *dev, uint32_t devices,
+                              int *format, uint32_t *channels,
+                              uint32_t *sample_rate,
+                              struct audio_stream_out **out);
+
+    void (*close_output_stream)(struct audio_hw_device *dev,
+                                struct audio_stream_out* out);
+
+    /** This method creates and opens the audio hardware input stream */
+    int (*open_input_stream)(struct audio_hw_device *dev, uint32_t devices,
+                             int *format, uint32_t *channels,
+                             uint32_t *sample_rate,
+                             audio_in_acoustics_t acoustics,
+                             struct audio_stream_in **stream_in);
+
+    void (*close_input_stream)(struct audio_hw_device *dev,
+                               struct audio_stream_in *in);
+
+    /** This method dumps the state of the audio hardware */
+    int (*dump)(const struct audio_hw_device *dev, int fd);
+};
+typedef struct audio_hw_device audio_hw_device_t;
+
+/** convenience API for opening and closing a supported device */
+
+static inline int audio_hw_device_open(const struct hw_module_t* module,
+                                       struct audio_hw_device** device)
+{
+    return module->methods->open(module, AUDIO_HARDWARE_INTERFACE,
+                                 (struct hw_device_t**)device);
+}
+
+static inline int audio_hw_device_close(struct audio_hw_device* device)
+{
+    return device->common.close(&device->common);
+}
+
+
+__END_DECLS
+
+#endif  // ANDROID_AUDIO_INTERFACE_H
diff --git a/include/hardware/audio_policy.h b/include/hardware/audio_policy.h
new file mode 100644
index 0000000..1e0af7d
--- /dev/null
+++ b/include/hardware/audio_policy.h
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+
+#ifndef ANDROID_AUDIO_POLICY_CORE_H
+#define ANDROID_AUDIO_POLICY_CORE_H
+
+#include <stdint.h>
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+#include <cutils/bitops.h>
+
+__BEGIN_DECLS
+
+/* The enums were moved here mostly from
+ * frameworks/base/include/media/AudioSystem.h
+ */
+
+/* request to open a direct output with get_output() (by opposition to
+ * sharing an output with other AudioTracks)
+ */
+typedef enum {
+    AUDIO_POLICY_OUTPUT_FLAG_INDIRECT = 0x0,
+    AUDIO_POLICY_OUTPUT_FLAG_DIRECT = 0x1
+} audio_policy_output_flags_t;
+
+/* device categories used for audio_policy->set_force_use() */
+typedef enum {
+    AUDIO_POLICY_FORCE_NONE,
+    AUDIO_POLICY_FORCE_SPEAKER,
+    AUDIO_POLICY_FORCE_HEADPHONES,
+    AUDIO_POLICY_FORCE_BT_SCO,
+    AUDIO_POLICY_FORCE_BT_A2DP,
+    AUDIO_POLICY_FORCE_WIRED_ACCESSORY,
+    AUDIO_POLICY_FORCE_BT_CAR_DOCK,
+    AUDIO_POLICY_FORCE_BT_DESK_DOCK,
+    AUDIO_POLICY_FORCE_ANALOG_DOCK,
+    AUDIO_POLICY_FORCE_DIGITAL_DOCK,
+
+    AUDIO_POLICY_FORCE_CFG_CNT,
+    AUDIO_POLICY_FORCE_CFG_MAX = AUDIO_POLICY_FORCE_CFG_CNT - 1,
+
+    AUDIO_POLICY_FORCE_DEFAULT = AUDIO_POLICY_FORCE_NONE,
+} audio_policy_forced_cfg_t;
+
+/* usages used for audio_policy->set_force_use() */
+typedef enum {
+    AUDIO_POLICY_FORCE_FOR_COMMUNICATION,
+    AUDIO_POLICY_FORCE_FOR_MEDIA,
+    AUDIO_POLICY_FORCE_FOR_RECORD,
+    AUDIO_POLICY_FORCE_FOR_DOCK,
+
+    AUDIO_POLICY_FORCE_USE_CNT,
+    AUDIO_POLICY_FORCE_USE_MAX = AUDIO_POLICY_FORCE_USE_CNT - 1,
+} audio_policy_force_use_t;
+
+/* device connection states used for audio_policy->set_device_connection_state()
+ */
+typedef enum {
+    AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE,
+    AUDIO_POLICY_DEVICE_STATE_AVAILABLE,
+
+    AUDIO_POLICY_DEVICE_STATE_CNT,
+    AUDIO_POLICY_DEVICE_STATE_MAX = AUDIO_POLICY_DEVICE_STATE_CNT - 1,
+} audio_policy_dev_state_t;
+
+typedef enum {
+    /* Used to generate a tone to notify the user of a
+     * notification/alarm/ringtone while they are in a call. */
+    AUDIO_POLICY_TONE_IN_CALL_NOTIFICATION = 0,
+
+    AUDIO_POLICY_TONE_CNT,
+    AUDIO_POLICY_TONE_MAX                  = AUDIO_POLICY_TONE_CNT - 1,
+} audio_policy_tone_t;
+
+
+static inline bool audio_is_low_visibility(audio_stream_type_t stream)
+{
+    switch (stream) {
+    case AUDIO_STREAM_SYSTEM:
+    case AUDIO_STREAM_NOTIFICATION:
+    case AUDIO_STREAM_RING:
+        return true;
+    default:
+        return false;
+    }
+}
+
+
+__END_DECLS
+
+#endif  // ANDROID_AUDIO_POLICY_CORE_H
diff --git a/include/hardware/audio_policy_hal.h b/include/hardware/audio_policy_hal.h
new file mode 100644
index 0000000..bf226d9
--- /dev/null
+++ b/include/hardware/audio_policy_hal.h
@@ -0,0 +1,384 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+
+#ifndef ANDROID_AUDIO_POLICY_INTERFACE_H
+#define ANDROID_AUDIO_POLICY_INTERFACE_H
+
+#include <stdint.h>
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+#include <hardware/hardware.h>
+
+#include <system/audio.h>
+#include <hardware/audio_policy.h>
+
+__BEGIN_DECLS
+
+/**
+ * The id of this module
+ */
+#define AUDIO_POLICY_HARDWARE_MODULE_ID "audio_policy"
+
+/**
+ * Name of the audio devices to open
+ */
+#define AUDIO_POLICY_INTERFACE "policy"
+
+/* ---------------------------------------------------------------------------- */
+
+/*
+ * The audio_policy and audio_policy_service_ops structs define the
+ * communication interfaces between the platform specific audio policy manager
+ * and Android generic audio policy manager.
+ * The platform specific audio policy manager must implement methods of the
+ * audio_policy struct.
+ * This implementation makes use of the audio_policy_service_ops to control
+ * the activity and configuration of audio input and output streams.
+ *
+ * The platform specific audio policy manager is in charge of the audio
+ * routing and volume control policies for a given platform.
+ * The main roles of this module are:
+ *   - keep track of current system state (removable device connections, phone
+ *     state, user requests...).
+ *   System state changes and user actions are notified to audio policy
+ *   manager with methods of the audio_policy.
+ *
+ *   - process get_output() queries received when AudioTrack objects are
+ *     created: Those queries return a handler on an output that has been
+ *     selected, configured and opened by the audio policy manager and that
+ *     must be used by the AudioTrack when registering to the AudioFlinger
+ *     with the createTrack() method.
+ *   When the AudioTrack object is released, a release_output() query
+ *   is received and the audio policy manager can decide to close or
+ *   reconfigure the output depending on other streams using this output and
+ *   current system state.
+ *
+ *   - similarly process get_input() and release_input() queries received from
+ *     AudioRecord objects and configure audio inputs.
+ *   - process volume control requests: the stream volume is converted from
+ *     an index value (received from UI) to a float value applicable to each
+ *     output as a function of platform specific settings and current output
+ *     route (destination device). It also make sure that streams are not
+ *     muted if not allowed (e.g. camera shutter sound in some countries).
+ */
+
+/* XXX: this should be defined OUTSIDE of frameworks/base */
+struct effect_descriptor_s;
+
+struct audio_policy {
+    /*
+     * configuration functions
+     */
+
+    /* indicate a change in device connection status */
+    int (*set_device_connection_state)(struct audio_policy *pol,
+                                       audio_devices_t device,
+                                       audio_policy_dev_state_t state,
+                                       const char *device_address);
+
+    /* retreive a device connection status */
+    audio_policy_dev_state_t (*get_device_connection_state)(
+                                            const struct audio_policy *pol,
+                                            audio_devices_t device,
+                                            const char *device_address);
+
+    /* indicate a change in phone state. Valid phones states are defined
+     * by audio_mode_t */
+    void (*set_phone_state)(struct audio_policy *pol, int state);
+
+    /* indicate a change in ringer mode */
+    void (*set_ringer_mode)(struct audio_policy *pol, uint32_t mode,
+                            uint32_t mask);
+
+    /* force using a specific device category for the specified usage */
+    void (*set_force_use)(struct audio_policy *pol,
+                          audio_policy_force_use_t usage,
+                          audio_policy_forced_cfg_t config);
+
+    /* retreive current device category forced for a given usage */
+    audio_policy_forced_cfg_t (*get_force_use)(const struct audio_policy *pol,
+                                               audio_policy_force_use_t usage);
+
+    /* if can_mute is true, then audio streams that are marked ENFORCED_AUDIBLE
+     * can still be muted. */
+    void (*set_can_mute_enforced_audible)(struct audio_policy *pol,
+                                          bool can_mute);
+
+    /* check proper initialization */
+    int (*init_check)(const struct audio_policy *pol);
+
+    /*
+     * Audio routing query functions
+     */
+
+    /* request an output appriate for playback of the supplied stream type and
+     * parameters */
+    audio_io_handle_t (*get_output)(struct audio_policy *pol,
+                                    audio_stream_type_t stream,
+                                    uint32_t samplingRate,
+                                    uint32_t format,
+                                    uint32_t channels,
+                                    audio_policy_output_flags_t flags);
+
+    /* indicates to the audio policy manager that the output starts being used
+     * by corresponding stream. */
+    int (*start_output)(struct audio_policy *pol,
+                        audio_io_handle_t output,
+                        audio_stream_type_t stream,
+                        int session);
+
+    /* indicates to the audio policy manager that the output stops being used
+     * by corresponding stream. */
+    int (*stop_output)(struct audio_policy *pol,
+                       audio_io_handle_t output,
+                       audio_stream_type_t stream,
+                       int session);
+
+    /* releases the output. */
+    void (*release_output)(struct audio_policy *pol, audio_io_handle_t output);
+
+    /* request an input appriate for record from the supplied device with
+     * supplied parameters. */
+    audio_io_handle_t (*get_input)(struct audio_policy *pol, int inputSource,
+                                   uint32_t samplingRate,
+                                   uint32_t format,
+                                   uint32_t channels,
+                                   audio_in_acoustics_t acoustics);
+
+    /* indicates to the audio policy manager that the input starts being used */
+    int (*start_input)(struct audio_policy *pol, audio_io_handle_t input);
+
+    /* indicates to the audio policy manager that the input stops being used. */
+    int (*stop_input)(struct audio_policy *pol, audio_io_handle_t input);
+
+    /* releases the input. */
+    void (*release_input)(struct audio_policy *pol, audio_io_handle_t input);
+
+    /*
+     * volume control functions
+     */
+
+    /* initialises stream volume conversion parameters by specifying volume
+     * index range. */
+    void (*init_stream_volume)(struct audio_policy *pol,
+                               audio_stream_type_t stream,
+                               int index_min,
+                               int index_max);
+
+    /* sets the new stream volume at a level corresponding to the supplied
+     * index */
+    int (*set_stream_volume_index)(struct audio_policy *pol,
+                                   audio_stream_type_t stream,
+                                   int index);
+
+    /* retreive current volume index for the specified stream */
+    int (*get_stream_volume_index)(const struct audio_policy *pol,
+                                   audio_stream_type_t stream,
+                                   int *index);
+
+    /* return the strategy corresponding to a given stream type */
+    uint32_t (*get_strategy_for_stream)(const struct audio_policy *pol,
+                                        audio_stream_type_t stream);
+
+    /* return the enabled output devices for the given stream type */
+    uint32_t (*get_devices_for_stream)(const struct audio_policy *pol,
+                                       audio_stream_type_t stream);
+
+    /* Audio effect management */
+    audio_io_handle_t (*get_output_for_effect)(struct audio_policy *pol,
+                                            struct effect_descriptor_s *desc);
+
+    int (*register_effect)(struct audio_policy *pol,
+                           struct effect_descriptor_s *desc,
+                           audio_io_handle_t output,
+                           uint32_t strategy,
+                           int session,
+                           int id);
+
+    int (*unregister_effect)(struct audio_policy *pol, int id);
+
+    bool (*is_stream_active)(const struct audio_policy *pol,
+                             int stream,
+                             uint32_t in_past_ms);
+
+    /* dump state */
+    int (*dump)(const struct audio_policy *pol, int fd);
+};
+
+struct audio_policy_service_ops {
+    /*
+     * Audio output Control functions
+     */
+
+    /* Opens an audio output with the requested parameters.
+     *
+     * The parameter values can indicate to use the default values in case the
+     * audio policy manager has no specific requirements for the output being
+     * opened.
+     *
+     * When the function returns, the parameter values reflect the actual
+     * values used by the audio hardware output stream.
+     *
+     * The audio policy manager can check if the proposed parameters are
+     * suitable or not and act accordingly.
+     */
+    audio_io_handle_t (*open_output)(void *service,
+                                     uint32_t *pDevices,
+                                     uint32_t *pSamplingRate,
+                                     uint32_t *pFormat,
+                                     uint32_t *pChannels,
+                                     uint32_t *pLatencyMs,
+                                     audio_policy_output_flags_t flags);
+
+    /* creates a special output that is duplicated to the two outputs passed as
+     * arguments. The duplication is performed by
+     * a special mixer thread in the AudioFlinger.
+     */
+    audio_io_handle_t (*open_duplicate_output)(void *service,
+                                               audio_io_handle_t output1,
+                                               audio_io_handle_t output2);
+
+    /* closes the output stream */
+    int (*close_output)(void *service, audio_io_handle_t output);
+
+    /* suspends the output.
+     *
+     * When an output is suspended, the corresponding audio hardware output
+     * stream is placed in standby and the AudioTracks attached to the mixer
+     * thread are still processed but the output mix is discarded.
+     */
+    int (*suspend_output)(void *service, audio_io_handle_t output);
+
+    /* restores a suspended output. */
+    int (*restore_output)(void *service, audio_io_handle_t output);
+
+    /* */
+    /* Audio input Control functions */
+    /* */
+
+    /* opens an audio input */
+    audio_io_handle_t (*open_input)(void *service,
+                                    uint32_t *pDevices,
+                                    uint32_t *pSamplingRate,
+                                    uint32_t *pFormat,
+                                    uint32_t *pChannels,
+                                    uint32_t acoustics);
+
+    /* closes an audio input */
+    int (*close_input)(void *service, audio_io_handle_t input);
+
+    /* */
+    /* misc control functions */
+    /* */
+
+    /* set a stream volume for a particular output.
+     *
+     * For the same user setting, a given stream type can have different
+     * volumes for each output (destination device) it is attached to.
+     */
+    int (*set_stream_volume)(void *service,
+                             audio_stream_type_t stream,
+                             float volume,
+                             audio_io_handle_t output,
+                             int delay_ms);
+
+    /* reroute a given stream type to the specified output */
+    int (*set_stream_output)(void *service,
+                             audio_stream_type_t stream,
+                             audio_io_handle_t output);
+
+    /* function enabling to send proprietary informations directly from audio
+     * policy manager to audio hardware interface. */
+    void (*set_parameters)(void *service,
+                           audio_io_handle_t io_handle,
+                           const char *kv_pairs,
+                           int delay_ms);
+
+    /* function enabling to receive proprietary informations directly from
+     * audio hardware interface to audio policy manager.
+     *
+     * Returns a pointer to a heap allocated string. The caller is responsible
+     * for freeing the memory for it.
+     */
+
+    char * (*get_parameters)(void *service, audio_io_handle_t io_handle,
+                             const char *keys);
+
+    /* request the playback of a tone on the specified stream.
+     * used for instance to replace notification sounds when playing over a
+     * telephony device during a phone call.
+     */
+    int (*start_tone)(void *service,
+                      audio_policy_tone_t tone,
+                      audio_stream_type_t stream);
+
+    int (*stop_tone)(void *service);
+
+    /* set down link audio volume. */
+    int (*set_voice_volume)(void *service,
+                            float volume,
+                            int delay_ms);
+
+    /* move effect to the specified output */
+    int (*move_effects)(void *service,
+                        int session,
+                        audio_io_handle_t src_output,
+                        audio_io_handle_t dst_output);
+};
+
+/**********************************************************************/
+
+/**
+ * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM
+ * and the fields of this data structure must begin with hw_module_t
+ * followed by module specific information.
+ */
+typedef struct audio_policy_module {
+    struct hw_module_t common;
+} audio_policy_module_t;
+
+struct audio_policy_device {
+    struct hw_device_t common;
+
+    int (*create_audio_policy)(const struct audio_policy_device *device,
+                               struct audio_policy_service_ops *aps_ops,
+                               void *service,
+                               struct audio_policy **ap);
+
+    int (*destroy_audio_policy)(const struct audio_policy_device *device,
+                                struct audio_policy *ap);
+};
+
+/** convenience API for opening and closing a supported device */
+
+static inline int audio_policy_dev_open(const hw_module_t* module,
+                                    struct audio_policy_device** device)
+{
+    return module->methods->open(module, AUDIO_POLICY_INTERFACE,
+                                 (hw_device_t**)device);
+}
+
+static inline int audio_policy_dev_close(struct audio_policy_device* device)
+{
+    return device->common.close(&device->common);
+}
+
+
+__END_DECLS
+
+#endif  // ANDROID_AUDIO_POLICY_INTERFACE_H
diff --git a/include/hardware/camera.h b/include/hardware/camera.h
new file mode 100644
index 0000000..04fb6ec
--- /dev/null
+++ b/include/hardware/camera.h
@@ -0,0 +1,293 @@
+/*
+ * Copyright (C) 2010-2011 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.
+ */
+
+// FIXME: add well-defined names for cameras
+
+#ifndef ANDROID_INCLUDE_CAMERA_H
+#define ANDROID_INCLUDE_CAMERA_H
+
+#include <stdint.h>
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <cutils/native_handle.h>
+#include <system/camera.h>
+#include <hardware/hardware.h>
+#include <hardware/gralloc.h>
+
+__BEGIN_DECLS
+
+/**
+ * The id of this module
+ */
+#define CAMERA_HARDWARE_MODULE_ID "camera"
+
+struct camera_info {
+    /**
+     * The direction that the camera faces to. It should be CAMERA_FACING_BACK
+     * or CAMERA_FACING_FRONT.
+     */
+    int facing;
+
+    /**
+     * The orientation of the camera image. The value is the angle that the
+     * camera image needs to be rotated clockwise so it shows correctly on the
+     * display in its natural orientation. It should be 0, 90, 180, or 270.
+     *
+     * For example, suppose a device has a naturally tall screen. The
+     * back-facing camera sensor is mounted in landscape. You are looking at
+     * the screen. If the top side of the camera sensor is aligned with the
+     * right edge of the screen in natural orientation, the value should be
+     * 90. If the top side of a front-facing camera sensor is aligned with the
+     * right of the screen, the value should be 270.
+     */
+    int orientation;
+};
+
+typedef struct camera_module {
+    hw_module_t common;
+    int (*get_number_of_cameras)(void);
+    int (*get_camera_info)(int camera_id, struct camera_info *info);
+} camera_module_t;
+
+typedef struct camera_memory {
+    void *data;
+    size_t size;
+    void *handle;
+} camera_memory_t;
+
+typedef camera_memory_t* (*camera_request_memory)(size_t size, void *user);
+
+typedef void (*camera_notify_callback)(int32_t msg_type,
+        int32_t ext1,
+        int32_t ext2,
+        void *user);
+
+typedef void (*camera_data_callback)(int32_t msg_type,
+        const camera_memory_t *data,
+        void *user);
+
+typedef void (*camera_data_timestamp_callback)(int64_t timestamp,
+        int32_t msg_type,
+        const camera_memory_t *data,
+        void *user);
+
+#define HAL_CAMERA_PREVIEW_WINDOW_TAG 0xcafed00d
+
+typedef struct preview_stream_ops {
+    int (*dequeue_buffer)(struct preview_stream_ops* w,
+                buffer_handle_t** buffer);
+    int (*enqueue_buffer)(struct preview_stream_ops* w,
+                buffer_handle_t* buffer);
+    int (*cancel_buffer)(struct preview_stream_ops* w,
+                buffer_handle_t* buffer);
+    int (*set_buffer_count)(struct preview_stream_ops* w, int count);
+    int (*set_buffers_geometry)(struct preview_stream_ops* pw,
+                int w, int h, int format);
+    int (*set_crop)(struct preview_stream_ops *w,
+                int left, int top, int right, int bottom);
+    int (*set_usage)(struct preview_stream_ops* w, int usage);
+    int (*set_swap_interval)(struct preview_stream_ops *w, int interval);
+
+    int (*get_min_undequeued_buffer_count)(const struct preview_stream_ops *w,
+                int *count);
+} preview_stream_ops_t;
+
+struct camera_device;
+typedef struct camera_device_ops {
+    /** Set the ANativeWindow to which preview frames are sent */
+    int (*set_preview_window)(struct camera_device *,
+            struct preview_stream_ops *window);
+
+    /** Set the notification and data callbacks */
+    void (*set_callbacks)(struct camera_device *,
+            camera_notify_callback notify_cb,
+            camera_data_callback data_cb,
+            camera_data_timestamp_callback data_cb_timestamp,
+            camera_request_memory get_memory,
+            void *user);
+
+    /**
+     * The following three functions all take a msg_type, which is a bitmask of
+     * the messages defined in include/ui/Camera.h
+     */
+
+    /**
+     * Enable a message, or set of messages.
+     */
+    void (*enable_msg_type)(struct camera_device *, int32_t msg_type);
+
+    /**
+     * Disable a message, or a set of messages.
+     *
+     * Once received a call to disableMsgType(CAMERA_MSG_VIDEO_FRAME), camera
+     * HAL should not rely on its client to call releaseRecordingFrame() to
+     * release video recording frames sent out by the cameral HAL before and
+     * after the disableMsgType(CAMERA_MSG_VIDEO_FRAME) call. Camera HAL
+     * clients must not modify/access any video recording frame after calling
+     * disableMsgType(CAMERA_MSG_VIDEO_FRAME).
+     */
+    void (*disable_msg_type)(struct camera_device *, int32_t msg_type);
+
+    /**
+     * Query whether a message, or a set of messages, is enabled.  Note that
+     * this is operates as an AND, if any of the messages queried are off, this
+     * will return false.
+     */
+    int (*msg_type_enabled)(struct camera_device *, int32_t msg_type);
+
+    /**
+     * Start preview mode.
+     */
+    int (*start_preview)(struct camera_device *);
+
+    /**
+     * Stop a previously started preview.
+     */
+    void (*stop_preview)(struct camera_device *);
+
+    /**
+     * Returns true if preview is enabled.
+     */
+    int (*preview_enabled)(struct camera_device *);
+
+    /**
+     * Request the camera HAL to store meta data or real YUV data in the video
+     * buffers sent out via CAMERA_MSG_VIDEO_FRAME for a recording session. If
+     * it is not called, the default camera HAL behavior is to store real YUV
+     * data in the video buffers.
+     *
+     * This method should be called before startRecording() in order to be
+     * effective.
+     *
+     * If meta data is stored in the video buffers, it is up to the receiver of
+     * the video buffers to interpret the contents and to find the actual frame
+     * data with the help of the meta data in the buffer. How this is done is
+     * outside of the scope of this method.
+     *
+     * Some camera HALs may not support storing meta data in the video buffers,
+     * but all camera HALs should support storing real YUV data in the video
+     * buffers. If the camera HAL does not support storing the meta data in the
+     * video buffers when it is requested to do do, INVALID_OPERATION must be
+     * returned. It is very useful for the camera HAL to pass meta data rather
+     * than the actual frame data directly to the video encoder, since the
+     * amount of the uncompressed frame data can be very large if video size is
+     * large.
+     *
+     * @param enable if true to instruct the camera HAL to store
+     *        meta data in the video buffers; false to instruct
+     *        the camera HAL to store real YUV data in the video
+     *        buffers.
+     *
+     * @return OK on success.
+     */
+    int (*store_meta_data_in_buffers)(struct camera_device *, int enable);
+
+    /**
+     * Start record mode. When a record image is available, a
+     * CAMERA_MSG_VIDEO_FRAME message is sent with the corresponding
+     * frame. Every record frame must be released by a camera HAL client via
+     * releaseRecordingFrame() before the client calls
+     * disableMsgType(CAMERA_MSG_VIDEO_FRAME). After the client calls
+     * disableMsgType(CAMERA_MSG_VIDEO_FRAME), it is the camera HAL's
+     * responsibility to manage the life-cycle of the video recording frames,
+     * and the client must not modify/access any video recording frames.
+     */
+    int (*start_recording)(struct camera_device *);
+
+    /**
+     * Stop a previously started recording.
+     */
+    void (*stop_recording)(struct camera_device *);
+
+    /**
+     * Returns true if recording is enabled.
+     */
+    int (*recording_enabled)(struct camera_device *);
+
+    /**
+     * Release a record frame previously returned by CAMERA_MSG_VIDEO_FRAME.
+     *
+     * It is camera HAL client's responsibility to release video recording
+     * frames sent out by the camera HAL before the camera HAL receives a call
+     * to disableMsgType(CAMERA_MSG_VIDEO_FRAME). After it receives the call to
+     * disableMsgType(CAMERA_MSG_VIDEO_FRAME), it is the camera HAL's
+     * responsibility to manage the life-cycle of the video recording frames.
+     */
+    void (*release_recording_frame)(struct camera_device *,
+                    const void *opaque);
+
+    /**
+     * Start auto focus, the notification callback routine is called with
+     * CAMERA_MSG_FOCUS once when focusing is complete. autoFocus() will be
+     * called again if another auto focus is needed.
+     */
+    int (*auto_focus)(struct camera_device *);
+
+    /**
+     * Cancels auto-focus function. If the auto-focus is still in progress,
+     * this function will cancel it. Whether the auto-focus is in progress or
+     * not, this function will return the focus position to the default.  If
+     * the camera does not support auto-focus, this is a no-op.
+     */
+    int (*cancel_auto_focus)(struct camera_device *);
+
+    /**
+     * Take a picture.
+     */
+    int (*take_picture)(struct camera_device *);
+
+    /**
+     * Cancel a picture that was started with takePicture. Calling this method
+     * when no picture is being taken is a no-op.
+     */
+    int (*cancel_picture)(struct camera_device *);
+
+    /**
+     * Set the camera parameters. This returns BAD_VALUE if any parameter is
+     * invalid or not supported.
+     */
+    int (*set_parameters)(struct camera_device *, const char *parms);
+
+    /** Return the camera parameters. */
+    char *(*get_parameters)(struct camera_device *);
+
+    /**
+     * Send command to camera driver.
+     */
+    int (*send_command)(struct camera_device *,
+                int32_t cmd, int32_t arg1, int32_t arg2);
+
+    /**
+     * Release the hardware resources owned by this object.  Note that this is
+     * *not* done in the destructor.
+     */
+    void (*release)(struct camera_device *);
+
+    /**
+     * Dump state of the camera hardware
+     */
+    int (*dump)(struct camera_device *, int fd);
+} camera_device_ops_t;
+
+typedef struct camera_device {
+    hw_device_t common;
+    camera_device_ops_t *ops;
+    void *priv;
+} camera_device_t;
+
+__END_DECLS
+
+#endif /* ANDROID_INCLUDE_CAMERA_H */
diff --git a/include/hardware/copybit.h b/include/hardware/copybit.h
deleted file mode 100644
index b6302c3..0000000
--- a/include/hardware/copybit.h
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * Copyright (C) 2008 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.
- */
-
-#ifndef ANDROID_COPYBIT_INTERFACE_H
-#define ANDROID_COPYBIT_INTERFACE_H
-
-#include <hardware/hardware.h>
-
-#include <stdint.h>
-#include <sys/cdefs.h>
-#include <sys/types.h>
-
-__BEGIN_DECLS
-
-/**
- * The id of this module
- */
-#define COPYBIT_HARDWARE_MODULE_ID "copybit"
-
-/**
- * Name of the graphics device to open
- */
-#define COPYBIT_HARDWARE_COPYBIT0 "copybit0"
-
-/* supported pixel-formats. these must be compatible with
- * graphics/PixelFormat.java, ui/PixelFormat.h, pixelflinger/format.h
- */
-enum {
-    COPYBIT_FORMAT_RGBA_8888    = HAL_PIXEL_FORMAT_RGBA_8888,
-    COPYBIT_FORMAT_RGBX_8888    = HAL_PIXEL_FORMAT_RGBX_8888,
-    COPYBIT_FORMAT_RGB_888      = HAL_PIXEL_FORMAT_RGB_888,
-    COPYBIT_FORMAT_RGB_565      = HAL_PIXEL_FORMAT_RGB_565,
-    COPYBIT_FORMAT_BGRA_8888    = HAL_PIXEL_FORMAT_BGRA_8888,
-    COPYBIT_FORMAT_RGBA_5551    = HAL_PIXEL_FORMAT_RGBA_5551,
-    COPYBIT_FORMAT_RGBA_4444    = HAL_PIXEL_FORMAT_RGBA_4444,
-    COPYBIT_FORMAT_YCbCr_422_SP = 0x10,
-    COPYBIT_FORMAT_YCrCb_420_SP = 0x11,
-};
-
-/* name for copybit_set_parameter */
-enum {
-    /* rotation of the source image in degrees (0 to 359) */
-    COPYBIT_ROTATION_DEG    = 1,
-    /* plane alpha value */
-    COPYBIT_PLANE_ALPHA     = 2,
-    /* enable or disable dithering */
-    COPYBIT_DITHER          = 3,
-    /* transformation applied (this is a superset of COPYBIT_ROTATION_DEG) */
-    COPYBIT_TRANSFORM       = 4,
-    /* blurs the copied bitmap. The amount of blurring cannot be changed 
-     * at this time. */
-    COPYBIT_BLUR            = 5
-};
-
-/* values for copybit_set_parameter(COPYBIT_TRANSFORM) */
-enum {
-    /* flip source image horizontally */
-    COPYBIT_TRANSFORM_FLIP_H    = HAL_TRANSFORM_FLIP_H,
-    /* flip source image vertically */
-    COPYBIT_TRANSFORM_FLIP_V    = HAL_TRANSFORM_FLIP_V,
-    /* rotate source image 90 degres */
-    COPYBIT_TRANSFORM_ROT_90    = HAL_TRANSFORM_ROT_90,
-    /* rotate source image 180 degres */
-    COPYBIT_TRANSFORM_ROT_180   = HAL_TRANSFORM_ROT_180,
-    /* rotate source image 270 degres */
-    COPYBIT_TRANSFORM_ROT_270   = HAL_TRANSFORM_ROT_270,
-};
-
-/* enable/disable value copybit_set_parameter */
-enum {
-    COPYBIT_DISABLE = 0,
-    COPYBIT_ENABLE  = 1
-};
-
-/* use get_static_info() to query static informations about the hardware */
-enum {
-    /* Maximum amount of minification supported by the hardware*/
-    COPYBIT_MINIFICATION_LIMIT  = 1,
-    /* Maximum amount of magnification supported by the hardware */
-    COPYBIT_MAGNIFICATION_LIMIT = 2,
-    /* Number of fractional bits support by the scaling engine */
-    COPYBIT_SCALING_FRAC_BITS   = 3,
-    /* Supported rotation step in degres. */
-    COPYBIT_ROTATION_STEP_DEG   = 4,
-};
-
-/* Image structure */
-struct copybit_image_t {
-    /* width */
-    uint32_t    w;
-    /* height */
-    uint32_t    h;
-    /* format COPYBIT_FORMAT_xxx */
-    int32_t     format;
-    /* base of buffer with image */
-    void        *base;
-    /* handle to the image */
-    native_handle_t* handle;
-};
-
-/* Rectangle */
-struct copybit_rect_t {
-    /* left */
-    int l;
-    /* top */
-    int t;
-    /* right */
-    int r;
-    /* bottom */
-    int b;
-};
-
-/* Region */
-struct copybit_region_t {
-    int (*next)(struct copybit_region_t const *region, struct copybit_rect_t *rect);
-};
-
-/**
- * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM
- * and the fields of this data structure must begin with hw_module_t
- * followed by module specific information.
- */
-struct copybit_module_t {
-    struct hw_module_t common;
-};
-
-/**
- * Every device data structure must begin with hw_device_t
- * followed by module specific public methods and attributes.
- */
-struct copybit_device_t {
-    struct hw_device_t common;
-
-    /**
-     * Set a copybit parameter.
-     *
-     * @param dev from open
-     * @param name one for the COPYBIT_NAME_xxx
-     * @param value one of the COPYBIT_VALUE_xxx
-     *
-     * @return 0 if successful
-     */
-    int (*set_parameter)(struct copybit_device_t *dev, int name, int value);
-
-    /**
-     * Get a static copybit information.
-     *
-     * @param dev from open
-     * @param name one of the COPYBIT_STATIC_xxx
-     *
-     * @return value or -EINVAL if error
-     */
-    int (*get)(struct copybit_device_t *dev, int name);
-
-    /**
-     * Execute the bit blit copy operation
-     *
-     * @param dev from open
-     * @param dst is the destination image
-     * @param src is the source image
-     * @param region the clip region
-     *
-     * @return 0 if successful
-     */
-    int (*blit)(struct copybit_device_t *dev,
-                struct copybit_image_t const *dst,
-                struct copybit_image_t const *src,
-                struct copybit_region_t const *region);
-
-    /**
-     * Execute the stretch bit blit copy operation
-     *
-     * @param dev from open
-     * @param dst is the destination image
-     * @param src is the source image
-     * @param dst_rect is the destination rectangle
-     * @param src_rect is the source rectangle
-     * @param region the clip region
-     *
-     * @return 0 if successful
-     */
-    int (*stretch)(struct copybit_device_t *dev,
-                   struct copybit_image_t const *dst,
-                   struct copybit_image_t const *src,
-                   struct copybit_rect_t const *dst_rect,
-                   struct copybit_rect_t const *src_rect,
-                   struct copybit_region_t const *region);
-};
-
-
-/** convenience API for opening and closing a device */
-
-static inline int copybit_open(const struct hw_module_t* module, 
-        struct copybit_device_t** device) {
-    return module->methods->open(module, 
-            COPYBIT_HARDWARE_COPYBIT0, (struct hw_device_t**)device);
-}
-
-static inline int copybit_close(struct copybit_device_t* device) {
-    return device->common.close(&device->common);
-}
-
-
-__END_DECLS
-
-#endif  // ANDROID_COPYBIT_INTERFACE_H
diff --git a/include/hardware/fb.h b/include/hardware/fb.h
new file mode 100644
index 0000000..ba2f286
--- /dev/null
+++ b/include/hardware/fb.h
@@ -0,0 +1,164 @@
+/*
+ * Copyright (C) 2008 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.
+ */
+
+
+#ifndef ANDROID_FB_INTERFACE_H
+#define ANDROID_FB_INTERFACE_H
+
+#include <stdint.h>
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+#include <cutils/native_handle.h>
+
+#include <hardware/hardware.h>
+
+__BEGIN_DECLS
+
+#define GRALLOC_HARDWARE_FB0 "fb0"
+
+/*****************************************************************************/
+
+
+/*****************************************************************************/
+
+typedef struct framebuffer_device_t {
+    struct hw_device_t common;
+
+    /* flags describing some attributes of the framebuffer */
+    const uint32_t  flags;
+
+    /* dimensions of the framebuffer in pixels */
+    const uint32_t  width;
+    const uint32_t  height;
+
+    /* frambuffer stride in pixels */
+    const int       stride;
+
+    /* framebuffer pixel format */
+    const int       format;
+
+    /* resolution of the framebuffer's display panel in pixel per inch*/
+    const float     xdpi;
+    const float     ydpi;
+
+    /* framebuffer's display panel refresh rate in frames per second */
+    const float     fps;
+
+    /* min swap interval supported by this framebuffer */
+    const int       minSwapInterval;
+
+    /* max swap interval supported by this framebuffer */
+    const int       maxSwapInterval;
+
+    int reserved[8];
+
+    /*
+     * requests a specific swap-interval (same definition than EGL)
+     *
+     * Returns 0 on success or -errno on error.
+     */
+    int (*setSwapInterval)(struct framebuffer_device_t* window,
+            int interval);
+
+    /*
+     * This hook is OPTIONAL.
+     *
+     * It is non NULL If the framebuffer driver supports "update-on-demand"
+     * and the given rectangle is the area of the screen that gets
+     * updated during (*post)().
+     *
+     * This is useful on devices that are able to DMA only a portion of
+     * the screen to the display panel, upon demand -- as opposed to
+     * constantly refreshing the panel 60 times per second, for instance.
+     *
+     * Only the area defined by this rectangle is guaranteed to be valid, that
+     * is, the driver is not allowed to post anything outside of this
+     * rectangle.
+     *
+     * The rectangle evaluated during (*post)() and specifies which area
+     * of the buffer passed in (*post)() shall to be posted.
+     *
+     * return -EINVAL if width or height <=0, or if left or top < 0
+     */
+    int (*setUpdateRect)(struct framebuffer_device_t* window,
+            int left, int top, int width, int height);
+
+    /*
+     * Post <buffer> to the display (display it on the screen)
+     * The buffer must have been allocated with the
+     *   GRALLOC_USAGE_HW_FB usage flag.
+     * buffer must be the same width and height as the display and must NOT
+     * be locked.
+     *
+     * The buffer is shown during the next VSYNC.
+     *
+     * If the same buffer is posted again (possibly after some other buffer),
+     * post() will block until the the first post is completed.
+     *
+     * Internally, post() is expected to lock the buffer so that a
+     * subsequent call to gralloc_module_t::(*lock)() with USAGE_RENDER or
+     * USAGE_*_WRITE will block until it is safe; that is typically once this
+     * buffer is shown and another buffer has been posted.
+     *
+     * Returns 0 on success or -errno on error.
+     */
+    int (*post)(struct framebuffer_device_t* dev, buffer_handle_t buffer);
+
+
+    /*
+     * The (*compositionComplete)() method must be called after the
+     * compositor has finished issuing GL commands for client buffers.
+     */
+
+    int (*compositionComplete)(struct framebuffer_device_t* dev);
+
+    /*
+     * This hook is OPTIONAL.
+     *
+     * If non NULL it will be caused by SurfaceFlinger on dumpsys
+     */
+    void (*dump)(struct framebuffer_device_t* dev, char *buff, int buff_len);
+
+    /*
+     * (*enableScreen)() is used to either blank (enable=0) or
+     * unblank (enable=1) the screen this framebuffer is attached to.
+     *
+     * Returns 0 on success or -errno on error.
+     */
+    int (*enableScreen)(struct framebuffer_device_t* dev, int enable);
+
+    void* reserved_proc[6];
+
+} framebuffer_device_t;
+
+
+/** convenience API for opening and closing a supported device */
+
+static inline int framebuffer_open(const struct hw_module_t* module,
+        struct framebuffer_device_t** device) {
+    return module->methods->open(module,
+            GRALLOC_HARDWARE_FB0, (struct hw_device_t**)device);
+}
+
+static inline int framebuffer_close(struct framebuffer_device_t* device) {
+    return device->common.close(&device->common);
+}
+
+
+__END_DECLS
+
+#endif  // ANDROID_FB_INTERFACE_H
diff --git a/include/hardware/gralloc.h b/include/hardware/gralloc.h
index 5eefe79..8ee0240 100644
--- a/include/hardware/gralloc.h
+++ b/include/hardware/gralloc.h
@@ -18,14 +18,18 @@
 #ifndef ANDROID_GRALLOC_INTERFACE_H
 #define ANDROID_GRALLOC_INTERFACE_H
 
-#include <cutils/native_handle.h>
-
+#include <system/window.h>
 #include <hardware/hardware.h>
 
 #include <stdint.h>
 #include <sys/cdefs.h>
 #include <sys/types.h>
 
+#include <cutils/native_handle.h>
+
+#include <hardware/hardware.h>
+#include <hardware/fb.h>
+
 __BEGIN_DECLS
 
 #define GRALLOC_API_VERSION 1
@@ -39,7 +43,6 @@
  * Name of the graphics device to open
  */
 
-#define GRALLOC_HARDWARE_FB0 "fb0"
 #define GRALLOC_HARDWARE_GPU0 "gpu0"
 
 enum {
@@ -95,16 +98,6 @@
 
 /*****************************************************************************/
 
-typedef const native_handle* buffer_handle_t;
-
-enum {
-    /* FIXME: this only exists to work-around some issues with
-     * the video and camera frameworks. don't implement unless
-     * you know what you're doing.
-     */
-    GRALLOC_MODULE_PERFORM_CREATE_HANDLE_FROM_BUFFER = 0x080000001,
-};
-
 /**
  * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM
  * and the fields of this data structure must begin with hw_module_t
@@ -247,109 +240,6 @@
 } alloc_device_t;
 
 
-typedef struct framebuffer_device_t {
-    struct hw_device_t common;
-
-    /* flags describing some attributes of the framebuffer */
-    const uint32_t  flags;
-    
-    /* dimensions of the framebuffer in pixels */
-    const uint32_t  width;
-    const uint32_t  height;
-
-    /* frambuffer stride in pixels */
-    const int       stride;
-    
-    /* framebuffer pixel format */
-    const int       format;
-    
-    /* resolution of the framebuffer's display panel in pixel per inch*/
-    const float     xdpi;
-    const float     ydpi;
-
-    /* framebuffer's display panel refresh rate in frames per second */
-    const float     fps;
-
-    /* min swap interval supported by this framebuffer */
-    const int       minSwapInterval;
-
-    /* max swap interval supported by this framebuffer */
-    const int       maxSwapInterval;
-
-    int reserved[8];
-    
-    /* 
-     * requests a specific swap-interval (same definition than EGL) 
-     * 
-     * Returns 0 on success or -errno on error.
-     */
-    int (*setSwapInterval)(struct framebuffer_device_t* window,
-            int interval);
-
-    /*
-     * This hook is OPTIONAL.
-     * 
-     * It is non NULL If the framebuffer driver supports "update-on-demand" 
-     * and the given rectangle is the area of the screen that gets 
-     * updated during (*post)().
-     * 
-     * This is useful on devices that are able to DMA only a portion of
-     * the screen to the display panel, upon demand -- as opposed to
-     * constantly refreshing the panel 60 times per second, for instance.
-     * 
-     * Only the area defined by this rectangle is guaranteed to be valid, that
-     * is, the driver is not allowed to post anything outside of this
-     * rectangle. 
-     * 
-     * The rectangle evaluated during (*post)() and specifies which area
-     * of the buffer passed in (*post)() shall to be posted.
-     * 
-     * return -EINVAL if width or height <=0, or if left or top < 0 
-     */
-    int (*setUpdateRect)(struct framebuffer_device_t* window,
-            int left, int top, int width, int height);
-    
-    /*
-     * Post <buffer> to the display (display it on the screen)
-     * The buffer must have been allocated with the 
-     *   GRALLOC_USAGE_HW_FB usage flag.
-     * buffer must be the same width and height as the display and must NOT
-     * be locked.
-     * 
-     * The buffer is shown during the next VSYNC. 
-     * 
-     * If the same buffer is posted again (possibly after some other buffer),
-     * post() will block until the the first post is completed.
-     *
-     * Internally, post() is expected to lock the buffer so that a 
-     * subsequent call to gralloc_module_t::(*lock)() with USAGE_RENDER or
-     * USAGE_*_WRITE will block until it is safe; that is typically once this
-     * buffer is shown and another buffer has been posted.
-     *
-     * Returns 0 on success or -errno on error.
-     */
-    int (*post)(struct framebuffer_device_t* dev, buffer_handle_t buffer);
-
-
-    /*
-     * The (*compositionComplete)() method must be called after the
-     * compositor has finished issuing GL commands for client buffers.
-     */
-
-    int (*compositionComplete)(struct framebuffer_device_t* dev);
-
-    /*
-     * This hook is OPTIONAL.
-     *
-     * If non NULL it will be caused by SurfaceFlinger on dumpsys
-     */
-    void (*dump)(struct framebuffer_device_t* dev, char *buff, int buff_len);
-
-    void* reserved_proc[7];
-
-} framebuffer_device_t;
-
-
 /** convenience API for opening and closing a supported device */
 
 static inline int gralloc_open(const struct hw_module_t* module, 
@@ -362,18 +252,6 @@
     return device->common.close(&device->common);
 }
 
-
-static inline int framebuffer_open(const struct hw_module_t* module, 
-        struct framebuffer_device_t** device) {
-    return module->methods->open(module, 
-            GRALLOC_HARDWARE_FB0, (struct hw_device_t**)device);
-}
-
-static inline int framebuffer_close(struct framebuffer_device_t* device) {
-    return device->common.close(&device->common);
-}
-
-
 __END_DECLS
 
 #endif  // ANDROID_ALLOC_INTERFACE_H
diff --git a/include/hardware/hardware.h b/include/hardware/hardware.h
index d9cc0dc..7774b2b 100644
--- a/include/hardware/hardware.h
+++ b/include/hardware/hardware.h
@@ -21,6 +21,7 @@
 #include <sys/cdefs.h>
 
 #include <cutils/native_handle.h>
+#include <system/graphics.h>
 
 __BEGIN_DECLS
 
@@ -113,92 +114,25 @@
 
 /**
  * Get the module info associated with a module by id.
- * @return: 0 == success, <0 == error and *pHmi == NULL
+ *
+ * @return: 0 == success, <0 == error and *module == NULL
  */
 int hw_get_module(const char *id, const struct hw_module_t **module);
 
-
 /**
- * pixel format definitions
- */
-
-enum {
-    HAL_PIXEL_FORMAT_RGBA_8888          = 1,
-    HAL_PIXEL_FORMAT_RGBX_8888          = 2,
-    HAL_PIXEL_FORMAT_RGB_888            = 3,
-    HAL_PIXEL_FORMAT_RGB_565            = 4,
-    HAL_PIXEL_FORMAT_BGRA_8888          = 5,
-    HAL_PIXEL_FORMAT_RGBA_5551          = 6,
-    HAL_PIXEL_FORMAT_RGBA_4444          = 7,
-
-    /* 0x8 - 0xFF range unavailable */
-
-    /*
-     * 0x100 - 0x1FF
-     *
-     * This range is reserved for pixel formats that are specific to the HAL
-     * implementation.  Implementations can use any value in this range to
-     * communicate video pixel formats between their HAL modules.  These formats
-     * must not have an alpha channel.  Additionally, an EGLimage created from a
-     * gralloc buffer of one of these formats must be supported for use with the
-     * GL_OES_EGL_image_external OpenGL ES extension.
-     */
-
-    /*
-     * Android YUV format:
-     *
-     * This format is exposed outside of the HAL to software
-     * decoders and applications.
-     * EGLImageKHR must support it in conjunction with the
-     * OES_EGL_image_external extension.
-     *
-     * YV12 is 4:2:0 YCrCb planar format comprised of a WxH Y plane followed
-     * by (W/2) x (H/2) Cr and Cb planes.
-     *
-     * This format assumes
-     * - an even width
-     * - an even height
-     * - a horizontal stride multiple of 16 pixels
-     * - a vertical stride equal to the height
-     *
-     *   y_size = stride * height
-     *   c_size = ALIGN(stride/2, 16) * height/2
-     *   size = y_size + c_size * 2
-     *   cr_offset = y_size
-     *   cb_offset = y_size + c_size
-     *
-     */
-    HAL_PIXEL_FORMAT_YV12   = 0x32315659, // YCrCb 4:2:0 Planar
-
-
-
-    /* Legacy formats (deprecated), used by ImageFormat.java */
-    HAL_PIXEL_FORMAT_YCbCr_422_SP       = 0x10, // NV16
-    HAL_PIXEL_FORMAT_YCrCb_420_SP       = 0x11, // NV21
-    HAL_PIXEL_FORMAT_YCbCr_422_I        = 0x14, // YUY2
-};
-
-
-/**
- * Transformation definitions
+ * Get the module info associated with a module instance by class 'class_id'
+ * and instance 'inst'.
  *
- * IMPORTANT NOTE:
- * HAL_TRANSFORM_ROT_90 is applied CLOCKWISE and AFTER HAL_TRANSFORM_FLIP_{H|V}.
+ * Some modules types necessitate multiple instances. For example audio supports
+ * multiple concurrent interfaces and thus 'audio' is the module class
+ * and 'primary' or 'a2dp' are module interfaces. This implies that the files
+ * providing these modules would be named audio.primary.<variant>.so and
+ * audio.a2dp.<variant>.so
  *
+ * @return: 0 == success, <0 == error and *module == NULL
  */
-
-enum {
-    /* flip source image horizontally (around the vertical axis) */
-    HAL_TRANSFORM_FLIP_H    = 0x01,
-    /* flip source image vertically (around the horizontal axis)*/
-    HAL_TRANSFORM_FLIP_V    = 0x02,
-    /* rotate source image 90 degrees clockwise */
-    HAL_TRANSFORM_ROT_90    = 0x04,
-    /* rotate source image 180 degrees */
-    HAL_TRANSFORM_ROT_180   = 0x03,
-    /* rotate source image 270 degrees clockwise */
-    HAL_TRANSFORM_ROT_270   = 0x07,
-};
+int hw_get_module_by_class(const char *class_id, const char *inst,
+                           const struct hw_module_t **module);
 
 __END_DECLS
 
diff --git a/include/hardware/overlay.h b/include/hardware/overlay.h
deleted file mode 100644
index c56a974..0000000
--- a/include/hardware/overlay.h
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * Copyright (C) 2008 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.
- */
-
-#ifndef ANDROID_OVERLAY_INTERFACE_H
-#define ANDROID_OVERLAY_INTERFACE_H
-
-#include <cutils/native_handle.h>
-
-#include <hardware/hardware.h>
-
-#include <stdint.h>
-#include <sys/cdefs.h>
-#include <sys/types.h>
-
-__BEGIN_DECLS
-
-/**
- * The id of this module
- */
-#define OVERLAY_HARDWARE_MODULE_ID "overlay"
-
-/**
- * Name of the overlay device to open
- */
-#define OVERLAY_HARDWARE_CONTROL    "control"
-#define OVERLAY_HARDWARE_DATA       "data"
-
-/*****************************************************************************/
-
-/* possible overlay formats */
-enum {
-    OVERLAY_FORMAT_RGBA_8888    = HAL_PIXEL_FORMAT_RGBA_8888,
-    OVERLAY_FORMAT_RGB_565      = HAL_PIXEL_FORMAT_RGB_565,
-    OVERLAY_FORMAT_BGRA_8888    = HAL_PIXEL_FORMAT_BGRA_8888,
-    OVERLAY_FORMAT_YCbYCr_422_I = 0x14,
-    OVERLAY_FORMAT_CbYCrY_422_I = 0x16,
-    OVERLAY_FORMAT_DEFAULT      = 99    // The actual color format is determined
-                                        // by the overlay
-};
-
-/* values for copybit_set_parameter(OVERLAY_TRANSFORM) */
-enum {
-    /* flip source image horizontally */
-    OVERLAY_TRANSFORM_FLIP_H    = HAL_TRANSFORM_FLIP_H,
-    /* flip source image vertically */
-    OVERLAY_TRANSFORM_FLIP_V    = HAL_TRANSFORM_FLIP_V,
-    /* rotate source image 90 degrees */
-    OVERLAY_TRANSFORM_ROT_90    = HAL_TRANSFORM_ROT_90,
-    /* rotate source image 180 degrees */
-    OVERLAY_TRANSFORM_ROT_180   = HAL_TRANSFORM_ROT_180,
-    /* rotate source image 270 degrees */
-    OVERLAY_TRANSFORM_ROT_270   = HAL_TRANSFORM_ROT_270
-};
-
-/* names for setParameter() */
-enum {
-    /* rotation of the source image in degrees (0 to 359) */
-    OVERLAY_ROTATION_DEG  = 1,
-    /* enable or disable dithering */
-    OVERLAY_DITHER        = 3,
-    /* transformation applied (this is a superset of COPYBIT_ROTATION_DEG) */
-    OVERLAY_TRANSFORM    = 4,
-};
-
-/* enable/disable value setParameter() */
-enum {
-    OVERLAY_DISABLE = 0,
-    OVERLAY_ENABLE  = 1
-};
-
-/* names for get() */
-enum {
-    /* Maximum amount of minification supported by the hardware*/
-    OVERLAY_MINIFICATION_LIMIT      = 1,
-    /* Maximum amount of magnification supported by the hardware */
-    OVERLAY_MAGNIFICATION_LIMIT     = 2,
-    /* Number of fractional bits support by the overlay scaling engine */
-    OVERLAY_SCALING_FRAC_BITS       = 3,
-    /* Supported rotation step in degrees. */
-    OVERLAY_ROTATION_STEP_DEG       = 4,
-    /* horizontal alignment in pixels */
-    OVERLAY_HORIZONTAL_ALIGNMENT    = 5,
-    /* vertical alignment in pixels */
-    OVERLAY_VERTICAL_ALIGNMENT      = 6,
-    /* width alignment restrictions. negative number for max. power-of-two */
-    OVERLAY_WIDTH_ALIGNMENT         = 7,
-    /* height alignment restrictions. negative number for max. power-of-two */
-    OVERLAY_HEIGHT_ALIGNMENT        = 8,
-};
-
-/*****************************************************************************/
-
-/* opaque reference to an Overlay kernel object */
-typedef const native_handle* overlay_handle_t;
-
-typedef struct overlay_t {
-    uint32_t            w;
-    uint32_t            h;
-    int32_t             format;
-    uint32_t            w_stride;
-    uint32_t            h_stride;
-    uint32_t            reserved[3];
-    /* returns a reference to this overlay's handle (the caller doesn't
-     * take ownership) */
-    overlay_handle_t    (*getHandleRef)(struct overlay_t* overlay);
-    uint32_t            reserved_procs[7];
-} overlay_t;
-
-typedef void* overlay_buffer_t;
-
-/*****************************************************************************/
-
-/**
- * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM
- * and the fields of this data structure must begin with hw_module_t
- * followed by module specific information.
- */
-struct overlay_module_t {
-    struct hw_module_t common;
-};
-
-/*****************************************************************************/
-
-/**
- * Every device data structure must begin with hw_device_t
- * followed by module specific public methods and attributes.
- */
-
-struct overlay_control_device_t {
-    struct hw_device_t common;
-    
-    /* get static informations about the capabilities of the overlay engine */
-    int (*get)(struct overlay_control_device_t *dev, int name);
-
-    /* creates an overlay matching the given parameters as closely as possible.
-     * returns an error if no more overlays are available. The actual
-     * size and format is returned in overlay_t. */
-    overlay_t* (*createOverlay)(struct overlay_control_device_t *dev,
-            uint32_t w, uint32_t h, int32_t format);
-    
-    /* destroys an overlay. This call releases all
-     * resources associated with overlay_t and make it invalid */
-    void (*destroyOverlay)(struct overlay_control_device_t *dev,
-            overlay_t* overlay);
-
-    /* set position and scaling of the given overlay as closely as possible.
-     * if scaling cannot be performed, overlay must be centered. */
-    int (*setPosition)(struct overlay_control_device_t *dev,
-            overlay_t* overlay, 
-            int x, int y, uint32_t w, uint32_t h);
-
-    /* returns the actual position and size of the overlay */
-    int (*getPosition)(struct overlay_control_device_t *dev,
-            overlay_t* overlay, 
-            int* x, int* y, uint32_t* w, uint32_t* h);
-
-    /* sets configurable parameters for this overlay. returns an error if not
-     * supported. */
-    int (*setParameter)(struct overlay_control_device_t *dev,
-            overlay_t* overlay, int param, int value);
-
-    int (*stage)(struct overlay_control_device_t *dev, overlay_t* overlay);
-    int (*commit)(struct overlay_control_device_t *dev, overlay_t* overlay);
-};
-
-
-struct overlay_data_device_t {
-    struct hw_device_t common;
-
-    /* initialize the overlay from the given handle. this associates this
-     * overlay data module to its control module */
-    int (*initialize)(struct overlay_data_device_t *dev,
-            overlay_handle_t handle);
-
-    /* can be called to change the width and height of the overlay. */
-    int (*resizeInput)(struct overlay_data_device_t *dev,
-            uint32_t w, uint32_t h);
-
-    int (*setCrop)(struct overlay_data_device_t *dev,
-            uint32_t x, uint32_t y, uint32_t w, uint32_t h) ;
-
-    int (*getCrop)(struct overlay_data_device_t *dev,
-       uint32_t* x, uint32_t* y, uint32_t* w, uint32_t* h) ;
-
-    int (*setParameter)(struct overlay_data_device_t *dev,
-            int param, int value);
-
-    /* blocks until an overlay buffer is available and return that buffer. */
-    int (*dequeueBuffer)(struct overlay_data_device_t *dev,
-		         overlay_buffer_t *buf);
-
-    /* release the overlay buffer and post it */
-    int (*queueBuffer)(struct overlay_data_device_t *dev,
-            overlay_buffer_t buffer);
-
-    /* returns the address of a given buffer if supported, NULL otherwise. */
-    void* (*getBufferAddress)(struct overlay_data_device_t *dev,
-            overlay_buffer_t buffer);
-
-    int (*getBufferCount)(struct overlay_data_device_t *dev);
-};
-
-
-/*****************************************************************************/
-
-/** convenience API for opening and closing a device */
-
-static inline int overlay_control_open(const struct hw_module_t* module, 
-        struct overlay_control_device_t** device) {
-    return module->methods->open(module, 
-            OVERLAY_HARDWARE_CONTROL, (struct hw_device_t**)device);
-}
-
-static inline int overlay_control_close(struct overlay_control_device_t* device) {
-    return device->common.close(&device->common);
-}
-
-static inline int overlay_data_open(const struct hw_module_t* module, 
-        struct overlay_data_device_t** device) {
-    return module->methods->open(module, 
-            OVERLAY_HARDWARE_DATA, (struct hw_device_t**)device);
-}
-
-static inline int overlay_data_close(struct overlay_data_device_t* device) {
-    return device->common.close(&device->common);
-}
-
-__END_DECLS
-
-#endif  // ANDROID_OVERLAY_INTERFACE_H
diff --git a/include/hardware/sensors.h b/include/hardware/sensors.h
index 1dcd5fa..7819a71 100644
--- a/include/hardware/sensors.h
+++ b/include/hardware/sensors.h
@@ -56,12 +56,13 @@
 #define SENSOR_TYPE_GYROSCOPE           4
 #define SENSOR_TYPE_LIGHT               5
 #define SENSOR_TYPE_PRESSURE            6
-#define SENSOR_TYPE_TEMPERATURE         7
+#define SENSOR_TYPE_TEMPERATURE         7   // deprecated
 #define SENSOR_TYPE_PROXIMITY           8
 #define SENSOR_TYPE_GRAVITY             9
 #define SENSOR_TYPE_LINEAR_ACCELERATION 10
 #define SENSOR_TYPE_ROTATION_VECTOR     11
 #define SENSOR_TYPE_RELATIVE_HUMIDITY   12
+#define SENSOR_TYPE_AMBIENT_TEMPERATURE 13
 
 /**
  * Values returned by the accelerometer in various locations in the universe.
@@ -268,6 +269,18 @@
  * Elements of the rotation vector are unitless.  The x, y, and z axis are defined
  * in the same was as for the acceleration sensor.
  *
+ * The reference coordinate system is defined as a direct orthonormal basis,
+ * where:
+ *
+ * - X is defined as the vector product Y.Z (It is tangential to
+ * the ground at the device's current location and roughly points East).
+ *
+ * - Y is tangential to the ground at the device's current location and
+ * points towards the magnetic North Pole.
+ *
+ * - Z points towards the sky and is perpendicular to the ground.
+ *
+ *
  * The rotation-vector is stored as:
  *
  *   sensors_event_t.data[0] = x*sin(theta/2)
@@ -275,6 +288,7 @@
  *   sensors_event_t.data[2] = z*sin(theta/2)
  *   sensors_event_t.data[3] =   cos(theta/2)
  *
+ *
  * Relative Humidity
  * -----------------
  *
@@ -283,6 +297,16 @@
  *
  * Relative humidity sensors report a value only when it changes and each
  * time the sensor is enabled. setDelay() is ignored.
+ *
+ *
+ * Ambient Temperature
+ * -------------------
+ *
+ * The ambient (room) temperature in degree Celsius.
+ *
+ * Temperature sensors report a value only when it changes and each time the
+ * sensor is enabled. setDelay() is ignored.
+ *
  */
 
 typedef struct {
@@ -462,6 +486,4 @@
 
 __END_DECLS
 
-#include <hardware/sensors_deprecated.h>
-
 #endif  // ANDROID_SENSORS_INTERFACE_H
diff --git a/include/hardware/sensors_deprecated.h b/include/hardware/sensors_deprecated.h
deleted file mode 100644
index ee667d6..0000000
--- a/include/hardware/sensors_deprecated.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2008 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.
- */
-
-#define SENSORS_HARDWARE_CONTROL    "control"
-#define SENSORS_HARDWARE_DATA       "data"
-
-__BEGIN_DECLS
-
-typedef struct {
-    int             sensor;
-    union {
-        sensors_vec_t   vector;
-        sensors_vec_t   orientation;
-        sensors_vec_t   acceleration;
-        sensors_vec_t   magnetic;
-        float           temperature;
-        float           distance;
-        float           light;
-        float           pressure;
-    };
-    int64_t         time;
-    uint32_t        reserved;
-} sensors_data_t;
-
-struct sensors_control_device_t {
-    struct hw_device_t common;
-    native_handle_t* (*open_data_source)(struct sensors_control_device_t *dev);
-    int (*close_data_source)(struct sensors_control_device_t *dev);
-    int (*activate)(struct sensors_control_device_t *dev, 
-            int handle, int enabled);
-    int (*set_delay)(struct sensors_control_device_t *dev, int32_t ms);
-    int (*wake)(struct sensors_control_device_t *dev);
-};
-
-struct sensors_data_device_t {
-    struct hw_device_t common;
-    int (*data_open)(struct sensors_data_device_t *dev, native_handle_t* nh);
-    int (*data_close)(struct sensors_data_device_t *dev);
-    int (*poll)(struct sensors_data_device_t *dev, 
-            sensors_data_t* data);
-};
-
-static inline int sensors_control_open(const struct hw_module_t* module, 
-        struct sensors_control_device_t** device) {
-    return module->methods->open(module, 
-            SENSORS_HARDWARE_CONTROL, (struct hw_device_t**)device);
-}
-
-static inline int sensors_control_close(struct sensors_control_device_t* device) {
-    return device->common.close(&device->common);
-}
-
-static inline int sensors_data_open(const struct hw_module_t* module, 
-        struct sensors_data_device_t** device) {
-    return module->methods->open(module, 
-            SENSORS_HARDWARE_DATA, (struct hw_device_t**)device);
-}
-
-static inline int sensors_data_close(struct sensors_data_device_t* device) {
-    return device->common.close(&device->common);
-}
-
-__END_DECLS
diff --git a/modules/Android.mk b/modules/Android.mk
new file mode 100644
index 0000000..04b9140
--- /dev/null
+++ b/modules/Android.mk
@@ -0,0 +1,2 @@
+hardware_modules := gralloc hwcomposer audio
+include $(call all-named-subdir-makefiles,$(hardware_modules))
diff --git a/modules/audio/Android.mk b/modules/audio/Android.mk
new file mode 100644
index 0000000..f773079
--- /dev/null
+++ b/modules/audio/Android.mk
@@ -0,0 +1,43 @@
+# Copyright (C) 2011 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.
+
+LOCAL_PATH := $(call my-dir)
+
+# The default audio HAL module, which is a stub, that is loaded if no other
+# device specific modules are present. The exact load order can be seen in
+# libhardware/hardware.c
+#
+# The format of the name is audio.<type>.<hardware/etc>.so where the only
+# required type is 'primary'. Other possibilites are 'a2dp', 'usb', etc.
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := audio.primary.default
+LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
+LOCAL_SRC_FILES := audio_hw.c
+LOCAL_SHARED_LIBRARIES := liblog libcutils
+LOCAL_MODULE_TAGS := optional
+
+include $(BUILD_SHARED_LIBRARY)
+
+# The stub audio policy HAL module that can be used as a skeleton for
+# new implementations.
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := audio_policy.stub
+LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
+LOCAL_SRC_FILES := audio_policy.c
+LOCAL_SHARED_LIBRARIES := liblog libcutils
+LOCAL_MODULE_TAGS := optional
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/modules/audio/audio_hw.c b/modules/audio/audio_hw.c
new file mode 100644
index 0000000..b3ab1e2
--- /dev/null
+++ b/modules/audio/audio_hw.c
@@ -0,0 +1,412 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+#define LOG_TAG "audio_hw_default"
+//#define LOG_NDEBUG 0
+
+#include <errno.h>
+#include <pthread.h>
+#include <stdint.h>
+#include <sys/time.h>
+
+#include <cutils/log.h>
+
+#include <hardware/hardware.h>
+#include <system/audio.h>
+#include <hardware/audio_hal.h>
+
+struct stub_audio_device {
+    struct audio_hw_device device;
+};
+
+struct stub_stream_out {
+    struct audio_stream_out stream;
+};
+
+struct stub_stream_in {
+    struct audio_stream_in stream;
+};
+
+static uint32_t out_get_sample_rate(const struct audio_stream *stream)
+{
+    return 44100;
+}
+
+static int out_set_sample_rate(struct audio_stream *stream, uint32_t rate)
+{
+    return 0;
+}
+
+static size_t out_get_buffer_size(const struct audio_stream *stream)
+{
+    return 4096;
+}
+
+static uint32_t out_get_channels(const struct audio_stream *stream)
+{
+    return AUDIO_CHANNEL_OUT_STEREO;
+}
+
+static int out_get_format(const struct audio_stream *stream)
+{
+    return AUDIO_FORMAT_PCM_16_BIT;
+}
+
+static int out_set_format(struct audio_stream *stream, int format)
+{
+    return 0;
+}
+
+static int out_standby(struct audio_stream *stream)
+{
+    return 0;
+}
+
+static int out_dump(const struct audio_stream *stream, int fd)
+{
+    return 0;
+}
+
+static int out_set_parameters(struct audio_stream *stream, const char *kvpairs)
+{
+    return 0;
+}
+
+static char * out_get_parameters(const struct audio_stream *stream, const char *keys)
+{
+    return strdup("");
+}
+
+static uint32_t out_get_latency(const struct audio_stream_out *stream)
+{
+    return 0;
+}
+
+static int out_set_volume(struct audio_stream_out *stream, float left,
+                          float right)
+{
+    return 0;
+}
+
+static ssize_t out_write(struct audio_stream_out *stream, const void* buffer,
+                         size_t bytes)
+{
+    /* XXX: fake timing for audio output */
+    usleep(bytes * 1000000 / audio_stream_frame_size(&stream->common) /
+           out_get_sample_rate(&stream->common));
+    return bytes;
+}
+
+static int out_get_render_position(const struct audio_stream_out *stream,
+                                   uint32_t *dsp_frames)
+{
+    return -EINVAL;
+}
+
+/** audio_stream_in implementation **/
+static uint32_t in_get_sample_rate(const struct audio_stream *stream)
+{
+    return 8000;
+}
+
+static int in_set_sample_rate(struct audio_stream *stream, uint32_t rate)
+{
+    return 0;
+}
+
+static size_t in_get_buffer_size(const struct audio_stream *stream)
+{
+    return 320;
+}
+
+static uint32_t in_get_channels(const struct audio_stream *stream)
+{
+    return AUDIO_CHANNEL_IN_MONO;
+}
+
+static int in_get_format(const struct audio_stream *stream)
+{
+    return AUDIO_FORMAT_PCM_16_BIT;
+}
+
+static int in_set_format(struct audio_stream *stream, int format)
+{
+    return 0;
+}
+
+static int in_standby(struct audio_stream *stream)
+{
+    return 0;
+}
+
+static int in_dump(const struct audio_stream *stream, int fd)
+{
+    return 0;
+}
+
+static int in_set_parameters(struct audio_stream *stream, const char *kvpairs)
+{
+    return 0;
+}
+
+static char * in_get_parameters(const struct audio_stream *stream,
+                                const char *keys)
+{
+    return strdup("");
+}
+
+static int in_set_gain(struct audio_stream_in *stream, float gain)
+{
+    return 0;
+}
+
+static ssize_t in_read(struct audio_stream_in *stream, void* buffer,
+                       size_t bytes)
+{
+    /* XXX: fake timing for audio input */
+    usleep(bytes * 1000000 / audio_stream_frame_size(&stream->common) /
+           in_get_sample_rate(&stream->common));
+    return bytes;
+}
+
+static uint32_t in_get_input_frames_lost(struct audio_stream_in *stream)
+{
+    return 0;
+}
+
+
+static int adev_open_output_stream(struct audio_hw_device *dev,
+                                   uint32_t devices, int *format,
+                                   uint32_t *channels, uint32_t *sample_rate,
+                                   struct audio_stream_out **stream_out)
+{
+    struct stub_audio_device *ladev = (struct stub_audio_device *)dev;
+    struct stub_stream_out *out;
+    int ret;
+
+    out = (struct stub_stream_out *)calloc(1, sizeof(struct stub_stream_out));
+    if (!out)
+        return -ENOMEM;
+
+    out->stream.common.get_sample_rate = out_get_sample_rate;
+    out->stream.common.set_sample_rate = out_set_sample_rate;
+    out->stream.common.get_buffer_size = out_get_buffer_size;
+    out->stream.common.get_channels = out_get_channels;
+    out->stream.common.get_format = out_get_format;
+    out->stream.common.set_format = out_set_format;
+    out->stream.common.standby = out_standby;
+    out->stream.common.dump = out_dump;
+    out->stream.common.set_parameters = out_set_parameters;
+    out->stream.common.get_parameters = out_get_parameters;
+    out->stream.get_latency = out_get_latency;
+    out->stream.set_volume = out_set_volume;
+    out->stream.write = out_write;
+    out->stream.get_render_position = out_get_render_position;
+
+    *stream_out = &out->stream;
+    return 0;
+
+err_open:
+    free(out);
+    *stream_out = NULL;
+    return ret;
+}
+
+static void adev_close_output_stream(struct audio_hw_device *dev,
+                                     struct audio_stream_out *stream)
+{
+    free(stream);
+}
+
+static int adev_set_parameters(struct audio_hw_device *dev, const char *kvpairs)
+{
+    return -ENOSYS;
+}
+
+static char * adev_get_parameters(const struct audio_hw_device *dev,
+                                  const char *keys)
+{
+    return NULL;
+}
+
+static int adev_init_check(const struct audio_hw_device *dev)
+{
+    return 0;
+}
+
+static int adev_set_voice_volume(struct audio_hw_device *dev, float volume)
+{
+    return -ENOSYS;
+}
+
+static int adev_set_master_volume(struct audio_hw_device *dev, float volume)
+{
+    return -ENOSYS;
+}
+
+static int adev_set_mode(struct audio_hw_device *dev, int mode)
+{
+    return 0;
+}
+
+static int adev_set_mic_mute(struct audio_hw_device *dev, bool state)
+{
+    return -ENOSYS;
+}
+
+static int adev_get_mic_mute(const struct audio_hw_device *dev, bool *state)
+{
+    return -ENOSYS;
+}
+
+static size_t adev_get_input_buffer_size(const struct audio_hw_device *dev,
+                                         uint32_t sample_rate, int format,
+                                         int channel_count)
+{
+    return 320;
+}
+
+static int adev_open_input_stream(struct audio_hw_device *dev, uint32_t devices,
+                                  int *format, uint32_t *channels,
+                                  uint32_t *sample_rate,
+                                  audio_in_acoustics_t acoustics,
+                                  struct audio_stream_in **stream_in)
+{
+    struct stub_audio_device *ladev = (struct stub_audio_device *)dev;
+    struct stub_stream_in *in;
+    int ret;
+
+    in = (struct stub_stream_in *)calloc(1, sizeof(struct stub_stream_in));
+    if (!in)
+        return -ENOMEM;
+
+    in->stream.common.get_sample_rate = in_get_sample_rate;
+    in->stream.common.set_sample_rate = in_set_sample_rate;
+    in->stream.common.get_buffer_size = in_get_buffer_size;
+    in->stream.common.get_channels = in_get_channels;
+    in->stream.common.get_format = in_get_format;
+    in->stream.common.set_format = in_set_format;
+    in->stream.common.standby = in_standby;
+    in->stream.common.dump = in_dump;
+    in->stream.common.set_parameters = in_set_parameters;
+    in->stream.common.get_parameters = in_get_parameters;
+    in->stream.set_gain = in_set_gain;
+    in->stream.read = in_read;
+    in->stream.get_input_frames_lost = in_get_input_frames_lost;
+
+    *stream_in = &in->stream;
+    return 0;
+
+err_open:
+    free(in);
+    *stream_in = NULL;
+    return ret;
+}
+
+static void adev_close_input_stream(struct audio_hw_device *dev,
+                                   struct audio_stream_in *in)
+{
+    return;
+}
+
+static int adev_dump(const audio_hw_device_t *device, int fd)
+{
+    return 0;
+}
+
+static int adev_close(hw_device_t *device)
+{
+    free(device);
+    return 0;
+}
+
+static uint32_t adev_get_supported_devices(const struct audio_hw_device *dev)
+{
+    return (/* OUT */
+            AUDIO_DEVICE_OUT_EARPIECE |
+            AUDIO_DEVICE_OUT_SPEAKER |
+            AUDIO_DEVICE_OUT_WIRED_HEADSET |
+            AUDIO_DEVICE_OUT_WIRED_HEADPHONE |
+            AUDIO_DEVICE_OUT_AUX_DIGITAL |
+            AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET |
+            AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET |
+            AUDIO_DEVICE_OUT_ALL_SCO |
+            AUDIO_DEVICE_OUT_DEFAULT |
+            /* IN */
+            AUDIO_DEVICE_IN_COMMUNICATION |
+            AUDIO_DEVICE_IN_AMBIENT |
+            AUDIO_DEVICE_IN_BUILTIN_MIC |
+            AUDIO_DEVICE_IN_WIRED_HEADSET |
+            AUDIO_DEVICE_IN_AUX_DIGITAL |
+            AUDIO_DEVICE_IN_BACK_MIC |
+            AUDIO_DEVICE_IN_ALL_SCO |
+            AUDIO_DEVICE_IN_DEFAULT);
+}
+
+static int adev_open(const hw_module_t* module, const char* name,
+                     hw_device_t** device)
+{
+    struct stub_audio_device *adev;
+    int ret;
+
+    if (strcmp(name, AUDIO_HARDWARE_INTERFACE) != 0)
+        return -EINVAL;
+
+    adev = calloc(1, sizeof(struct stub_audio_device));
+    if (!adev)
+        return -ENOMEM;
+
+    adev->device.common.tag = HARDWARE_DEVICE_TAG;
+    adev->device.common.version = 0;
+    adev->device.common.module = (struct hw_module_t *) module;
+    adev->device.common.close = adev_close;
+
+    adev->device.get_supported_devices = adev_get_supported_devices;
+    adev->device.init_check = adev_init_check;
+    adev->device.set_voice_volume = adev_set_voice_volume;
+    adev->device.set_master_volume = adev_set_master_volume;
+    adev->device.set_mode = adev_set_mode;
+    adev->device.set_mic_mute = adev_set_mic_mute;
+    adev->device.get_mic_mute = adev_get_mic_mute;
+    adev->device.set_parameters = adev_set_parameters;
+    adev->device.get_parameters = adev_get_parameters;
+    adev->device.get_input_buffer_size = adev_get_input_buffer_size;
+    adev->device.open_output_stream = adev_open_output_stream;
+    adev->device.close_output_stream = adev_close_output_stream;
+    adev->device.open_input_stream = adev_open_input_stream;
+    adev->device.close_input_stream = adev_close_input_stream;
+    adev->device.dump = adev_dump;
+
+    *device = &adev->device.common;
+
+    return 0;
+}
+
+static struct hw_module_methods_t hal_module_methods = {
+    .open = adev_open,
+};
+
+struct audio_module HAL_MODULE_INFO_SYM = {
+    .common = {
+        .tag = HARDWARE_MODULE_TAG,
+        .version_major = 1,
+        .version_minor = 0,
+        .id = AUDIO_HARDWARE_MODULE_ID,
+        .name = "Default audio HW HAL",
+        .author = "The Android Open Source Project",
+        .methods = &hal_module_methods,
+    },
+};
diff --git a/modules/audio/audio_policy.c b/modules/audio/audio_policy.c
new file mode 100644
index 0000000..8afef5f
--- /dev/null
+++ b/modules/audio/audio_policy.c
@@ -0,0 +1,318 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+#define LOG_TAG "audio_policy_default"
+//#define LOG_NDEBUG 0
+
+#include <errno.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <hardware/hardware.h>
+#include <system/audio.h>
+#include <hardware/audio_policy.h>
+#include <hardware/audio_policy_hal.h>
+
+struct default_ap_module {
+    struct audio_policy_module module;
+};
+
+struct default_ap_device {
+    struct audio_policy_device device;
+};
+
+struct default_audio_policy {
+    struct audio_policy policy;
+
+    struct audio_policy_service_ops *aps_ops;
+    void *service;
+};
+
+static int ap_set_device_connection_state(struct audio_policy *pol,
+                                          audio_devices_t device,
+                                          audio_policy_dev_state_t state,
+                                          const char *device_address)
+{
+    return -ENOSYS;
+}
+
+static audio_policy_dev_state_t ap_get_device_connection_state(
+                                            const struct audio_policy *pol,
+                                            audio_devices_t device,
+                                            const char *device_address)
+{
+    return AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE;
+}
+
+static void ap_set_phone_state(struct audio_policy *pol, int state)
+{
+}
+
+static void ap_set_ringer_mode(struct audio_policy *pol, uint32_t mode,
+                               uint32_t mask)
+{
+}
+
+static void ap_set_force_use(struct audio_policy *pol,
+                          audio_policy_force_use_t usage,
+                          audio_policy_forced_cfg_t config)
+{
+}
+
+    /* retreive current device category forced for a given usage */
+static audio_policy_forced_cfg_t ap_get_force_use(
+                                               const struct audio_policy *pol,
+                                               audio_policy_force_use_t usage)
+{
+    return AUDIO_POLICY_FORCE_NONE;
+}
+
+/* if can_mute is true, then audio streams that are marked ENFORCED_AUDIBLE
+ * can still be muted. */
+static void ap_set_can_mute_enforced_audible(struct audio_policy *pol,
+                                             bool can_mute)
+{
+}
+
+static int ap_init_check(const struct audio_policy *pol)
+{
+    return 0;
+}
+
+static audio_io_handle_t ap_get_output(struct audio_policy *pol,
+                                       audio_stream_type_t stream,
+                                       uint32_t sampling_rate,
+                                       uint32_t format,
+                                       uint32_t channels,
+                                       audio_policy_output_flags_t flags)
+{
+    return 0;
+}
+
+static int ap_start_output(struct audio_policy *pol, audio_io_handle_t output,
+                           audio_stream_type_t stream, int session)
+{
+    return -ENOSYS;
+}
+
+static int ap_stop_output(struct audio_policy *pol, audio_io_handle_t output,
+                          audio_stream_type_t stream, int session)
+{
+    return -ENOSYS;
+}
+
+static void ap_release_output(struct audio_policy *pol,
+                              audio_io_handle_t output)
+{
+}
+
+static audio_io_handle_t ap_get_input(struct audio_policy *pol, int inputSource,
+                                      uint32_t sampling_rate,
+                                      uint32_t format,
+                                      uint32_t channels,
+                                      audio_in_acoustics_t acoustics)
+{
+    return 0;
+}
+
+static int ap_start_input(struct audio_policy *pol, audio_io_handle_t input)
+{
+    return -ENOSYS;
+}
+
+static int ap_stop_input(struct audio_policy *pol, audio_io_handle_t input)
+{
+    return -ENOSYS;
+}
+
+static void ap_release_input(struct audio_policy *pol, audio_io_handle_t input)
+{
+}
+
+static void ap_init_stream_volume(struct audio_policy *pol,
+                                  audio_stream_type_t stream, int index_min,
+                                  int index_max)
+{
+}
+
+static int ap_set_stream_volume_index(struct audio_policy *pol,
+                                      audio_stream_type_t stream,
+                                      int index)
+{
+    return -ENOSYS;
+}
+
+static int ap_get_stream_volume_index(const struct audio_policy *pol,
+                                      audio_stream_type_t stream,
+                                      int *index)
+{
+    return -ENOSYS;
+}
+
+static uint32_t ap_get_strategy_for_stream(const struct audio_policy *pol,
+                                           audio_stream_type_t stream)
+{
+    return 0;
+}
+
+static uint32_t ap_get_devices_for_stream(const struct audio_policy *pol,
+                                          audio_stream_type_t stream)
+{
+    return 0;
+}
+
+static audio_io_handle_t ap_get_output_for_effect(struct audio_policy *pol,
+                                            struct effect_descriptor_s *desc)
+{
+    return 0;
+}
+
+static int ap_register_effect(struct audio_policy *pol,
+                              struct effect_descriptor_s *desc,
+                              audio_io_handle_t output,
+                              uint32_t strategy,
+                              int session,
+                              int id)
+{
+    return -ENOSYS;
+}
+
+static int ap_unregister_effect(struct audio_policy *pol, int id)
+{
+    return -ENOSYS;
+}
+
+static bool ap_is_stream_active(const struct audio_policy *pol, int stream,
+                                uint32_t in_past_ms)
+{
+    return false;
+}
+
+static int ap_dump(const struct audio_policy *pol, int fd)
+{
+    return -ENOSYS;
+}
+
+static int create_default_ap(const struct audio_policy_device *device,
+                             struct audio_policy_service_ops *aps_ops,
+                             void *service,
+                             struct audio_policy **ap)
+{
+    struct default_ap_device *dev;
+    struct default_audio_policy *dap;
+    int ret;
+
+    *ap = NULL;
+
+    if (!service || !aps_ops)
+        return -EINVAL;
+
+    dap = (struct default_audio_policy *)calloc(1, sizeof(*dap));
+    if (!dap)
+        return -ENOMEM;
+
+    dap->policy.set_device_connection_state = ap_set_device_connection_state;
+    dap->policy.get_device_connection_state = ap_get_device_connection_state;
+    dap->policy.set_phone_state = ap_set_phone_state;
+    dap->policy.set_ringer_mode = ap_set_ringer_mode;
+    dap->policy.set_force_use = ap_set_force_use;
+    dap->policy.get_force_use = ap_get_force_use;
+    dap->policy.set_can_mute_enforced_audible =
+        ap_set_can_mute_enforced_audible;
+    dap->policy.init_check = ap_init_check;
+    dap->policy.get_output = ap_get_output;
+    dap->policy.start_output = ap_start_output;
+    dap->policy.stop_output = ap_stop_output;
+    dap->policy.release_output = ap_release_output;
+    dap->policy.get_input = ap_get_input;
+    dap->policy.start_input = ap_start_input;
+    dap->policy.stop_input = ap_stop_input;
+    dap->policy.release_input = ap_release_input;
+    dap->policy.init_stream_volume = ap_init_stream_volume;
+    dap->policy.set_stream_volume_index = ap_set_stream_volume_index;
+    dap->policy.get_stream_volume_index = ap_get_stream_volume_index;
+    dap->policy.get_strategy_for_stream = ap_get_strategy_for_stream;
+    dap->policy.get_devices_for_stream = ap_get_devices_for_stream;
+    dap->policy.get_output_for_effect = ap_get_output_for_effect;
+    dap->policy.register_effect = ap_register_effect;
+    dap->policy.unregister_effect = ap_unregister_effect;
+    dap->policy.is_stream_active = ap_is_stream_active;
+    dap->policy.dump = ap_dump;
+
+    dap->service = service;
+    dap->aps_ops = aps_ops;
+
+    *ap = &dap->policy;
+    return 0;
+}
+
+static int destroy_default_ap(const struct audio_policy_device *ap_dev,
+                              struct audio_policy *ap)
+{
+    free(ap);
+    return 0;
+}
+
+static int default_ap_dev_close(hw_device_t* device)
+{
+    free(device);
+    return 0;
+}
+
+static int default_ap_dev_open(const hw_module_t* module, const char* name,
+                               hw_device_t** device)
+{
+    struct default_ap_device *dev;
+
+    *device = NULL;
+
+    if (strcmp(name, AUDIO_POLICY_INTERFACE) != 0)
+        return -EINVAL;
+
+    dev = (struct default_ap_device *)calloc(1, sizeof(*dev));
+    if (!dev)
+        return -ENOMEM;
+
+    dev->device.common.tag = HARDWARE_DEVICE_TAG;
+    dev->device.common.version = 0;
+    dev->device.common.module = (hw_module_t *)module;
+    dev->device.common.close = default_ap_dev_close;
+    dev->device.create_audio_policy = create_default_ap;
+    dev->device.destroy_audio_policy = destroy_default_ap;
+
+    *device = &dev->device.common;
+
+    return 0;
+}
+
+static struct hw_module_methods_t default_ap_module_methods = {
+    .open = default_ap_dev_open,
+};
+
+struct default_ap_module HAL_MODULE_INFO_SYM = {
+    .module = {
+        .common = {
+            .tag            = HARDWARE_MODULE_TAG,
+            .version_major  = 1,
+            .version_minor  = 0,
+            .id             = AUDIO_POLICY_HARDWARE_MODULE_ID,
+            .name           = "Default audio policy HAL",
+            .author         = "The Android Open Source Project",
+            .methods        = &default_ap_module_methods,
+        },
+    },
+};
diff --git a/modules/gralloc/Android.mk b/modules/gralloc/Android.mk
index cbfd82b..1e1e05f 100644
--- a/modules/gralloc/Android.mk
+++ b/modules/gralloc/Android.mk
@@ -15,10 +15,10 @@
 
 LOCAL_PATH := $(call my-dir)
 
-# HAL module implemenation, not prelinked and stored in
+# HAL module implemenation stored in
 # hw/<OVERLAY_HARDWARE_MODULE_ID>.<ro.product.board>.so
 include $(CLEAR_VARS)
-LOCAL_PRELINK_MODULE := false
+
 LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
 LOCAL_SHARED_LIBRARIES := liblog libcutils
 
diff --git a/modules/hwcomposer/Android.mk b/modules/hwcomposer/Android.mk
index 233059b..f1e819b 100644
--- a/modules/hwcomposer/Android.mk
+++ b/modules/hwcomposer/Android.mk
@@ -15,13 +15,14 @@
 
 LOCAL_PATH := $(call my-dir)
 
-# HAL module implemenation, not prelinked and stored in
+# HAL module implemenation stored in
 # hw/<OVERLAY_HARDWARE_MODULE_ID>.<ro.product.board>.so
 include $(CLEAR_VARS)
-LOCAL_PRELINK_MODULE := false
+
 LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
 LOCAL_SHARED_LIBRARIES := liblog libEGL
 LOCAL_SRC_FILES := hwcomposer.cpp
 LOCAL_MODULE := hwcomposer.default
 LOCAL_CFLAGS:= -DLOG_TAG=\"hwcomposer\"
+LOCAL_MODULE_TAGS := optional
 include $(BUILD_SHARED_LIBRARY)
diff --git a/modules/hwcomposer/hwcomposer.cpp b/modules/hwcomposer/hwcomposer.cpp
index 939210b..68b7070 100644
--- a/modules/hwcomposer/hwcomposer.cpp
+++ b/modules/hwcomposer/hwcomposer.cpp
@@ -15,7 +15,6 @@
  */
 
 #include <hardware/hardware.h>
-#include <hardware/overlay.h>
 
 #include <fcntl.h>
 #include <errno.h>
diff --git a/modules/overlay/Android.mk b/modules/overlay/Android.mk
index 8b7db26..a2fa0bb 100644
--- a/modules/overlay/Android.mk
+++ b/modules/overlay/Android.mk
@@ -15,10 +15,10 @@
 
 LOCAL_PATH := $(call my-dir)
 
-# HAL module implemenation, not prelinked and stored in
+# HAL module implemenation stored in
 # hw/<OVERLAY_HARDWARE_MODULE_ID>.<ro.product.board>.so
 include $(CLEAR_VARS)
-LOCAL_PRELINK_MODULE := false
+
 LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
 LOCAL_SHARED_LIBRARIES := liblog
 LOCAL_SRC_FILES := overlay.cpp
