camera2: Remove ProCamera.

Bug: 19186859
Change-Id: I4aaadb53db65b479f92cbb3c05329d1e40317900
diff --git a/services/camera/libcameraservice/Android.mk b/services/camera/libcameraservice/Android.mk
index de841c8..9c60911 100644
--- a/services/camera/libcameraservice/Android.mk
+++ b/services/camera/libcameraservice/Android.mk
@@ -42,7 +42,6 @@
     api1/client2/CaptureSequencer.cpp \
     api1/client2/ZslProcessor3.cpp \
     api2/CameraDeviceClient.cpp \
-    api_pro/ProCamera2Client.cpp \
     device2/Camera2Device.cpp \
     device3/Camera3Device.cpp \
     device3/Camera3Stream.cpp \
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index 55f7a40..58512eb 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -52,7 +52,6 @@
 #include "CameraService.h"
 #include "api1/CameraClient.h"
 #include "api1/Camera2Client.h"
-#include "api_pro/ProCamera2Client.h"
 #include "api2/CameraDeviceClient.h"
 #include "utils/CameraTraces.h"
 #include "CameraDeviceFactory.h"
@@ -1066,16 +1065,6 @@
     return NO_ERROR;
 }
 
-status_t CameraService::connectPro(const sp<IProCameraCallbacks>& cameraCb,
-                                   int cameraId,
-                                   const String16& clientPackageName,
-                                   int clientUid,
-                                   /*out*/
-                                   sp<IProCameraUser>& device) {
-    ALOGE("%s: Unimplemented, please use connectDevice", __FUNCTION__);
-    return INVALID_OPERATION;
-}
-
 status_t CameraService::connectDevice(
         const sp<ICameraDeviceCallbacks>& cameraCb,
         int cameraId,
@@ -1428,7 +1417,6 @@
     // Permission checks
     switch (code) {
         case BnCameraService::CONNECT:
-        case BnCameraService::CONNECT_PRO:
         case BnCameraService::CONNECT_DEVICE:
         case BnCameraService::CONNECT_LEGACY:
             const int pid = getCallingPid();
@@ -1710,33 +1698,6 @@
 }
 
 // ----------------------------------------------------------------------------
-//                  IProCamera
-// ----------------------------------------------------------------------------
-
-CameraService::ProClient::ProClient(const sp<CameraService>& cameraService,
-        const sp<IProCameraCallbacks>& remoteCallback,
-        const String16& clientPackageName,
-        int cameraId,
-        int cameraFacing,
-        int clientPid,
-        uid_t clientUid,
-        int servicePid)
-        : CameraService::BasicClient(cameraService, IInterface::asBinder(remoteCallback),
-                clientPackageName, cameraId, cameraFacing,
-                clientPid,  clientUid, servicePid)
-{
-    mRemoteCallback = remoteCallback;
-}
-
-CameraService::ProClient::~ProClient() {
-}
-
-void CameraService::ProClient::notifyError(ICameraDeviceCallbacks::CameraErrorCode errorCode,
-        const CaptureResultExtras& resultExtras) {
-    mRemoteCallback->notifyCallback(CAMERA_MSG_ERROR, CAMERA_ERROR_RELEASED, 0);
-}
-
-// ----------------------------------------------------------------------------
 //                  CameraState
 // ----------------------------------------------------------------------------
 
diff --git a/services/camera/libcameraservice/CameraService.h b/services/camera/libcameraservice/CameraService.h
index 53420e5..53f1c72 100644
--- a/services/camera/libcameraservice/CameraService.h
+++ b/services/camera/libcameraservice/CameraService.h
@@ -27,8 +27,6 @@
 
 #include <camera/ICamera.h>
 #include <camera/ICameraClient.h>
-#include <camera/IProCameraUser.h>
-#include <camera/IProCameraCallbacks.h>
 #include <camera/camera2/ICameraDeviceUser.h>
 #include <camera/camera2/ICameraDeviceCallbacks.h>
 #include <camera/VendorTagDescriptor.h>
@@ -127,11 +125,6 @@
             /*out*/
             sp<ICamera>& device);
 
