Jon West | d3f9c78 | 2019-04-17 20:45:29 -0400 | [diff] [blame^] | 1 | From 7f357fe17ae21f459306ea544ef24b083d41bf0a Mon Sep 17 00:00:00 2001 |
| 2 | From: Jon West <electrikjesus@gmail.com> |
| 3 | Date: Wed, 17 Apr 2019 20:42:36 -0400 |
| 4 | Subject: [PATCH 5/6] Revert "CameraService: Support calling addStates in |
| 5 | enumerateProviders" |
| 6 | |
| 7 | This reverts commit 2fa8357eeacc88f87c49c7457c94f679cb3b6495. |
| 8 | |
| 9 | Conflicts: |
| 10 | services/camera/libcameraservice/Android.mk |
| 11 | |
| 12 | Change-Id: I75c6d1ace163fdba66019b6ab100ed65afec9872 |
| 13 | --- |
| 14 | services/camera/libcameraservice/Android.mk | 5 ----- |
| 15 | .../camera/libcameraservice/CameraService.cpp | 17 ----------------- |
| 16 | 2 files changed, 22 deletions(-) |
| 17 | |
| 18 | diff --git a/services/camera/libcameraservice/Android.mk b/services/camera/libcameraservice/Android.mk |
| 19 | index 2b3096a55..f16ba7818 100644 |
| 20 | --- a/services/camera/libcameraservice/Android.mk |
| 21 | +++ b/services/camera/libcameraservice/Android.mk |
| 22 | @@ -111,11 +111,6 @@ endif |
| 23 | ifneq ($(TARGET_FACE_UNLOCK_CAMERA_ID),) |
| 24 | LOCAL_CFLAGS += -DFACE_UNLOCK_CAMERA_ID=$(TARGET_FACE_UNLOCK_CAMERA_ID) |
| 25 | endif |
| 26 | - |
| 27 | -ifneq ($(TARGET_CAMERA_NEEDS_ADD_STATES_IN_ENUMERATE),) |
| 28 | - LOCAL_CFLAGS += -DCAMERA_NEEDS_ADD_STATES_IN_ENUMERATE |
| 29 | -endif |
| 30 | - |
| 31 | LOCAL_MODULE:= libcameraservice |
| 32 | |
| 33 | include $(BUILD_SHARED_LIBRARY) |
| 34 | diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp |
| 35 | index 607e2d23b..157f769a3 100644 |
| 36 | --- a/services/camera/libcameraservice/CameraService.cpp |
| 37 | +++ b/services/camera/libcameraservice/CameraService.cpp |
| 38 | @@ -181,21 +181,6 @@ status_t CameraService::enumerateProviders() { |
| 39 | |
| 40 | for (auto& cameraId : deviceIds) { |
| 41 | String8 id8 = String8(cameraId.c_str()); |
| 42 | - |
| 43 | -#ifdef CAMERA_NEEDS_ADD_STATES_IN_ENUMERATE |
| 44 | - bool cameraFound = false; |
| 45 | - { |
| 46 | - Mutex::Autolock lock(mCameraStatesLock); |
| 47 | - auto iter = mCameraStates.find(id8); |
| 48 | - if (iter != mCameraStates.end()) { |
| 49 | - cameraFound = true; |
| 50 | - } |
| 51 | - } |
| 52 | - if (!cameraFound) { |
| 53 | - addStates(id8); |
| 54 | - } |
| 55 | -#endif |
| 56 | - |
| 57 | onDeviceStatusChanged(id8, CameraDeviceStatus::PRESENT); |
| 58 | } |
| 59 | |
| 60 | @@ -294,10 +279,8 @@ void CameraService::onDeviceStatusChanged(const String8& id, |
| 61 | ALOGI("%s: Unknown camera ID %s, a new camera is added", |
| 62 | __FUNCTION__, id.string()); |
| 63 | |
| 64 | -#ifndef CAMERA_NEEDS_ADD_STATES_IN_ENUMERATE |
| 65 | // First add as absent to make sure clients are notified below |
| 66 | addStates(id); |
| 67 | -#endif |
| 68 | |
| 69 | updateStatus(newStatus, id); |
| 70 | } else { |
| 71 | -- |
| 72 | 2.17.1 |
| 73 | |