Merge "Prints out how long it takes to generate each section."
diff --git a/cmds/servicemanager/binder.c b/cmds/servicemanager/binder.c
index 6eecee1..3d14451 100644
--- a/cmds/servicemanager/binder.c
+++ b/cmds/servicemanager/binder.c
@@ -104,7 +104,7 @@
         return NULL;
     }
 
-    bs->fd = open("/dev/binder", O_RDWR);
+    bs->fd = open("/dev/binder", O_RDWR | O_CLOEXEC);
     if (bs->fd < 0) {
         fprintf(stderr,"binder: cannot open device (%s)\n",
                 strerror(errno));
diff --git a/include/gui/Surface.h b/include/gui/Surface.h
index f9fc6df..bcc3fff 100644
--- a/include/gui/Surface.h
+++ b/include/gui/Surface.h
@@ -112,6 +112,11 @@
     // See IGraphicBufferProducer::getNextFrameNumber
     uint64_t getNextFrameNumber() const;
 
+    /* Set the scaling mode to be used with a Surface.
+     * See NATIVE_WINDOW_SET_SCALING_MODE and its parameters
+     * in <system/window.h>. */
+    int setScalingMode(int mode);
+
 protected:
     virtual ~Surface();
 
@@ -177,7 +182,6 @@
     virtual int setBuffersDimensions(uint32_t width, uint32_t height);
     virtual int setBuffersUserDimensions(uint32_t width, uint32_t height);
     virtual int setBuffersFormat(PixelFormat format);
-    virtual int setScalingMode(int mode);
     virtual int setBuffersTransform(uint32_t transform);
     virtual int setBuffersStickyTransform(uint32_t transform);
     virtual int setBuffersTimestamp(int64_t timestamp);
diff --git a/libs/binder/ProcessState.cpp b/libs/binder/ProcessState.cpp
index 821ab6c..33fe26c 100644
--- a/libs/binder/ProcessState.cpp
+++ b/libs/binder/ProcessState.cpp
@@ -310,9 +310,8 @@
 
 static int open_driver()
 {
-    int fd = open("/dev/binder", O_RDWR);
+    int fd = open("/dev/binder", O_RDWR | O_CLOEXEC);
     if (fd >= 0) {
-        fcntl(fd, F_SETFD, FD_CLOEXEC);
         int vers = 0;
         status_t result = ioctl(fd, BINDER_VERSION, &vers);
         if (result == -1) {
diff --git a/libs/binder/tests/binderDriverInterfaceTest.cpp b/libs/binder/tests/binderDriverInterfaceTest.cpp
index 315f349..0277550 100644
--- a/libs/binder/tests/binderDriverInterfaceTest.cpp
+++ b/libs/binder/tests/binderDriverInterfaceTest.cpp
@@ -34,7 +34,7 @@
             int ret;
             uint32_t max_threads = 0;
 
-            m_binderFd = open(BINDER_DEV_NAME, O_RDWR | O_NONBLOCK);
+            m_binderFd = open(BINDER_DEV_NAME, O_RDWR | O_NONBLOCK | O_CLOEXEC);
             ASSERT_GE(m_binderFd, 0);
             m_buffer = mmap(NULL, 64*1024, PROT_READ, MAP_SHARED, m_binderFd, 0);
             ASSERT_NE(m_buffer, (void *)NULL);
diff --git a/libs/gui/GLConsumer.cpp b/libs/gui/GLConsumer.cpp
index 39a7ae3..e1abd45 100644
--- a/libs/gui/GLConsumer.cpp
+++ b/libs/gui/GLConsumer.cpp
@@ -294,7 +294,6 @@
         mCurrentTextureImage = mReleasedTexImage;
         mCurrentCrop.makeInvalid();
         mCurrentTransform = 0;
-        mCurrentScalingMode = NATIVE_WINDOW_SCALING_MODE_FREEZE;
         mCurrentTimestamp = 0;
         mCurrentFence = Fence::NO_FENCE;
 
diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp
index 7578a3d..b816ff3 100644
--- a/libs/gui/Surface.cpp
+++ b/libs/gui/Surface.cpp
@@ -929,6 +929,7 @@
         case NATIVE_WINDOW_SCALING_MODE_FREEZE:
         case NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW:
         case NATIVE_WINDOW_SCALING_MODE_SCALE_CROP:
+        case NATIVE_WINDOW_SCALING_MODE_NO_SCALE_CROP:
             break;
         default:
             ALOGE("unknown scaling mode: %d", mode);
diff --git a/services/inputflinger/host/inputflinger.rc b/services/inputflinger/host/inputflinger.rc
index ae71ee5..4130ddc 100644
--- a/services/inputflinger/host/inputflinger.rc
+++ b/services/inputflinger/host/inputflinger.rc
@@ -1,5 +1,5 @@
 service inputflinger /system/bin/inputflinger
     class main
     user system
-    group input
+    group input wakelock
 #    onrestart restart zygote