| From 7f357fe17ae21f459306ea544ef24b083d41bf0a Mon Sep 17 00:00:00 2001 |
| From: Jon West <electrikjesus@gmail.com> |
| Date: Wed, 17 Apr 2019 20:42:36 -0400 |
| Subject: [PATCH 5/6] Revert "CameraService: Support calling addStates in |
| enumerateProviders" |
| |
| This reverts commit 2fa8357eeacc88f87c49c7457c94f679cb3b6495. |
| |
| Conflicts: |
| services/camera/libcameraservice/Android.mk |
| |
| Change-Id: I75c6d1ace163fdba66019b6ab100ed65afec9872 |
| --- |
| services/camera/libcameraservice/Android.mk | 5 ----- |
| .../camera/libcameraservice/CameraService.cpp | 17 ----------------- |
| 2 files changed, 22 deletions(-) |
| |
| diff --git a/services/camera/libcameraservice/Android.mk b/services/camera/libcameraservice/Android.mk |
| index 2b3096a55..f16ba7818 100644 |
| --- a/services/camera/libcameraservice/Android.mk |
| +++ b/services/camera/libcameraservice/Android.mk |
| @@ -111,11 +111,6 @@ endif |
| ifneq ($(TARGET_FACE_UNLOCK_CAMERA_ID),) |
| LOCAL_CFLAGS += -DFACE_UNLOCK_CAMERA_ID=$(TARGET_FACE_UNLOCK_CAMERA_ID) |
| endif |
| - |
| -ifneq ($(TARGET_CAMERA_NEEDS_ADD_STATES_IN_ENUMERATE),) |
| - LOCAL_CFLAGS += -DCAMERA_NEEDS_ADD_STATES_IN_ENUMERATE |
| -endif |
| - |
| LOCAL_MODULE:= libcameraservice |
| |
| include $(BUILD_SHARED_LIBRARY) |
| diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp |
| index 607e2d23b..157f769a3 100644 |
| --- a/services/camera/libcameraservice/CameraService.cpp |
| +++ b/services/camera/libcameraservice/CameraService.cpp |
| @@ -181,21 +181,6 @@ status_t CameraService::enumerateProviders() { |
| |
| for (auto& cameraId : deviceIds) { |
| String8 id8 = String8(cameraId.c_str()); |
| - |
| -#ifdef CAMERA_NEEDS_ADD_STATES_IN_ENUMERATE |
| - bool cameraFound = false; |
| - { |
| - Mutex::Autolock lock(mCameraStatesLock); |
| - auto iter = mCameraStates.find(id8); |
| - if (iter != mCameraStates.end()) { |
| - cameraFound = true; |
| - } |
| - } |
| - if (!cameraFound) { |
| - addStates(id8); |
| - } |
| -#endif |
| - |
| onDeviceStatusChanged(id8, CameraDeviceStatus::PRESENT); |
| } |
| |
| @@ -294,10 +279,8 @@ void CameraService::onDeviceStatusChanged(const String8& id, |
| ALOGI("%s: Unknown camera ID %s, a new camera is added", |
| __FUNCTION__, id.string()); |
| |
| -#ifndef CAMERA_NEEDS_ADD_STATES_IN_ENUMERATE |
| // First add as absent to make sure clients are notified below |
| addStates(id); |
| -#endif |
| |
| updateStatus(newStatus, id); |
| } else { |
| -- |
| 2.17.1 |
| |