diff --git a/services/surfaceflinger/Android.mk b/services/surfaceflinger/Android.mk
index e4fd291..eb45840 100644
--- a/services/surfaceflinger/Android.mk
+++ b/services/surfaceflinger/Android.mk
@@ -3,13 +3,13 @@
 
 LOCAL_SRC_FILES:= \
     Client.cpp                              \
-    DisplayHardware.cpp     				\
+    DisplayDevice.cpp                       \
     EventThread.cpp                         \
     Layer.cpp                               \
     LayerBase.cpp                           \
     LayerDim.cpp                            \
     LayerScreenshot.cpp                     \
-    DisplayHardware/DisplayHardwareBase.cpp \
+    DisplayHardware/DisplayDeviceBase.cpp   \
     DisplayHardware/FramebufferSurface.cpp  \
     DisplayHardware/HWComposer.cpp          \
     DisplayHardware/PowerHAL.cpp            \
diff --git a/services/surfaceflinger/DisplayHardware.cpp b/services/surfaceflinger/DisplayDevice.cpp
similarity index 85%
rename from services/surfaceflinger/DisplayHardware.cpp
rename to services/surfaceflinger/DisplayDevice.cpp
index b468aae..70ce2d9 100644
--- a/services/surfaceflinger/DisplayHardware.cpp
+++ b/services/surfaceflinger/DisplayDevice.cpp
@@ -34,10 +34,10 @@
 #include <hardware/gralloc.h>
 
 #include "DisplayHardware/FramebufferSurface.h"
-#include "DisplayHardware/DisplayHardwareBase.h"
+#include "DisplayHardware/DisplayDeviceBase.h"
 #include "DisplayHardware/HWComposer.h"
 
-#include "DisplayHardware.h"
+#include "DisplayDevice.h"
 #include "GLExtensions.h"
 #include "SurfaceFlinger.h"
 #include "LayerBase.h"
@@ -98,12 +98,12 @@
  *
  */
 
-DisplayHardware::DisplayHardware(
+DisplayDevice::DisplayDevice(
         const sp<SurfaceFlinger>& flinger,
         int display,
         const sp<SurfaceTextureClient>& surface,
         EGLConfig config)
-    : DisplayHardwareBase(display),
+    : DisplayDeviceBase(display),
       mFlinger(flinger),
       mDisplayId(display),
       mNativeWindow(surface),
@@ -114,42 +114,42 @@
     init(config);
 }
 
