Camera2 tests: Update for framework changes

Change-Id: I9ac788cfe9a001ef33bdc52a9e8ba0bdcf3ded2c
diff --git a/tests/camera2/CameraMultiStreamTests.cpp b/tests/camera2/CameraMultiStreamTests.cpp
index 0f8d578..3e29ad6 100644
--- a/tests/camera2/CameraMultiStreamTests.cpp
+++ b/tests/camera2/CameraMultiStreamTests.cpp
@@ -92,7 +92,7 @@
     sp<SurfaceComposerClient> mComposerClient;
     sp<SurfaceControl> mSurfaceControl;
 
-    void CreateOnScreenSurface(sp<ANativeWindow>& surface) {
+    void CreateOnScreenSurface(sp<Surface>& surface) {
         mComposerClient = new SurfaceComposerClient;
         ASSERT_EQ(NO_ERROR, mComposerClient->initCheck());
 
@@ -175,7 +175,7 @@
                 int width,
                 int height,
                 const sp<CameraDeviceBase>& device,
-                CameraStreamParams param, sp<ANativeWindow> surface,
+                CameraStreamParams param, sp<Surface> surface,
                 bool useCpuConsumer)
             : mDevice(device),
               mWidth(width),
@@ -188,11 +188,11 @@
                 mCpuConsumer = new CpuConsumer(consumer, param.mHeapCount);
                 mCpuConsumer->setName(String8(
                         "CameraMultiStreamTest::mCpuConsumer"));
-                mNativeWindow = new Surface(producer);
+                mSurface = new Surface(producer);
             } else {
                 // Render the stream to screen.
                 mCpuConsumer = NULL;
-                mNativeWindow = surface;
+                mSurface = surface;
             }
 
             mFrameListener = new FrameListener();
@@ -207,7 +207,7 @@
          */
         void SetUp() {
             ASSERT_EQ(OK,
-                mDevice->createStream(mNativeWindow,
+                mDevice->createStream(mSurface,
                     mWidth, mHeight, mFormat, HAL_DATASPACE_UNKNOWN,
                     CAMERA3_STREAM_ROTATION_0, &mStreamId));
 
@@ -225,14 +225,14 @@
                 mDevice->deleteStream(mStreamId);
             }
             // Clear producer before consumer.
-            mNativeWindow.clear();
+            mSurface.clear();
             mCpuConsumer.clear();
         }
 
     private:
         sp<FrameListener>       mFrameListener;
         sp<CpuConsumer>         mCpuConsumer;
-        sp<ANativeWindow>       mNativeWindow;
+        sp<Surface>             mSurface;
         sp<CameraDeviceBase>    mDevice;
         int                     mStreamId;
         int                     mWidth;
@@ -334,7 +334,7 @@
             int height,
             const sp<CameraDeviceBase>& device,
             CameraStreamParams param = DEFAULT_STREAM_PARAMETERS,
-            sp<ANativeWindow> surface = NULL,
+            sp<Surface> surface = NULL,
             bool useCpuConsumer = true) {
         param.mFormat = MapAutoFormat(param.mFormat);
         return new CameraStream(width, height, device,
@@ -583,7 +583,7 @@
     // Preview stream: small resolution, render on the screen.
     sp<CameraStream> previewStream;
     {
-        sp<ANativeWindow> surface;
+        sp<Surface> surface;
         ASSERT_NO_FATAL_FAILURE(CreateOnScreenSurface(/*out*/surface));
         previewStream = CreateStream(
                 previewSize.width,
diff --git a/tests/camera2/CameraStreamFixture.h b/tests/camera2/CameraStreamFixture.h
index e234f7e..fc5fb36 100644
--- a/tests/camera2/CameraStreamFixture.h
+++ b/tests/camera2/CameraStreamFixture.h
@@ -131,7 +131,7 @@
         CameraModuleFixture::TearDown();
 
         deleteOutputResolutions();
-        mNativeWindow.clear();
+        mSurface.clear();
         mCpuConsumer.clear();
         mFrameListener.clear();
     }
@@ -250,12 +250,12 @@
         mCpuConsumer = new CpuConsumer(consumer, p.mHeapCount);
         mCpuConsumer->setName(String8("CameraStreamTest::mCpuConsumer"));
 
-        mNativeWindow = new Surface(producer);
+        mSurface = new Surface(producer);
 
         int format = MapAutoFormat(p.mFormat);
 
         ASSERT_EQ(OK,
-            device->createStream(mNativeWindow,
+            device->createStream(mSurface,
                 mWidth, mHeight, format,
                 HAL_DATASPACE_UNKNOWN,
                 CAMERA3_STREAM_ROTATION_0,
@@ -364,7 +364,7 @@
 
     android::sp<FrameListener>       mFrameListener;
     android::sp<CpuConsumer>         mCpuConsumer;
-    android::sp<ANativeWindow>       mNativeWindow;
+    android::sp<Surface>             mSurface;
     KeyedVector<int32_t, Vector<int32_t>* > mOutputResolutions;
 
 private: