summaryrefslogtreecommitdiffstats
path: root/services/camera/libcameraservice/CameraService.cpp
Commit message (Collapse)AuthorAgeFilesLines
* CameraService: Fix cameraId type of onDeviceStatusChangedBin Chen2016-03-221-2/+2
| | | | | | | The cameraId should be of type int, instead of camera_device_status_t. Change-Id: I26d587bb74f7100028f09928984c2e8dad6eebef Signed-off-by: Bin Chen <chen_bin@projectara.com>
* Camera: Disallow dumping clients directly am: c400396525Eino-Ville Talvala2016-01-141-1/+9
|\ | | | | | | | | | | | | am: 795243686f * commit '795243686fe2e1c352732b47bcdb6ea9e9e7e39e': Camera: Disallow dumping clients directly
| * Camera: Disallow dumping clients directlyEino-Ville Talvala2016-01-141-1/+9
| |\ | | | | | | | | | | | | | | | | | | am: c400396525 * commit 'c4003965258404a19b99280ac0f475e2f290bf27': Camera: Disallow dumping clients directly
| | * Camera: Disallow dumping clients directlyEino-Ville Talvala2016-01-131-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | Camera service dumps should only be initiated through ICameraService::dump. Bug: 26265403 Change-Id: If3ca4718ed74bf33ad8a416192689203029e2803
* | | Camera: set mNumberOfNormalCameras correctlyYin-Chia Yeh2016-01-121-0/+1
|/ / | | | | | | | | | | | | Need to set the number correctly when a camera HAL is not present. Bug: 25951590 Change-Id: I666acf7a2a523c51f2c2ae88ff690ca9dccda08c
* | DO NOT MERGE: libcameraservice: Fix nullptr crash when no client.Tom Keel2015-10-211-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | This change prevents a crash in the camera service when the camera HAL notifies the service about the absence of a removable camera and there happens to be no client connected to the service. It checks that the pointer returned from clientToDisconnect.get() is non-null before trying to dereference it (as is done in existing code immediately below this change). Bug: 25165323 Change-Id: I8055654bac980542e63ea7f52bf897eaafbc09bc Signed-off-by: Tom Keel <thomas.keel@intel.com>
* | Camera: frameworks: Add NULL check for callbackRanjith Kagathi Ananda2015-10-161-1/+5
| | | | | | | | | | | | | | | | | | --Added NULL check for mRemoteCallback Ack by: Susmitha Gummalla Bug: 25023187 Change-Id: Ib88a128a52e81b8ec1052e3222b6d8b9e494afcc
* | Merge "Camera: setup vendor tags before get_camera_info" into mnc-dr-devYin-Chia Yeh2015-10-151-6/+7
|\ \
| * | Camera: setup vendor tags before get_camera_infoYin-Chia Yeh2015-10-141-6/+7
| | | | | | | | | | | | | | | | | | | | | So HAL can use vendor tags on first get_camera_info call. Bug: 24913201 Change-Id: I73f17de87e3712a27f9cee366995df27a740f5cb
* | | Camera: Add video recording stop soundChien-Yu Chen2015-10-141-1/+2
|/ / | | | | | | | | | | | | Add video recording stop sound to match MediaActionSound. Bug: 24745252 Change-Id: I84b69757c7e0a98abfaafcce5f41dd45fd41cf74
* | Reduce DUMP permission denial output to one line.dcashman2015-09-111-1/+1
| | | | | | | | | | Bug: 23940813 Change-Id: I0060dbaff5cd0c3d028ac5cd7aba7da3f0371150
* | CameraService: Add more systracing, fix module init orderEino-Ville Talvala2015-09-091-4/+38
| | | | | | | | | | | | | | | | | | | | | | | | Improve debugging of performance of concurrent calls to the service. - Add ATRACE calls to camera service entry points - Add ATRACE calls for camera HAL module calls - Ensure that camera module init method is called before all others Bug: 23718257 Bug: 23933447 Change-Id: I2a025866ab39eda3962877120cab13a063c7727e
* | CameraService: Link to client binder death at end of connectEino-Ville Talvala2015-09-041-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If, within a binder Looper thread, a Binder object death notifier is registered, and then a nested Binder transaction is begun, that transaction may process a death notification callback for the just-registered object, if it was dead at the time of registration. This can lead to an unexpected nested call into the service, and cause deadlock. To avoid this, move the death notifier registration to the end of handling the connect transaction. Also remove one extra bit of disconnect logging. Bug: 23525545 Change-Id: If01cbaf42704f55134118afefc9a8f7bdb014e09
* | CameraService: Treat TOP_SLEEPING same as TOP for priority.Eino-Ville Talvala2015-09-031-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When arbitrating between camera clients, treat processes in the TOP_SLEEPING state with the same high priority as processes in the TOP state. This resolves race conditions during lock screen handoffs between clients such as face unlock (a bound foreground process) and a secure camera app (the topmost activity, but transitioning from TOP_SLEEPING to TOP asynchronously from the activity lifecycle callbacks). Bug: 23731720 Change-Id: I92c3f8f561c7725627826c0ba3dc926e99af746c
* | am fe751bea: Camera: Fix flashlight deadlockChien-Yu Chen2015-09-021-2/+2
|\ \ | |/ | | | | | | * commit 'fe751bea0d3eedd6e817aebf4e457425b82e7117': Camera: Fix flashlight deadlock
| * Camera: Fix flashlight deadlockChien-Yu Chen2015-09-011-2/+2
| | | | | | | | | | | | | | | | Use a dedicated mutex for torch UID map so it won't cause a deadlock after flashlight app gets killed while the torch is on. Bug: 23722318 Change-Id: I228377aa0412052d56b6b948361d9abaecbbc686
* | CameraService: Notify camera service proxy of device statusEino-Ville Talvala2015-08-211-3/+24
|/ | | | | | | | Send the camera proxy service in system server updates to camera device state: opened/closed/active/idle. Bug: 23393557 Change-Id: Id7c70f134821efa34af8f6e7b4caa4c2ab128ebc
* Camera: Add camera type to ICameraService.getNumberOfCameras.Eino-Ville Talvala2015-08-141-14/+88
| | | | | | | | | Also determine the number of 'normal' cameras present on camera service startup, and ensure that all normal cameras have IDs lower than the 'strange' cameras. Bug: 23194168 Change-Id: I1f7b14825cb52707de698a955f85da1eaa932663
* camera2: Fix native binder interface and add tests.Ruben Brunk2015-07-061-1/+1
| | | | | | | | | - Add CameraBinderTests for limited coverage of native camera2 binder interfaces for the camera service. - Fix several bugs in the native binder interfaces. Bug: 18468810 Change-Id: Iab2d81a5cacd20daf7454aeeed033cc13d88452c
* Camera: Change error for app ops reject, propagate binder errorsEino-Ville Talvala2015-06-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | INVALID_OPERATION surfaces as an non-specific device-level error to applications in the onError callback. This is not a condition apps targeting camera2 in L will generally have to deal with. Instead, return -EACCESS which maps to throwing CameraAccessException.CAMERA_DISABLED, same as disabling camera access with DevicePolicyManager. The old camera API converts any error code to -EACCESS at the JNI layer, so this doesn't change anything for the older API. Also update the various native ICameraService binder connect calls to check for the transact error code, and return it if it is not OK. Without this, PERMISSION_DENIED transact errors from the camera service cannot be distinguished from CAMERA_DISABLED errors in some codepaths. Bug: 21604925 Change-Id: Ifccc8989b8c20653429e2d3e51dba7abb2be9c35
* Merge "Track camera and flashlight usage in battery stats." into mnc-devRuben Brunk2015-06-021-10/+86
|\
| * Track camera and flashlight usage in battery stats.Ruben Brunk2015-06-011-10/+86
| | | | | | | | | | | | Bug: 15986092 Change-Id: I9dc6828332e4091fd93bf2d82839e8e3862a2fc2
* | Merge "camera: Add AIDL interface for CameraServiceProxy." into mnc-devRuben Brunk2015-05-201-0/+13
|\ \
| * | camera: Add AIDL interface for CameraServiceProxy.Ruben Brunk2015-05-201-0/+13
| |/ | | | | | | | | | | | | | | | | | | | | | | | | - Adds an AIDL interface to allow the proxy camera service running in system server to accept RPCs from the camera service running in mediaserver. - Request an update to the valid user set from the proxy camera service when mediaserver restarts to initialize properly + avoid DOS after a crash. Bug: 21267484 Change-Id: Ib821582794ddd1e3574b5dc6c79f7cb197b57f10
* | CameraService: Logcat conflicting devices on rejected openEino-Ville Talvala2015-05-191-1/+5
|/ | | | | | | | | Already in dumpsys log, but also put into logcat for feedback reports Also fix a minor warning about an uninitialized variable. Bug: 21063372 Change-Id: I04b45932e4500ac72aaa1cb724abc8a82a0e70e8
* camera2: Fix work-profile eviction handling.Ruben Brunk2015-05-141-19/+64
| | | | | Bug: 20124384 Change-Id: I6fb82dbfd5f98746ed4befed81a583e3709bfee8
* Merge "camera2: Fix arbitration priority calculation." into mnc-devRuben Brunk2015-05-131-27/+5
|\
| * camera2: Fix arbitration priority calculation.Ruben Brunk2015-05-121-27/+5
| | | | | | | | | | | | | | | | | | - Simplify priority calculation + handle constants added for device sleep: FOREGROUND_SERVICE and TOP_SLEEPING. Bug: 19186859 Change-Id: Ia2a5517cd3150deaccb58a0aa1eaa583cb769add
* | Fail gracefully when camera app op is not enabled.Svetoslav2015-05-121-1/+7
| | | | | | | | Change-Id: I0c7c1dca1c0966efaf30bcfe12636953683712ab
* | Revert "Add camera app op - camera"Svetoslav Ganov2015-05-121-76/+44
|/ | | | | | | | This is not needed duplication of work This reverts commit 32fa6d0e65dbf956e253a1006e9419dce2fe75c9. Change-Id: I2c81b0dacb2ed99c408c79c1f9e22a4baa564494
* Add camera app op - cameraSvet Ganov2015-05-021-44/+76
| | | | Change-Id: I26570cc0a23fdea740b416a26838d40cac296c85
* camera2: Fix fuzztesting segfault in connect.Ruben Brunk2015-05-011-2/+14
| | | | | Bug: 20721655 Change-Id: I0d974cad19683a8c86a76dac7f61ac0010bd977a
* Merge "CameraService: Add support for module init, some logging updates"Eino-Ville Talvala2015-04-161-69/+97
|\
| * CameraService: Add support for module init, some logging updatesEino-Ville Talvala2015-04-151-69/+97
| | | | | | | | | | | | | | | | | | - Add support for camera HAL module init() method on v2.4 - Add logging for service errors such as failure to init - Minor cleanup to dumping of event log Bug: 20016050 Change-Id: I94e18b52c186f16fb096457015f7ae761e867fd8
* | camera2: remove unnecessary flashlight error messagesChien-Yu Chen2015-04-151-15/+18
|/ | | | | Bug: 20069129 Change-Id: I0e721bfad1f0218744d3554397e3ec9b8bc07a19
* camera: Fix client eviction/disconnect race.Ruben Brunk2015-04-131-4/+23
| | | | | | | | | | | - Add blocking wait in camera service connect call to prevent race when client has called disconnect while eviction of that client is taking place, resulting in early call of device initialization before all HAL resources are available. Bug: 20038135 Change-Id: I7afc5bfa23612ba7f83293fa542ff983a5991230
* camera: Update camera service logging and validation.Ruben Brunk2015-04-091-37/+89
| | | | | | | | | - Expand the logging included by the camera service. - Update user validation checks in connect calls so that these can be correctly called from the camera service. Bug: 20063426 Change-Id: I0a8cbe1ea2c0a652298e6b70c89705da174a50e1
* camera2: Enforce client eviction on user switch.Ruben Brunk2015-03-311-12/+110
| | | | | Bug: 19186859 Change-Id: I172a2ce46c8e8a131ae7e8dd99d60c5f4f0d6668
* Merge "camera: update CameraModule"Yin-Chia Yeh2015-03-241-15/+12
|\
| * camera: update CameraModuleChien-Yu Chen2015-03-241-15/+12
| | | | | | | | | | | | | | | | | | | | 1. Add more accessor methods to CameraModule to prevent exposing raw module pointer 2. Use KeyedVector to replace array Bug: 19897963 Change-Id: I111cc093f09f5fb3c4b13693d5d0687e1f441058
* | camera2: Remove ProCamera.Ruben Brunk2015-03-201-39/+0
|/ | | | | Bug: 19186859 Change-Id: I4aaadb53db65b479f92cbb3c05329d1e40317900
* Fix link error of PROCESS_STATE_NONEXISTENT.Chih-Hung Hsieh2015-03-191-1/+5
| | | | | | | | | * A reference to PROCESS_STATE_NONEXISTENT will cause link error with clang or standard C++ compiler because there is no out-of-class definition, although g++ is allowing it. Use +PROCESS_STATE_NONEXISTENT to get the value instead of reference. Change-Id: I62049584b94e6847b64b572f6ef6c3e9dcc573eb
* camera2: Add camera client eviction enforcement.Ruben Brunk2015-03-181-805/+849
| | | | | | | | | - This updates the CameraService to implement client eviction behavior based on process priority. Bug: 19186859 Change-Id: I646939b1cdf1a2237c4e5044164d55a2542cf36e
* camera: implement flashlight for HAL v1 devicesChien-Yu Chen2015-03-031-13/+0
| | | | | | | | | Implement flashlight for HAL v1 devices and remove CameraHardwareInterface's dependency on CameraService to avoid circular dependency. Bug: 2682206 Change-Id: Id5bbccef085b607a6189763fd7fbe2e3f26868c8
* camera: fix flashlight implementation for HAL v2Chien-Yu Chen2015-03-031-58/+143
| | | | | | | | | | | | | | | | | | Update torch availability when the camera device availability changes. For device HAL v2 and v3 implementation, notify torch unavailable for all camera devices with a flash unit when a camera device is opened. Notify torch available for all camera devices with flash unit when all camera devices are closed. Don't invoke torch status callback in camera service. Invoke torch status callback in HAL or FlashControlBase implementations to avoid race condition. Clean up previous CL. Bug: 2682206 Change-Id: I24f5478f467b2c680565fe98f112eef33e2547a1
* Merge "camera: implement flashlight control"Chien-Yu Chen2015-02-191-1/+175
|\
| * camera: implement flashlight controlChien-Yu Chen2015-02-121-1/+175
| | | | | | | | | | | | | | | | Implement flashlight API for module v2.4 by calling module APIs and by for hal v2 and v3 by using CameraDeviceBase. Bug: 2682206 Change-Id: Ib8b77f6fd462489d672f27e14fe37801d35b7544
* | Look up user-specific device policy for disabling cameraAmith Yamasani2015-02-131-1/+5
|/ | | | | | | | | | | | | | Camera can be disabled on a per-user basis by device admins. Changed the system property format to be per-user so that the policy can be applied based on calling user. TODO: Ideally this policy information should be pulled from the DevicePolicyManager rather than relying on system properties. Property changes will not be applied immediately either, if there's no listener. Bug: 19345698 Change-Id: Ia00034726260bc9ff28ac592f20a27b5c9a77d58
* CameraService: intercept Camera moduleYin-Chia Yeh2015-02-031-27/+29
| | | | | | | | Wrap camera module returned from HAL so get_camera_info returns static_camera_characteristics processed by framework, which generates keys added after HAL3.2 is released. Change-Id: Ief423a1571cf06c7ef80b98b403a33969baf95f6
* am ffa3e71e: am bc0f452b: Merge "Camera2: Fix CameraParameters parse ↵Ruben Brunk2014-11-211-0/+1
|\ | | | | | | | | | | | | segfault." into lmp-mr1-dev * commit 'ffa3e71e47215b68fe4ae0b7a3f976db648d63d3': Camera2: Fix CameraParameters parse segfault.