-    virtual status_t connectPro(const sp<IProCameraCallbacks>& cameraCb,
-            int cameraId, const String16& clientPackageName, int clientUid,
-            /*out*/
-            sp<IProCameraUser>& device);
-
     virtual status_t connectDevice(
             const sp<ICameraDeviceCallbacks>& cameraCb,
             int cameraId,
@@ -195,7 +188,7 @@
         // virtual inheritance
         virtual sp<IBinder> asBinderWrapper() = 0;
 
-        // Return the remote callback binder object (e.g. IProCameraCallbacks)
+        // Return the remote callback binder object (e.g. ICameraDeviceCallbacks)
         sp<IBinder>         getRemote() {
             return mRemoteBinder;
         }
@@ -330,51 +323,6 @@
 
     }; // class Client
 
-    class ProClient : public BnProCameraUser, public BasicClient {
-    public:
-        typedef IProCameraCallbacks TCamCallbacks;
-
-        ProClient(const sp<CameraService>& cameraService,
-                const sp<IProCameraCallbacks>& remoteCallback,
-                const String16& clientPackageName,
-                int cameraId,
-                int cameraFacing,
-                int clientPid,
-                uid_t clientUid,
-                int servicePid);
-
-        virtual ~ProClient();
-
-        const sp<IProCameraCallbacks>& getRemoteCallback() {
-            return mRemoteCallback;
-        }
-
-        /***
-            IProCamera implementation
-         ***/
-        virtual status_t      connect(const sp<IProCameraCallbacks>& callbacks)
-                                                                            = 0;
-        virtual status_t      exclusiveTryLock() = 0;
-        virtual status_t      exclusiveLock() = 0;
-        virtual status_t      exclusiveUnlock() = 0;
-
-        virtual bool          hasExclusiveLock() = 0;
-
-        // Note that the callee gets a copy of the metadata.
-        virtual int           submitRequest(camera_metadata_t* metadata,
-                                            bool streaming = false) = 0;
-        virtual status_t      cancelRequest(int requestId) = 0;
-
-        // Callbacks from camera service
-        virtual void          onExclusiveLockStolen() = 0;
-
-        virtual void          notifyError(ICameraDeviceCallbacks::CameraErrorCode errorCode,
-                                          const CaptureResultExtras& resultExtras);
-    protected:
-
-        sp<IProCameraCallbacks> mRemoteCallback;
-    }; // class ProClient
-
     typedef std::shared_ptr<resource_policy::ClientDescriptor<String8,
             sp<CameraService::BasicClient>>> DescriptorPtr;
 
diff --git a/services/camera/libcameraservice/api2/CameraDeviceClient.cpp b/services/camera/libcameraservice/api2/CameraDeviceClient.cpp
index 0e2311c..8587e0e 100644
--- a/services/camera/libcameraservice/api2/CameraDeviceClient.cpp
+++ b/services/camera/libcameraservice/api2/CameraDeviceClient.cpp
@@ -645,9 +645,6 @@
     }
 }
 