-DisplayHardware::~DisplayHardware() {
+DisplayDevice::~DisplayDevice() {
 }
 
-float DisplayHardware::getDpiX() const {
+float DisplayDevice::getDpiX() const {
     return mDpiX;
 }
 
-float DisplayHardware::getDpiY() const {
+float DisplayDevice::getDpiY() const {
     return mDpiY;
 }
 
-float DisplayHardware::getDensity() const {
+float DisplayDevice::getDensity() const {
     return mDensity;
 }
 
-float DisplayHardware::getRefreshRate() const {
+float DisplayDevice::getRefreshRate() const {
     return mRefreshRate;
 }
 
-int DisplayHardware::getWidth() const {
+int DisplayDevice::getWidth() const {
     return mDisplayWidth;
 }
 
-int DisplayHardware::getHeight() const {
+int DisplayDevice::getHeight() const {
     return mDisplayHeight;
 }
 
-PixelFormat DisplayHardware::getFormat() const {
+PixelFormat DisplayDevice::getFormat() const {
     return mFormat;
 }
 
-EGLSurface DisplayHardware::getEGLSurface() const {
+EGLSurface DisplayDevice::getEGLSurface() const {
     return mSurface;
 }
 
-status_t DisplayHardware::getInfo(DisplayInfo* info) const {
+status_t DisplayDevice::getInfo(DisplayInfo* info) const {
     info->w = getWidth();
     info->h = getHeight();
     info->xdpi = getDpiX();
@@ -162,7 +162,7 @@
     return NO_ERROR;
 }
 
-void DisplayHardware::init(EGLConfig config)
+void DisplayDevice::init(EGLConfig config)
 {
     ANativeWindow* const window = mNativeWindow.get();
 
@@ -241,14 +241,14 @@
     mPageFlipCount = 0;
 
     // initialize the display orientation transform.
-    DisplayHardware::setOrientation(ISurfaceComposer::eOrientationDefault);
+    DisplayDevice::setOrientation(ISurfaceComposer::eOrientationDefault);
 }
 
-uint32_t DisplayHardware::getPageFlipCount() const {
+uint32_t DisplayDevice::getPageFlipCount() const {
     return mPageFlipCount;
 }
 
-nsecs_t DisplayHardware::getRefreshTimestamp() const {
+nsecs_t DisplayDevice::getRefreshTimestamp() const {
     // this returns the last refresh timestamp.
     // if the last one is not available, we estimate it based on
     // the refresh period and whatever closest timestamp we have.
@@ -257,23 +257,23 @@
     return now - ((now - mLastHwVSync) %  mRefreshPeriod);
 }
 
-nsecs_t DisplayHardware::getRefreshPeriod() const {
+nsecs_t DisplayDevice::getRefreshPeriod() const {
     return mRefreshPeriod;
 }
 
-status_t DisplayHardware::compositionComplete() const {
+status_t DisplayDevice::compositionComplete() const {
     if (mFramebufferSurface == NULL) {
         return NO_ERROR;
     }
     return mFramebufferSurface->compositionComplete();
 }
 
-void DisplayHardware::onVSyncReceived(nsecs_t timestamp) {
+void DisplayDevice::onVSyncReceived(nsecs_t timestamp) {
     Mutex::Autolock _l(mLock);
     mLastHwVSync = timestamp;
 }
 
-void DisplayHardware::flip(const Region& dirty) const
+void DisplayDevice::flip(const Region& dirty) const
 {
     checkGLErrors();
 
@@ -298,19 +298,19 @@
     mPageFlipCount++;
 }
 
-uint32_t DisplayHardware::getFlags() const
+uint32_t DisplayDevice::getFlags() const
 {
     return mFlags;
 }
 
-void DisplayHardware::dump(String8& res) const
+void DisplayDevice::dump(String8& res) const
 {
     if (mFramebufferSurface != NULL) {
         mFramebufferSurface->dump(res);
     }
 }
 
-void DisplayHardware::makeCurrent(const DisplayHardware& hw, EGLContext ctx) {
+void DisplayDevice::makeCurrent(const DisplayDevice& hw, EGLContext ctx) {
     EGLSurface sur = eglGetCurrentSurface(EGL_DRAW);
     if (sur != hw.mSurface) {
         EGLDisplay dpy = eglGetCurrentDisplay();
@@ -320,7 +320,7 @@
 
 // ----------------------------------------------------------------------------
 
-void DisplayHardware::setVisibleLayersSortedByZ(const Vector< sp<LayerBase> >& layers) {
+void DisplayDevice::setVisibleLayersSortedByZ(const Vector< sp<LayerBase> >& layers) {
     mVisibleLayersSortedByZ = layers;
     size_t count = layers.size();
     for (size_t i=0 ; i<count ; i++) {
@@ -330,17 +330,17 @@
     }
 }
 
-Vector< sp<LayerBase> > DisplayHardware::getVisibleLayersSortedByZ() const {
+Vector< sp<LayerBase> > DisplayDevice::getVisibleLayersSortedByZ() const {
     return mVisibleLayersSortedByZ;
 }
 
-bool DisplayHardware::getSecureLayerVisible() const {
+bool DisplayDevice::getSecureLayerVisible() const {
     return mSecureLayerVisible;
 }
 
 // ----------------------------------------------------------------------------
 
-status_t DisplayHardware::orientationToTransfrom(
+status_t DisplayDevice::orientationToTransfrom(
         int orientation, int w, int h, Transform* tr)
 {
     uint32_t flags = 0;
@@ -364,11 +364,11 @@
     return NO_ERROR;
 }
 
-status_t DisplayHardware::setOrientation(int orientation) {
+status_t DisplayDevice::setOrientation(int orientation) {
     int w = mDisplayWidth;
     int h = mDisplayHeight;
 
-    DisplayHardware::orientationToTransfrom(
+    DisplayDevice::orientationToTransfrom(
             orientation, w, h, &mGlobalTransform);
     if (orientation & ISurfaceComposer::eOrientationSwapMask) {
         int tmp = w;
diff --git a/services/surfaceflinger/DisplayHardware.h b/services/surfaceflinger/DisplayDevice.h
similarity index 94%
rename from services/surfaceflinger/DisplayHardware.h
rename to services/surfaceflinger/DisplayDevice.h
index a638dc0..c9caffb 100644
--- a/services/surfaceflinger/DisplayHardware.h
+++ b/services/surfaceflinger/DisplayDevice.h
@@ -32,7 +32,7 @@
 
 #include "Transform.h"
 
-#include "DisplayHardware/DisplayHardwareBase.h"
+#include "DisplayHardware/DisplayDeviceBase.h"
 
 namespace android {
 
@@ -42,7 +42,7 @@
 class SurfaceFlinger;
 class SurfaceTextureClient;
 
-class DisplayHardware : public DisplayHardwareBase
+class DisplayDevice : public DisplayDeviceBase
 {
 public:
     // region in layer-stack space
@@ -57,13 +57,13 @@
         SWAP_RECTANGLE  = 0x00080000,
     };
 
-    DisplayHardware(
+    DisplayDevice(
             const sp<SurfaceFlinger>& flinger,
             int dpy,
             const sp<SurfaceTextureClient>& surface,
             EGLConfig config);
 
-    virtual ~DisplayHardware();
+    virtual ~DisplayDevice();
 
     // Flip the front and back buffers if the back buffer is "dirty".  Might
     // be instantaneous, might involve copying the frame buffer around.
@@ -107,7 +107,7 @@
     }
     inline Rect bounds() const { return getBounds(); }
 
-    static void makeCurrent(const DisplayHardware& hw, EGLContext ctx);
+    static void makeCurrent(const DisplayDevice& hw, EGLContext ctx);
 
 private:
     void init(EGLConfig config);
diff --git a/services/surfaceflinger/DisplayHardware/DisplayHardwareBase.cpp b/services/surfaceflinger/DisplayHardware/DisplayDeviceBase.cpp
similarity index 72%
rename from services/surfaceflinger/DisplayHardware/DisplayHardwareBase.cpp
rename to services/surfaceflinger/DisplayHardware/DisplayDeviceBase.cpp
index 4141181..e0a4de6 100644
--- a/services/surfaceflinger/DisplayHardware/DisplayHardwareBase.cpp
+++ b/services/surfaceflinger/DisplayHardware/DisplayDeviceBase.cpp
@@ -17,31 +17,31 @@
 #include <stdint.h>
 #include <sys/types.h>
 
-#include "DisplayHardware/DisplayHardwareBase.h"
+#include "DisplayHardware/DisplayDeviceBase.h"
 
 // ----------------------------------------------------------------------------
 namespace android {
 
-DisplayHardwareBase::DisplayHardwareBase(uint32_t displayIndex) {
+DisplayDeviceBase::DisplayDeviceBase(uint32_t displayIndex) {
     mScreenAcquired = true;
 }
 
-DisplayHardwareBase::~DisplayHardwareBase() {
+DisplayDeviceBase::~DisplayDeviceBase() {
 }
 
-bool DisplayHardwareBase::canDraw() const {
+bool DisplayDeviceBase::canDraw() const {
     return mScreenAcquired;
 }
 
-void DisplayHardwareBase::releaseScreen() const {
+void DisplayDeviceBase::releaseScreen() const {
     mScreenAcquired = false;
 }
 
-void DisplayHardwareBase::acquireScreen() const {
+void DisplayDeviceBase::acquireScreen() const {
     mScreenAcquired = true;
 }
 
-bool DisplayHardwareBase::isScreenAcquired() const {
+bool DisplayDeviceBase::isScreenAcquired() const {
     return mScreenAcquired;
 }
 
diff --git a/services/surfaceflinger/DisplayHardware/DisplayHardwareBase.h b/services/surfaceflinger/DisplayHardware/DisplayDeviceBase.h
similarity index 90%
rename from services/surfaceflinger/DisplayHardware/DisplayHardwareBase.h
rename to services/surfaceflinger/DisplayHardware/DisplayDeviceBase.h
index e6eb2b5..9432cf2 100644
--- a/services/surfaceflinger/DisplayHardware/DisplayHardwareBase.h
+++ b/services/surfaceflinger/DisplayHardware/DisplayDeviceBase.h
@@ -21,10 +21,10 @@
 
 namespace android {
 
-class DisplayHardwareBase {
+class DisplayDeviceBase {
 public:
-    DisplayHardwareBase(uint32_t displayIndex);
-    ~DisplayHardwareBase();
+    DisplayDeviceBase(uint32_t displayIndex);
+    ~DisplayDeviceBase();
 
     // console management
     void releaseScreen() const;
diff --git a/services/surfaceflinger/EventThread.cpp b/services/surfaceflinger/EventThread.cpp
index 3d79577..9b61fa9 100644
--- a/services/surfaceflinger/EventThread.cpp
+++ b/services/surfaceflinger/EventThread.cpp
@@ -27,7 +27,6 @@
 #include <utils/String8.h>
 #include <utils/Trace.h>
 
-#include "DisplayHardware.h"
 #include "EventThread.h"
 #include "SurfaceFlinger.h"
 
diff --git a/services/surfaceflinger/EventThread.h b/services/surfaceflinger/EventThread.h
index 2f10cdb..a71d985 100644
--- a/services/surfaceflinger/EventThread.h
+++ b/services/surfaceflinger/EventThread.h
@@ -27,7 +27,6 @@
 #include <utils/threads.h>
 #include <utils/SortedVector.h>
 
-#include "DisplayHardware.h"
 #include "DisplayHardware/PowerHAL.h"
 
 // ---------------------------------------------------------------------------
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 815a6f9..97f3cd4 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -36,7 +36,7 @@
 #include <gui/Surface.h>
 
 #include "clz.h"
-#include "DisplayHardware.h"
+#include "DisplayDevice.h"
 #include "GLExtensions.h"
 #include "Layer.h"
 #include "SurfaceFlinger.h"
@@ -78,9 +78,9 @@
     }
 
     if (mFrameLatencyNeeded) {
-        // we need a DisplayHardware for debugging only right now
-        // XXX: should this be called per DisplayHardware?
-        const DisplayHardware& hw(mFlinger->getDefaultDisplayHardware());
+        // we need a DisplayDevice for debugging only right now
+        // XXX: should this be called per DisplayDevice?
+        const DisplayDevice& hw(mFlinger->getDefaultDisplayDevice());
         mFrameStats[mFrameLatencyOffset].timestamp = mSurfaceTexture->getTimestamp();
         mFrameStats[mFrameLatencyOffset].set = systemTime();
         mFrameStats[mFrameLatencyOffset].vsync = hw.getRefreshTimestamp();
@@ -248,7 +248,7 @@
 }
 
 void Layer::setGeometry(
-        const DisplayHardware& hw,
+        const DisplayDevice& hw,
         HWComposer::HWCLayerInterface& layer)
 {
     LayerBaseClient::setGeometry(hw, layer);
@@ -307,7 +307,7 @@
     layer.setAcquireFenceFd(fenceFd);
 }
 
-void Layer::onDraw(const DisplayHardware& hw, const Region& clip) const
+void Layer::onDraw(const DisplayDevice& hw, const Region& clip) const
 {
     ATRACE_CALL();
 
@@ -723,7 +723,7 @@
 {
     LayerBaseClient::dumpStats(result, buffer, SIZE);
     const size_t o = mFrameLatencyOffset;
-    const DisplayHardware& hw(mFlinger->getDefaultDisplayHardware());
+    const DisplayDevice& hw(mFlinger->getDefaultDisplayDevice());
     const nsecs_t period = hw.getRefreshPeriod();
     result.appendFormat("%lld\n", period);
     for (size_t i=0 ; i<128 ; i++) {
@@ -764,7 +764,7 @@
         // apply to all displays.
         // This is why we use the default display here. This is not an
         // oversight.
-        const DisplayHardware& hw(mFlinger->getDefaultDisplayHardware());
+        const DisplayDevice& hw(mFlinger->getDefaultDisplayDevice());
         const Transform& planeTransform(hw.getTransform());
         orientation = planeTransform.getOrientation();
         if (orientation & Transform::ROT_INVALID) {
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 239250d..22a441d 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -64,12 +64,12 @@
     bool isFixedSize() const;
 
     // LayerBase interface
-    virtual void setGeometry(const DisplayHardware& hw,
+    virtual void setGeometry(const DisplayDevice& hw,
             HWComposer::HWCLayerInterface& layer);
     virtual void setPerFrameData(HWComposer::HWCLayerInterface& layer);
     virtual void setAcquireFence(HWComposer::HWCLayerInterface& layer);
 
-    virtual void onDraw(const DisplayHardware& hw, const Region& clip) const;
+    virtual void onDraw(const DisplayDevice& hw, const Region& clip) const;
     virtual uint32_t doTransaction(uint32_t transactionFlags);
     virtual Region latchBuffer(bool& recomputeVisibleRegions);
     virtual bool isOpaque() const;
diff --git a/services/surfaceflinger/LayerBase.cpp b/services/surfaceflinger/LayerBase.cpp
index f654445..a92bf52 100644
--- a/services/surfaceflinger/LayerBase.cpp
+++ b/services/surfaceflinger/LayerBase.cpp
@@ -33,7 +33,7 @@
 #include "LayerBase.h"
 #include "Layer.h"
 #include "SurfaceFlinger.h"
-#include "DisplayHardware.h"
+#include "DisplayDevice.h"
 
 namespace android {
 
@@ -223,7 +223,7 @@
     return flags;
 }
 
-void LayerBase::computeGeometry(const DisplayHardware& hw, LayerMesh* mesh) const
+void LayerBase::computeGeometry(const DisplayDevice& hw, LayerMesh* mesh) const
 {
     const Layer::State& s(drawingState());
     const Transform tr(hw.getTransform() * s.transform);
@@ -260,7 +260,7 @@
 }
 
 void LayerBase::setGeometry(
-        const DisplayHardware& hw,
+        const DisplayDevice& hw,
         HWComposer::HWCLayerInterface& layer)
 {
     layer.setDefaultState();
@@ -309,19 +309,19 @@
     return mFiltering;
 }
 
-void LayerBase::draw(const DisplayHardware& hw, const Region& clip) const
+void LayerBase::draw(const DisplayDevice& hw, const Region& clip) const
 {
     onDraw(hw, clip);
 }
 
-void LayerBase::drawForSreenShot(const DisplayHardware& hw)
+void LayerBase::drawForSreenShot(const DisplayDevice& hw)
 {
     setFiltering(true);
     onDraw( hw, Region(hw.bounds()) );
     setFiltering(false);
 }
 
-void LayerBase::clearWithOpenGL(const DisplayHardware& hw, const Region& clip,
+void LayerBase::clearWithOpenGL(const DisplayDevice& hw, const Region& clip,
         GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) const
 {
     const uint32_t fbHeight = hw.getHeight();
@@ -338,12 +338,12 @@
     glDrawArrays(GL_TRIANGLE_FAN, 0, mesh.getVertexCount());
 }
 
-void LayerBase::clearWithOpenGL(const DisplayHardware& hw, const Region& clip) const
+void LayerBase::clearWithOpenGL(const DisplayDevice& hw, const Region& clip) const
 {
     clearWithOpenGL(hw, clip, 0,0,0,0);
 }
 
-void LayerBase::drawWithOpenGL(const DisplayHardware& hw, const Region& clip) const
+void LayerBase::drawWithOpenGL(const DisplayDevice& hw, const Region& clip) const
 {
     const uint32_t fbHeight = hw.getHeight();
     const State& s(drawingState());
diff --git a/services/surfaceflinger/LayerBase.h b/services/surfaceflinger/LayerBase.h
index 7bf634e..5aab4fc 100644
--- a/services/surfaceflinger/LayerBase.h
+++ b/services/surfaceflinger/LayerBase.h
@@ -33,7 +33,6 @@
 
 #include <private/gui/LayerState.h>
 
-#include "DisplayHardware.h"
 #include "Transform.h"
 #include "DisplayHardware/HWComposer.h"
 
@@ -42,7 +41,7 @@
 // ---------------------------------------------------------------------------
 
 class Client;
-class DisplayHardware;
+class DisplayDevice;
 class GraphicBuffer;
 class Layer;
 class LayerBaseClient;
@@ -124,7 +123,7 @@
             uint32_t getTransactionFlags(uint32_t flags);
             uint32_t setTransactionFlags(uint32_t flags);
 
-            void computeGeometry(const DisplayHardware& hw, LayerMesh* mesh) const;
+            void computeGeometry(const DisplayDevice& hw, LayerMesh* mesh) const;
             Rect computeBounds() const;
 
 
@@ -133,7 +132,7 @@
 
     virtual const char* getTypeId() const { return "LayerBase"; }
 
-    virtual void setGeometry(const DisplayHardware& hw,
+    virtual void setGeometry(const DisplayDevice& hw,
             HWComposer::HWCLayerInterface& layer);
     virtual void setPerFrameData(HWComposer::HWCLayerInterface& layer);
     virtual void setAcquireFence(HWComposer::HWCLayerInterface& layer);
@@ -144,13 +143,13 @@
      * Typically this method is not overridden, instead implement onDraw()
      * to perform the actual drawing.  
      */
-    virtual void draw(const DisplayHardware& hw, const Region& clip) const;
-    virtual void drawForSreenShot(const DisplayHardware& hw);
+    virtual void draw(const DisplayDevice& hw, const Region& clip) const;
+    virtual void drawForSreenShot(const DisplayDevice& hw);
     
     /**
      * onDraw - draws the surface.
      */
-    virtual void onDraw(const DisplayHardware& hw, const Region& clip) const = 0;
+    virtual void onDraw(const DisplayDevice& hw, const Region& clip) const = 0;
     
     /**
      * initStates - called just after construction
@@ -241,12 +240,12 @@
     inline  const State&    currentState() const    { return mCurrentState; }
     inline  State&          currentState()          { return mCurrentState; }
 
-    void clearWithOpenGL(const DisplayHardware& hw, const Region& clip) const;
+    void clearWithOpenGL(const DisplayDevice& hw, const Region& clip) const;
 
 protected:
-          void clearWithOpenGL(const DisplayHardware& hw, const Region& clip,
+          void clearWithOpenGL(const DisplayDevice& hw, const Region& clip,
                   GLclampf r, GLclampf g, GLclampf b, GLclampf alpha) const;
-          void drawWithOpenGL(const DisplayHardware& hw, const Region& clip) const;
+          void drawWithOpenGL(const DisplayDevice& hw, const Region& clip) const;
 
           void setFiltering(bool filtering);
           bool getFiltering() const;
diff --git a/services/surfaceflinger/LayerDim.cpp b/services/surfaceflinger/LayerDim.cpp
index 5c37d01..b78396e 100644
--- a/services/surfaceflinger/LayerDim.cpp
+++ b/services/surfaceflinger/LayerDim.cpp
@@ -25,7 +25,7 @@
 
 #include "LayerDim.h"
 #include "SurfaceFlinger.h"
-#include "DisplayHardware.h"
+#include "DisplayDevice.h"
 
 namespace android {
 // ---------------------------------------------------------------------------
@@ -40,7 +40,7 @@
 {
 }
 
-void LayerDim::onDraw(const DisplayHardware& hw, const Region& clip) const
+void LayerDim::onDraw(const DisplayDevice& hw, const Region& clip) const
 {
     const State& s(drawingState());
     if (s.alpha>0) {
diff --git a/services/surfaceflinger/LayerDim.h b/services/surfaceflinger/LayerDim.h
index 2d9eaef..a0ec593 100644
--- a/services/surfaceflinger/LayerDim.h
+++ b/services/surfaceflinger/LayerDim.h
@@ -36,7 +36,7 @@
                         const sp<Client>& client);
         virtual ~LayerDim();
 
-    virtual void onDraw(const DisplayHardware& hw, const Region& clip) const;
+    virtual void onDraw(const DisplayDevice& hw, const Region& clip) const;
     virtual bool isOpaque() const         { return false; }
     virtual bool isSecure() const         { return false; }
     virtual bool isProtectedByApp() const { return false; }
diff --git a/services/surfaceflinger/LayerScreenshot.cpp b/services/surfaceflinger/LayerScreenshot.cpp
index bed8206..5b7cf68 100644
--- a/services/surfaceflinger/LayerScreenshot.cpp
+++ b/services/surfaceflinger/LayerScreenshot.cpp
@@ -25,7 +25,7 @@
 
 #include "LayerScreenshot.h"
 #include "SurfaceFlinger.h"
-#include "DisplayHardware.h"
+#include "DisplayDevice.h"
 
 
 namespace android {
@@ -105,7 +105,7 @@
     return LayerBaseClient::doTransaction(flags);
 }
 
-void LayerScreenshot::onDraw(const DisplayHardware& hw, const Region& clip) const
+void LayerScreenshot::onDraw(const DisplayDevice& hw, const Region& clip) const
 {
     const State& s(drawingState());
     if (s.alpha>0) {
diff --git a/services/surfaceflinger/LayerScreenshot.h b/services/surfaceflinger/LayerScreenshot.h
index 0ddb376..64c0281 100644
--- a/services/surfaceflinger/LayerScreenshot.h
+++ b/services/surfaceflinger/LayerScreenshot.h
@@ -43,7 +43,7 @@
 
     virtual void initStates(uint32_t w, uint32_t h, uint32_t flags);
     virtual uint32_t doTransaction(uint32_t flags);
-    virtual void onDraw(const DisplayHardware& hw, const Region& clip) const;
+    virtual void onDraw(const DisplayDevice& hw, const Region& clip) const;
     virtual bool isOpaque() const         { return false; }
     virtual bool isSecure() const         { return false; }
     virtual bool isProtectedByApp() const { return false; }
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 7081d58..7caf099 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -50,7 +50,7 @@
 
 #include "clz.h"
 #include "DdmConnection.h"
-#include "DisplayHardware.h"
+#include "DisplayDevice.h"
 #include "Client.h"
 #include "EventThread.h"
 #include "GLExtensions.h"
@@ -370,8 +370,8 @@
     mEGLContext = createGLContext(mEGLDisplay, mEGLConfig);
 
     // initialize our main display hardware
-    DisplayHardware* const hw = new DisplayHardware(this, 0, anw, mEGLConfig);
-    mDisplayHardwares[0] = hw;
+    DisplayDevice* const hw = new DisplayDevice(this, 0, anw, mEGLConfig);
+    mDisplayDevices[0] = hw;
 
     //  initialize OpenGL ES
     EGLSurface surface = hw->getEGLSurface();
@@ -457,7 +457,7 @@
     if (uint32_t(dpy) >= 2) {
         return BAD_INDEX;
     }
-    const DisplayHardware& hw(getDefaultDisplayHardware());
+    const DisplayDevice& hw(getDefaultDisplayDevice());
     return hw.getInfo(info);
 }
 
@@ -468,7 +468,7 @@
 }
 
 void SurfaceFlinger::connectDisplay(const sp<ISurfaceTexture> display) {
-    const DisplayHardware& hw(getDefaultDisplayHardware());
+    const DisplayDevice& hw(getDefaultDisplayDevice());
     EGLSurface result = EGL_NO_SURFACE;
     EGLSurface old_surface = EGL_NO_SURFACE;
     sp<SurfaceTextureClient> stc;
@@ -540,7 +540,7 @@
 }
 
 void SurfaceFlinger::onVSyncReceived(int dpy, nsecs_t timestamp) {
-    DisplayHardware& hw(const_cast<DisplayHardware&>(getDisplayHardware(dpy)));
+    DisplayDevice& hw(const_cast<DisplayDevice&>(getDisplayDevice(dpy)));
     hw.onVSyncReceived(timestamp);
     mEventThread->onVSyncReceived(dpy, timestamp);
 }
@@ -588,7 +588,7 @@
 
         const LayerVector& currentLayers(mDrawingState.layersSortedByZ);
         for (int dpy=0 ; dpy<1 ; dpy++) {  // TODO: iterate through all displays
-            DisplayHardware& hw(const_cast<DisplayHardware&>(getDisplayHardware(dpy)));
+            DisplayDevice& hw(const_cast<DisplayDevice&>(getDisplayDevice(dpy)));
 
             Region opaqueRegion;
             Region dirtyRegion;
@@ -618,7 +618,7 @@
         const bool workListsDirty = mHwWorkListDirty;
         mHwWorkListDirty = false;
         for (int dpy=0 ; dpy<1 ; dpy++) {  // TODO: iterate through all displays
-            DisplayHardware& hw(const_cast<DisplayHardware&>(getDisplayHardware(dpy)));
+            DisplayDevice& hw(const_cast<DisplayDevice&>(getDisplayDevice(dpy)));
             const Vector< sp<LayerBase> >& currentLayers(hw.getVisibleLayersSortedByZ());
             const size_t count = currentLayers.size();
 
@@ -649,7 +649,7 @@
 
     const bool repaintEverything = android_atomic_and(0, &mRepaintEverything);
     for (int dpy=0 ; dpy<1 ; dpy++) {  // TODO: iterate through all displays
-        DisplayHardware& hw(const_cast<DisplayHardware&>(getDisplayHardware(dpy)));
+        DisplayDevice& hw(const_cast<DisplayDevice&>(getDisplayDevice(dpy)));
 
         // transform the dirty region into this screen's coordinate space
         const Transform& planeTransform(hw.getTransform());
@@ -695,7 +695,7 @@
             glMatrixMode(GL_MODELVIEW);
             glLoadIdentity();
 
-            DisplayHardware& hw(const_cast<DisplayDevice&>(getDisplayHardware(0)));
+            DisplayDevice& hw(const_cast<DisplayDevice&>(getDisplayDevice(0)));
             const Vector< sp<LayerBase> >& layers( hw.getVisibleLayersSortedByZ() );
             const size_t count = layers.size();
             for (size_t i=0 ; i<count ; ++i) {
@@ -728,7 +728,7 @@
     HWComposer& hwc(getHwComposer());
 
     for (int dpy=0 ; dpy<1 ; dpy++) {  // TODO: iterate through all displays
-        DisplayHardware& hw(const_cast<DisplayHardware&>(getDisplayHardware(dpy)));
+        DisplayDevice& hw(const_cast<DisplayDevice&>(getDisplayDevice(dpy)));
         if (hwc.initCheck() == NO_ERROR) {
             const Vector< sp<LayerBase> >& currentLayers(hw.getVisibleLayersSortedByZ());
             const size_t count = currentLayers.size();
@@ -745,11 +745,11 @@
 
     if (hwc.initCheck() == NO_ERROR) {
         // FIXME: eventually commit() won't take arguments
-        hwc.commit(mEGLDisplay, getDefaultDisplayHardware().getEGLSurface());
+        hwc.commit(mEGLDisplay, getDefaultDisplayDevice().getEGLSurface());
     }
 
     for (int dpy=0 ; dpy<1 ; dpy++) {  // TODO: iterate through all displays
-        DisplayHardware& hw(const_cast<DisplayHardware&>(getDisplayHardware(dpy)));
+        DisplayDevice& hw(const_cast<DisplayDevice&>(getDisplayDevice(dpy)));
         const Vector< sp<LayerBase> >& currentLayers(hw.getVisibleLayersSortedByZ());
         const size_t count = currentLayers.size();
         if (hwc.initCheck() == NO_ERROR) {
@@ -829,7 +829,7 @@
             // and invalidate everything.
 
             const int dpy = 0; // FIXME: should be a parameter
-            DisplayHardware& hw(const_cast<DisplayHardware&>(getDisplayHardware(dpy)));
+            DisplayDevice& hw(const_cast<DisplayDevice&>(getDisplayDevice(dpy)));
             hw.setOrientation(mCurrentState.orientation);
             hw.dirtyRegion.set(hw.bounds());
 
@@ -1015,7 +1015,7 @@
         const Region& dirty) {
     // FIXME: update the dirty region of all displays
     // presenting this layer's layer stack.
-    DisplayHardware& hw(const_cast<DisplayHardware&>(getDisplayHardware(0)));
+    DisplayDevice& hw(const_cast<DisplayDevice&>(getDisplayDevice(0)));
     hw.dirtyRegion.orSelf(dirty);
 }
 
@@ -1060,7 +1060,7 @@
     }
 }
 
-void SurfaceFlinger::handleRepaint(const DisplayHardware& hw,
+void SurfaceFlinger::handleRepaint(const DisplayDevice& hw,
         const Region& inDirtyRegion)
 {
     ATRACE_CALL();
@@ -1075,17 +1075,17 @@
     }
 
     uint32_t flags = hw.getFlags();
-    if (flags & DisplayHardware::SWAP_RECTANGLE) {
+    if (flags & DisplayDevice::SWAP_RECTANGLE) {
         // we can redraw only what's dirty, but since SWAP_RECTANGLE only
         // takes a rectangle, we must make sure to update that whole
         // rectangle in that case
         dirtyRegion.set(hw.swapRegion.bounds());
     } else {
-        if (flags & DisplayHardware::PARTIAL_UPDATES) {
+        if (flags & DisplayDevice::PARTIAL_UPDATES) {
             // We need to redraw the rectangle that will be updated
             // (pushed to the framebuffer).
             // This is needed because PARTIAL_UPDATES only takes one
-            // rectangle instead of a region (see DisplayHardware::flip())
+            // rectangle instead of a region (see DisplayDevice::flip())
             dirtyRegion.set(hw.swapRegion.bounds());
         } else {
             // we need to redraw everything (the whole screen)
@@ -1100,7 +1100,7 @@
     hw.swapRegion.orSelf(dirtyRegion);
 }
 
-void SurfaceFlinger::composeSurfaces(const DisplayHardware& hw, const Region& dirty)
+void SurfaceFlinger::composeSurfaces(const DisplayDevice& hw, const Region& dirty)
 {
     HWComposer& hwc(getHwComposer());
     HWComposer::LayerListIterator cur = hwc.begin();
@@ -1109,7 +1109,7 @@
     const size_t fbLayerCount = hwc.getLayerCount(HWC_FRAMEBUFFER);  // FIXME: this should be per display
     if (cur==end || fbLayerCount) {
 
-        DisplayHardware::makeCurrent(hw, mEGLContext);
+        DisplayDevice::makeCurrent(hw, mEGLContext);
 
         // set the frame buffer
         glMatrixMode(GL_MODELVIEW);
@@ -1164,7 +1164,7 @@
     }
 }
 
-void SurfaceFlinger::debugFlashRegions(const DisplayHardware& hw,
+void SurfaceFlinger::debugFlashRegions(const DisplayDevice& hw,
         const Region& dirtyRegion)
 {
     const uint32_t flags = hw.getFlags();
@@ -1173,8 +1173,8 @@
         return;
     }
 
-    if (!(flags & DisplayHardware::SWAP_RECTANGLE)) {
-        const Region repaint((flags & DisplayHardware::PARTIAL_UPDATES) ?
+    if (!(flags & DisplayDevice::SWAP_RECTANGLE)) {
+        const Region repaint((flags & DisplayDevice::PARTIAL_UPDATES) ?
                 dirtyRegion.bounds() : hw.bounds());
         composeSurfaces(hw, repaint);
     }
@@ -1569,7 +1569,7 @@
 
 void SurfaceFlinger::onScreenAcquired() {
     ALOGD("Screen about to return, flinger = %p", this);
-    const DisplayHardware& hw(getDefaultDisplayHardware()); // XXX: this should be per DisplayHardware
+    const DisplayDevice& hw(getDefaultDisplayDevice()); // XXX: this should be per DisplayDevice
     getHwComposer().acquire();
     hw.acquireScreen();
     mEventThread->onScreenAcquired();
@@ -1582,7 +1582,7 @@
 
 void SurfaceFlinger::onScreenReleased() {
     ALOGD("About to give-up screen, flinger = %p", this);
-    const DisplayHardware& hw(getDefaultDisplayHardware()); // XXX: this should be per DisplayHardware
+    const DisplayDevice& hw(getDefaultDisplayDevice()); // XXX: this should be per DisplayDevice
     if (hw.isScreenAcquired()) {
         mEventThread->onScreenReleased();
         hw.releaseScreen();
@@ -1782,7 +1782,7 @@
     snprintf(buffer, SIZE, "SurfaceFlinger global state:\n");
     result.append(buffer);
 
-    const DisplayHardware& hw(getDefaultDisplayHardware());
+    const DisplayDevice& hw(getDefaultDisplayDevice());
     const GLExtensions& extensions(GLExtensions::getInstance());
     snprintf(buffer, SIZE, "GLES: %s, %s, %s\n",
             extensions.getVendor(),
@@ -1949,7 +1949,7 @@
                 return NO_ERROR;
             case 1013: {
                 Mutex::Autolock _l(mStateLock);
-                const DisplayHardware& hw(getDefaultDisplayHardware());
+                const DisplayDevice& hw(getDefaultDisplayDevice());
                 reply->writeInt32(hw.getPageFlipCount());
             }
             return NO_ERROR;
@@ -1981,7 +1981,7 @@
         return INVALID_OPERATION;
 
     // get screen geometry
-    const DisplayHardware& hw(getDisplayHardware(dpy));
+    const DisplayDevice& hw(getDisplayDevice(dpy));
     const uint32_t hw_w = hw.getWidth();
     const uint32_t hw_h = hw.getHeight();
     GLfloat u = 1;
@@ -2072,7 +2072,7 @@
 status_t SurfaceFlinger::electronBeamOffAnimationImplLocked()
 {
     // get screen geometry
-    const DisplayHardware& hw(getDefaultDisplayHardware());
+    const DisplayDevice& hw(getDefaultDisplayDevice());
     const uint32_t hw_w = hw.getWidth();
     const uint32_t hw_h = hw.getHeight();
     const Region screenBounds(hw.getBounds());
@@ -2254,7 +2254,7 @@
 
 
     // get screen geometry
-    const DisplayHardware& hw(getDefaultDisplayHardware());
+    const DisplayDevice& hw(getDefaultDisplayDevice());
     const uint32_t hw_w = hw.getWidth();
     const uint32_t hw_h = hw.getHeight();
     const Region screenBounds(hw.bounds());
@@ -2403,7 +2403,7 @@
 {
     ATRACE_CALL();
 
-    DisplayHardware& hw(const_cast<DisplayHardware&>(getDefaultDisplayHardware()));
+    DisplayDevice& hw(const_cast<DisplayDevice&>(getDefaultDisplayDevice()));
     if (!hw.canDraw()) {
         // we're already off
         return NO_ERROR;
@@ -2463,7 +2463,7 @@
 
 status_t SurfaceFlinger::turnElectronBeamOnImplLocked(int32_t mode)
 {
-    DisplayHardware& hw(const_cast<DisplayHardware&>(getDefaultDisplayHardware()));
+    DisplayDevice& hw(const_cast<DisplayDevice&>(getDefaultDisplayDevice()));
     if (hw.canDraw()) {
         // we're already on
         return NO_ERROR;
@@ -2525,7 +2525,7 @@
     }
 
     // get screen geometry
-    const DisplayHardware& hw(getDisplayHardware(dpy));
+    const DisplayDevice& hw(getDisplayDevice(dpy));
     const uint32_t hw_w = hw.getWidth();
     const uint32_t hw_h = hw.getHeight();
 
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index 447eece..6091e33 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -56,7 +56,7 @@
 
 class Client;
 class DisplayEventConnection;
-class DisplayHardware;
+class DisplayDevice;
 class EventThread;
 class Layer;
 class LayerBase;
@@ -118,8 +118,8 @@
         GLfloat* uOut, GLfloat* vOut);
 
     // returns the default Display
-    const DisplayHardware& getDefaultDisplayHardware() const {
-        return getDisplayHardware(0);
+    const DisplayDevice& getDefaultDisplayDevice() const {
+        return getDisplayDevice(0);
     }
 
     // utility function to delete a texture on the main thread
@@ -237,7 +237,7 @@
     void handlePageFlip();
 
     void handleRefresh();
-    void handleRepaint(const DisplayHardware& hw, const Region& dirtyRegion);
+    void handleRepaint(const DisplayDevice& hw, const Region& dirtyRegion);
 
     /* ------------------------------------------------------------------------
      * Transactions
@@ -316,8 +316,8 @@
     /* ------------------------------------------------------------------------
      * Display and layer stack management
      */
-    const DisplayHardware& getDisplayHardware(DisplayID dpy) const {
-        return *mDisplayHardwares[dpy];
+    const DisplayDevice& getDisplayDevice(DisplayID dpy) const {
+        return *mDisplayDevices[dpy];
     }
 
     // mark a region of a layer stack dirty. this updates the dirty
@@ -338,7 +338,7 @@
             uint32_t layerStack,
             Region& dirtyRegion, Region& opaqueRegion);
     void postFramebuffer();
-    void composeSurfaces(const DisplayHardware& hw, const Region& dirty);
+    void composeSurfaces(const DisplayDevice& hw, const Region& dirty);
     void drawWormhole(const Region& region) const;
     GLuint getProtectedTexName() const {
         return mProtectedTexName;
@@ -347,7 +347,7 @@
     /* ------------------------------------------------------------------------
      * Debugging & dumpsys
      */
-    void debugFlashRegions(const DisplayHardware& hw, const Region& dirtyReg);
+    void debugFlashRegions(const DisplayDevice& hw, const Region& dirtyReg);
     void listLayersLocked(const Vector<String16>& args, size_t& index,
         String8& result, char* buffer, size_t SIZE) const;
     void dumpStatsLocked(const Vector<String16>& args, size_t& index,
@@ -370,7 +370,7 @@
     Vector<sp<LayerBase> > mLayersPendingRemoval;
 
     // protected by mStateLock (but we could use another lock)
-    DisplayHardware* mDisplayHardwares[1];
+    DisplayDevice* mDisplayDevices[1];
     bool mLayersRemoved;
 
     // access must be protected by mInvalidateLock