-// TODO: refactor the code below this with IProCameraUser.
-// it's 100% copy-pasted, so lets not change it right now to make it easier.
-
 void CameraDeviceClient::detachDevice() {
     if (mDevice == 0) return;
 
diff --git a/services/camera/libcameraservice/api_pro/ProCamera2Client.cpp b/services/camera/libcameraservice/api_pro/ProCamera2Client.cpp
deleted file mode 100644
index a977494..0000000
--- a/services/camera/libcameraservice/api_pro/ProCamera2Client.cpp
+++ /dev/null
@@ -1,445 +0,0 @@
-/*
- * Copyright (C) 2013 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 "ProCamera2Client"
-#define ATRACE_TAG ATRACE_TAG_CAMERA
-//#define LOG_NDEBUG 0
-
-#include <utils/Log.h>
-#include <utils/Trace.h>
-
-#include <cutils/properties.h>
-#include <gui/Surface.h>
-#include <gui/Surface.h>
-
-#include "api_pro/ProCamera2Client.h"
-#include "common/CameraDeviceBase.h"
-
-namespace android {
-using namespace camera2;
-
-// Interface used by CameraService
-
-ProCamera2Client::ProCamera2Client(const sp<CameraService>& cameraService,
-                                   const sp<IProCameraCallbacks>& remoteCallback,
-                                   const String16& clientPackageName,
-                                   int cameraId,
-                                   int cameraFacing,
-                                   int clientPid,
-                                   uid_t clientUid,
-                                   int servicePid) :
-    Camera2ClientBase(cameraService, remoteCallback, clientPackageName,
-                cameraId, cameraFacing, clientPid, clientUid, servicePid)
-{
-    ATRACE_CALL();
-    ALOGI("ProCamera %d: Opened", cameraId);
-
-    mExclusiveLock = false;
-}
-
-status_t ProCamera2Client::initialize(CameraModule *module)
-{
-    ATRACE_CALL();
-    status_t res;
-
-    res = Camera2ClientBase::initialize(module);
-    if (res != OK) {
-        return res;
-    }
-
-    String8 threadName;
-    mFrameProcessor = new FrameProcessorBase(mDevice);
-    threadName = String8::format("PC2-%d-FrameProc", mCameraId);
-    mFrameProcessor->run(threadName.string());
-
-    mFrameProcessor->registerListener(FRAME_PROCESSOR_LISTENER_MIN_ID,
-                                      FRAME_PROCESSOR_LISTENER_MAX_ID,
-                                      /*listener*/this);
-
-    return OK;
-}
-
-ProCamera2Client::~ProCamera2Client() {
-}
-
-status_t ProCamera2Client::exclusiveTryLock() {
-    ATRACE_CALL();
-    ALOGV("%s", __FUNCTION__);
-
-    Mutex::Autolock icl(mBinderSerializationLock);
-    SharedCameraCallbacks::Lock l(mSharedCameraCallbacks);
-
-    if (!mDevice.get()) return PERMISSION_DENIED;
-
-    if (!mExclusiveLock) {
-        mExclusiveLock = true;
-
-        if (mRemoteCallback != NULL) {
-            mRemoteCallback->onLockStatusChanged(
-                              IProCameraCallbacks::LOCK_ACQUIRED);
-        }
-
-        ALOGV("%s: exclusive lock acquired", __FUNCTION__);
-
-        return OK;
-    }
-
-    // TODO: have a PERMISSION_DENIED case for when someone else owns the lock
-
-    // don't allow recursive locking
-    ALOGW("%s: exclusive lock already exists - recursive locking is not"
-          "allowed", __FUNCTION__);
-
-    return ALREADY_EXISTS;
-}
-
-status_t ProCamera2Client::exclusiveLock() {
-    ATRACE_CALL();
-    ALOGV("%s", __FUNCTION__);
-
-    Mutex::Autolock icl(mBinderSerializationLock);
-    SharedCameraCallbacks::Lock l(mSharedCameraCallbacks);
-
-    if (!mDevice.get()) return PERMISSION_DENIED;
-
-    /**
-     * TODO: this should asynchronously 'wait' until the lock becomes available
-     * if another client already has an exclusive lock.
-     *
-     * once we have proper sharing support this will need to do
-     * more than just return immediately
-     */
-    if (!mExclusiveLock) {
-        mExclusiveLock = true;
-
-        if (mRemoteCallback != NULL) {
-            mRemoteCallback->onLockStatusChanged(IProCameraCallbacks::LOCK_ACQUIRED);
-        }
-
-        ALOGV("%s: exclusive lock acquired", __FUNCTION__);
-
-        return OK;
-    }
-
-    // don't allow recursive locking
-    ALOGW("%s: exclusive lock already exists - recursive locking is not allowed"
-                                                                , __FUNCTION__);
-    return ALREADY_EXISTS;
-}
-
-status_t ProCamera2Client::exclusiveUnlock() {
-    ATRACE_CALL();
-    ALOGV("%s", __FUNCTION__);
-
-    Mutex::Autolock icl(mBinderSerializationLock);
-    SharedCameraCallbacks::Lock l(mSharedCameraCallbacks);
-
-    // don't allow unlocking if we have no lock
-    if (!mExclusiveLock) {
-        ALOGW("%s: cannot unlock, no lock was held in the first place",
-              __FUNCTION__);
-        return BAD_VALUE;
-    }
-
-    mExclusiveLock = false;
-    if (mRemoteCallback != NULL ) {
-        mRemoteCallback->onLockStatusChanged(
-                                       IProCameraCallbacks::LOCK_RELEASED);
-    }
-    ALOGV("%s: exclusive lock released", __FUNCTION__);
-
-    return OK;
-}
-
-bool ProCamera2Client::hasExclusiveLock() {
-    Mutex::Autolock icl(mBinderSerializationLock);
-    return mExclusiveLock;
-}
-
-void ProCamera2Client::onExclusiveLockStolen() {
-    ALOGV("%s: ProClient lost exclusivity (id %d)",
-          __FUNCTION__, mCameraId);
-
-    Mutex::Autolock icl(mBinderSerializationLock);
-    SharedCameraCallbacks::Lock l(mSharedCameraCallbacks);
-
-    if (mExclusiveLock && mRemoteCallback.get() != NULL) {
-        mRemoteCallback->onLockStatusChanged(
-                                       IProCameraCallbacks::LOCK_STOLEN);
-    }
-
-    mExclusiveLock = false;
-
-    //TODO: we should not need to detach the device, merely reset it.
-    detachDevice();
-}
-
-status_t ProCamera2Client::submitRequest(camera_metadata_t* request,
-                                         bool streaming) {
-    ATRACE_CALL();
-    ALOGV("%s", __FUNCTION__);
-
-    Mutex::Autolock icl(mBinderSerializationLock);
-
-    if (!mDevice.get()) return DEAD_OBJECT;
-
-    if (!mExclusiveLock) {
-        return PERMISSION_DENIED;
-    }
-
-    CameraMetadata metadata(request);
-
-    if (!enforceRequestPermissions(metadata)) {
-        return PERMISSION_DENIED;
-    }
-
-    if (streaming) {
-        return mDevice->setStreamingRequest(metadata);
-    } else {
-        return mDevice->capture(metadata);
-    }
-
-    // unreachable. thx gcc for a useless warning
-    return OK;
-}
-
-status_t ProCamera2Client::cancelRequest(int requestId) {
-    (void)requestId;
-    ATRACE_CALL();
-    ALOGV("%s", __FUNCTION__);
-
-    Mutex::Autolock icl(mBinderSerializationLock);
-
-    if (!mDevice.get()) return DEAD_OBJECT;
-
-    if (!mExclusiveLock) {
-        return PERMISSION_DENIED;
-    }
-
-    // TODO: implement
-    ALOGE("%s: not fully implemented yet", __FUNCTION__);
-    return INVALID_OPERATION;
-}
-
-status_t ProCamera2Client::deleteStream(int streamId) {
-    ATRACE_CALL();
-    ALOGV("%s (streamId = 0x%x)", __FUNCTION__, streamId);
-
-    status_t res;
-    if ( (res = checkPid(__FUNCTION__) ) != OK) return res;
-
-    Mutex::Autolock icl(mBinderSerializationLock);
-
-    if (!mDevice.get()) return DEAD_OBJECT;
-    mDevice->clearStreamingRequest();
-
-    status_t code;
-    if ((code = mDevice->waitUntilDrained()) != OK) {
-        ALOGE("%s: waitUntilDrained failed with code 0x%x", __FUNCTION__, code);
-    }
-
-    return mDevice->deleteStream(streamId);
-}
-
-status_t ProCamera2Client::createStream(int width, int height, int format,
-                      const sp<IGraphicBufferProducer>& bufferProducer,
-                      /*out*/
-                      int* streamId)
-{
-    if (streamId) {
-        *streamId = -1;
-    }
-
-    ATRACE_CALL();
-    ALOGV("%s (w = %d, h = %d, f = 0x%x)", __FUNCTION__, width, height, format);
-
-    status_t res;
-    if ( (res = checkPid(__FUNCTION__) ) != OK) return res;
-
-    Mutex::Autolock icl(mBinderSerializationLock);
-
-    if (!mDevice.get()) return DEAD_OBJECT;
-
-    sp<IBinder> binder;
-    sp<ANativeWindow> window;
-    if (bufferProducer != 0) {
-        binder = IInterface::asBinder(bufferProducer);
-        window = new Surface(bufferProducer);
-    }
-
-    return mDevice->createStream(window, width, height, format,
-                                 HAL_DATASPACE_UNKNOWN, CAMERA3_STREAM_ROTATION_0,
-                                 streamId);
-}
-
-// Create a request object from a template.
-// -- Caller owns the newly allocated metadata
-status_t ProCamera2Client::createDefaultRequest(int templateId,
-                             /*out*/
-                              camera_metadata** request)
-{
-    ATRACE_CALL();
-    ALOGV("%s (templateId = 0x%x)", __FUNCTION__, templateId);
-
-    if (request) {
-        *request = NULL;
-    }
-
-    status_t res;
-    if ( (res = checkPid(__FUNCTION__) ) != OK) return res;
-
-    Mutex::Autolock icl(mBinderSerializationLock);
-
-    if (!mDevice.get()) return DEAD_OBJECT;
-
-    CameraMetadata metadata;
-    if ( (res = mDevice->createDefaultRequest(templateId, &metadata) ) == OK) {
-        *request = metadata.release();
-    }
-
-    return res;
-}
-
-status_t ProCamera2Client::getCameraInfo(int cameraId,
-                                         /*out*/
-                                         camera_metadata** info)
-{
-    if (cameraId != mCameraId) {
-        return INVALID_OPERATION;
-    }
-
-    Mutex::Autolock icl(mBinderSerializationLock);
-
-    if (!mDevice.get()) return DEAD_OBJECT;
-
-    CameraMetadata deviceInfo = mDevice->info();
-    *info = deviceInfo.release();
-
-    return OK;
-}
-
-status_t ProCamera2Client::dump(int fd, const Vector<String16>& args) {
-    String8 result;
-    result.appendFormat("ProCamera2Client[%d] (%p) PID: %d, dump:\n",
-            mCameraId,
-            (getRemoteCallback() != NULL ?
-                    IInterface::asBinder(getRemoteCallback()).get() : NULL),
-            mClientPid);
-    result.append("  State:\n");
-    write(fd, result.string(), result.size());
-
-    // TODO: print dynamic/request section from most recent requests
-    mFrameProcessor->dump(fd, args);
-    return dumpDevice(fd, args);
-}
-
-// IProCameraUser interface
-
-void ProCamera2Client::detachDevice() {
-    if (mDevice == 0) return;
-
-    ALOGV("Camera %d: Stopping processors", mCameraId);
-
-    mFrameProcessor->removeListener(FRAME_PROCESSOR_LISTENER_MIN_ID,
-                                    FRAME_PROCESSOR_LISTENER_MAX_ID,
-                                    /*listener*/this);
-    mFrameProcessor->requestExit();
-    ALOGV("Camera %d: Waiting for threads", mCameraId);
-    mFrameProcessor->join();
-    ALOGV("Camera %d: Disconnecting device", mCameraId);
-
-    // WORKAROUND: HAL refuses to disconnect while there's streams in flight
-    {
-        mDevice->clearStreamingRequest();
-
-        status_t code;
-        if ((code = mDevice->waitUntilDrained()) != OK) {
-            ALOGE("%s: waitUntilDrained failed with code 0x%x", __FUNCTION__,
-                  code);
-        }
-    }
-
-    Camera2ClientBase::detachDevice();
-}
-
-void ProCamera2Client::onResultAvailable(const CaptureResult& result) {
-    ATRACE_CALL();
-    ALOGV("%s", __FUNCTION__);
-
-    Mutex::Autolock icl(mBinderSerializationLock);
-    SharedCameraCallbacks::Lock l(mSharedCameraCallbacks);
-
-    if (mRemoteCallback != NULL) {
-        CameraMetadata tmp(result.mMetadata);
-        camera_metadata_t* meta = tmp.release();
-        ALOGV("%s: meta = %p ", __FUNCTION__, meta);
-        mRemoteCallback->onResultReceived(result.mResultExtras.requestId, meta);
-        tmp.acquire(meta);
-    }
-}
-
-bool ProCamera2Client::enforceRequestPermissions(CameraMetadata& metadata) {
-
-    const int pid = IPCThreadState::self()->getCallingPid();
-    const int selfPid = getpid();
-    camera_metadata_entry_t entry;
-
-    /**
-     * Mixin default important security values
-     * - android.led.transmit = defaulted ON
-     */
-    CameraMetadata staticInfo = mDevice->info();
-    entry = staticInfo.find(ANDROID_LED_AVAILABLE_LEDS);
-    for(size_t i = 0; i < entry.count; ++i) {
-        uint8_t led = entry.data.u8[i];
-
-        switch(led) {
-            case ANDROID_LED_AVAILABLE_LEDS_TRANSMIT: {
-                uint8_t transmitDefault = ANDROID_LED_TRANSMIT_ON;
-                if (!metadata.exists(ANDROID_LED_TRANSMIT)) {
-                    metadata.update(ANDROID_LED_TRANSMIT,
-                                    &transmitDefault, 1);
-                }
-                break;
-            }
-        }
-    }
-
-    // We can do anything!
-    if (pid == selfPid) {
-        return true;
-    }
-
-    /**
-     * Permission check special fields in the request
-     * - android.led.transmit = android.permission.CAMERA_DISABLE_TRANSMIT
-     */
-    entry = metadata.find(ANDROID_LED_TRANSMIT);
-    if (entry.count > 0 && entry.data.u8[0] != ANDROID_LED_TRANSMIT_ON) {
-        String16 permissionString =
-            String16("android.permission.CAMERA_DISABLE_TRANSMIT_LED");
-        if (!checkCallingPermission(permissionString)) {
-            const int uid = IPCThreadState::self()->getCallingUid();
-            ALOGE("Permission Denial: "
-                  "can't disable transmit LED pid=%d, uid=%d", pid, uid);
-            return false;
-        }
-    }
-
-    return true;
-}
-
-} // namespace android
diff --git a/services/camera/libcameraservice/api_pro/ProCamera2Client.h b/services/camera/libcameraservice/api_pro/ProCamera2Client.h
deleted file mode 100644
index 7f5f6ac..0000000
--- a/services/camera/libcameraservice/api_pro/ProCamera2Client.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Copyright (C) 2013 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_SERVERS_CAMERA_PROCAMERA2CLIENT_H
-#define ANDROID_SERVERS_CAMERA_PROCAMERA2CLIENT_H
-
-#include "CameraService.h"
-#include "common/FrameProcessorBase.h"
-#include "common/Camera2ClientBase.h"
-#include "device2/Camera2Device.h"
-#include "camera/CaptureResult.h"
-
-namespace android {
-
-class IMemory;
-/**
- * Implements the binder IProCameraUser API,
- * meant for HAL2-level private API access.
- */
-class ProCamera2Client :
-        public Camera2ClientBase<CameraService::ProClient>,
-        public camera2::FrameProcessorBase::FilteredListener
-{
-public:
-    /**
-     * IProCameraUser interface (see IProCameraUser for details)
-     */
-    virtual status_t      exclusiveTryLock();
-    virtual status_t      exclusiveLock();
-    virtual status_t      exclusiveUnlock();
-
-    virtual bool          hasExclusiveLock();
-
-    // Note that the callee gets a copy of the metadata.
-    virtual int           submitRequest(camera_metadata_t* metadata,
-                                        bool streaming = false);
-    virtual status_t      cancelRequest(int requestId);
-
-    virtual status_t      deleteStream(int streamId);
-
-    virtual status_t      createStream(
-            int width,
-            int height,
-            int format,
-            const sp<IGraphicBufferProducer>& bufferProducer,
-            /*out*/
-            int* streamId);
-
-    // Create a request object from a template.
-    // -- Caller owns the newly allocated metadata
-    virtual status_t      createDefaultRequest(int templateId,
-                                               /*out*/
-                                               camera_metadata** request);
-
-    // Get the static metadata for the camera
-    // -- Caller owns the newly allocated metadata
-    virtual status_t      getCameraInfo(int cameraId,
-                                        /*out*/
-                                        camera_metadata** info);
-
-    /**
-     * Interface used by CameraService
-     */
-
-    ProCamera2Client(const sp<CameraService>& cameraService,
-            const sp<IProCameraCallbacks>& remoteCallback,
-            const String16& clientPackageName,
-            int cameraId,
-            int cameraFacing,
-            int clientPid,
-            uid_t clientUid,
-            int servicePid);
-    virtual ~ProCamera2Client();
-
-    virtual status_t      initialize(CameraModule *module);
-
-    virtual status_t      dump(int fd, const Vector<String16>& args);
-
-    // Callbacks from camera service
-    virtual void onExclusiveLockStolen();
-
-    /**
-     * Interface used by independent components of ProCamera2Client.
-     */
-
-protected:
-    /** FilteredListener implementation **/
-    virtual void onResultAvailable(const CaptureResult& result);
-
-    virtual void          detachDevice();
-
-private:
-    /** IProCameraUser interface-related private members */
-
-    /** Preview callback related members */
-    sp<camera2::FrameProcessorBase> mFrameProcessor;
-    static const int32_t FRAME_PROCESSOR_LISTENER_MIN_ID = 0;
-    static const int32_t FRAME_PROCESSOR_LISTENER_MAX_ID = 0x7fffffffL;
-
-    /** Utility members */
-    bool enforceRequestPermissions(CameraMetadata& metadata);
-
-    // Whether or not we have an exclusive lock on the device
-    // - if no we can't modify the request queue.
-    // note that creating/deleting streams we own is still OK
-    bool mExclusiveLock;
-};
-
-}; // namespace android
-
-#endif
diff --git a/services/camera/libcameraservice/common/Camera2ClientBase.cpp b/services/camera/libcameraservice/common/Camera2ClientBase.cpp
index 0415d67..c0c2314 100644
--- a/services/camera/libcameraservice/common/Camera2ClientBase.cpp
+++ b/services/camera/libcameraservice/common/Camera2ClientBase.cpp
@@ -337,7 +337,6 @@
     mRemoteCallback.clear();
 }
 
-template class Camera2ClientBase<CameraService::ProClient>;
 template class Camera2ClientBase<CameraService::Client>;
 template class Camera2ClientBase<CameraDeviceClientBase>;
 
diff --git a/services/camera/libcameraservice/common/Camera2ClientBase.h b/services/camera/libcameraservice/common/Camera2ClientBase.h
index eb21d55..168ea0a 100644
--- a/services/camera/libcameraservice/common/Camera2ClientBase.h
+++ b/services/camera/libcameraservice/common/Camera2ClientBase.h
@@ -36,7 +36,7 @@
     typedef typename TClientBase::TCamCallbacks TCamCallbacks;
 
     /**
-     * Base binder interface (see ICamera/IProCameraUser for details)
+     * Base binder interface (see ICamera/ICameraDeviceUser for details)
      */
     virtual status_t      connect(const sp<TCamCallbacks>& callbacks);
     virtual void          disconnect();