Commit graph

1042 commits

Author SHA1 Message Date
Dan Albert
332da11294 Include what you use.
Test: mma
Bug: None
Change-Id: I024a2ee0af142c1bb923fcefd54b8b2077107476
Exempt-From-Owner-Approval: trivial cleanup
2017-12-12 15:42:00 -08:00
Chih-hung Hsieh
a7348efe27 Merge "Allow warnings in modules/camera/3_4." am: d8bffba62a am: dd67309182
am: 38a4fbe55b

Change-Id: If914c66f7c5be51db275cc73f2deb6bb0d19f594
2017-12-08 04:51:30 +00:00
Chih-Hung Hsieh
37ee37170d Allow warnings in modules/camera/3_4.
* This directory still has many warnings to fix.

Bug: 66996870
Test: normal build
Exempt-From-Owner-Approval: quick fix for broken build
Change-Id: I7f3cef3016ba16cb7ddbe6721cf74c71c1cbf1a2
2017-12-07 03:14:09 +00:00
Chih-Hung Hsieh
26ab80dcaa Merge "Use -Werror in hardware/libhardware/modules" am: 298fc4f6f5 am: 66f312b91c
am: 81a536751c

Change-Id: I78eb43d3b34086a03d3e24c7b2ce4b5b2ea1d393
2017-12-06 18:54:17 +00:00
Chih-Hung Hsieh
66f312b91c Merge "Use -Werror in hardware/libhardware/modules"
am: 298fc4f6f5

Change-Id: I3c23dc4ce4609ec27402cae52b71ef79067c8e73
2017-12-06 18:42:24 +00:00
TreeHugger Robot
95953ab214 Merge "Remove unused variables/labels to eliminate compile warnings." 2017-12-05 20:49:44 +00:00
Paul McLean
96c4d3035a Remove unused variables/labels to eliminate compile warnings.
Test: built and run on Marlin and testing with various USB peripherals.
Bug:70180519
Change-Id: I68d7d33ffff8983117508e02a76d62c71d708c76
2017-12-05 09:50:26 -08:00
Chih-Hung Hsieh
1f601b1d7d Use -Werror in hardware/libhardware/modules
* Remove unused local variables.
* Remove or comment out unused static functions.
* Fix trivial bugs found by unused value warnings.

Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I99389b883c89551850180d25241a35a40bb77b26
2017-12-01 10:37:19 -08:00
Paul McLean
9880f12e19 Removing unused and misleading constant.
Test: None needed.

Change-Id: I1fa020f38f488b0cf5196284f29220c3e6c1acd0
2017-11-30 12:15:44 -07:00
Jaesung Chung
6e8afead53 Override HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED during setuping streams
This CL makes the hack(ag/3176281) in frameworks/av not needed no longer.

Bug: 69321320
Test: After reverting the hack in av, the camera sample app works.
Exempt-From-Owner-Approval: HAL is owned by Things team.
Change-Id: I510531bed401fe4fa6071fc151a1f75307a5decb
2017-11-16 02:30:38 +00:00
Jaesung Chung
424744cc4d Use RGB24 format instead of BGR32
BGR32 mode is in RPi3's camera has a RB color swapping issue. This CL
makes to use stable RGB24 mode instead to avoid the problem without
causing any quality regression.

Bug: 69075512
Test: RB color swapping problem is gone on preview, recording and stil.
Exempt-From-Owner-Approval: HAL is owned by Things team.
Change-Id: I109363c0f68cec45f92e739a978f554e70032151
2017-11-14 08:00:16 +00:00
Xin Li
1d4b3d5f8f Merge commit '61f704a28f9d984eef9ee645a6e4e761130a5609' into HEAD
Change-Id: I7d27a79c89740aa041c42e1396e8bfc89bc1d4f4
2017-11-13 14:35:39 -08:00
TreeHugger Robot
0811139dd8 Merge "Close acquire fence fd after camera capture" 2017-11-13 08:23:09 +00:00
Eric Jeong
eadafff6ae Close acquire fence fd after camera capture
Camera capture should close acquire fence. If not, fd remains unused,
which consumes all available fd resources for a process (usually 1024).

Bug: 64214375
Test: Running camera preview of camera sample app for a long time
      should not break preview image.
Exempt-From-Owner-Approval: This is a cherry-pick CL from oc-iot-dev.      
Change-Id: I91d6d3a7b7a95ed5b33c7c73bc85d42f69f4c856
(cherry picked from commit da3c52413a7499a3cd91246b0634f839315ed7b7)
2017-11-13 06:52:28 +00:00
Jaesung Chung
1fc9b614b8 Fix lock mechanism in v4l2 camera HAL
Both in_flight_lock_ lock in v4l2_camera.cpp and buffer_queue_lock_ in
v4l2_wrapper.cpp have problems that guards the buffer indices and in
flight buffer vector incorrectly. Those problem leads to mismatching in
terms of buffer size between the HAL and Camera3Device and eventually
the Camera3Device will stop to wait for buffers that HAL will not post
in the future.

Bug: 69076261
Test: Camera samples app doesn't stuck with FB impl.
Exempt-From-Owner-Approval: got +2 from the HAL maintainer.
Change-Id: I3d0a4361d46571fd144a5eb8bc160296a31d6358
2017-11-13 02:25:48 +00:00
Steven Moreland
61e56d4462 Merge "Remove use of PRODUCT_FULL_TREBLE from sensors." am: 49cf861945 am: 798c73b818
am: 69ecb1bd57

Change-Id: I23a86e0accda72ac5de6c5ba6032568e36179728
2017-11-10 18:52:04 +00:00
Steven Moreland
69ecb1bd57 Merge "Remove use of PRODUCT_FULL_TREBLE from sensors." am: 49cf861945
am: 798c73b818

Change-Id: I86620d1ecbd138444f20eb9ba96d56e82b525c0a
2017-11-10 18:46:11 +00:00
Steven Moreland
210aed90a0 Remove use of PRODUCT_FULL_TREBLE from sensors.
This section of code uses PRODUCT_FULL_TREBLE, but
what PRODUCT_FULL_TREBLE means is too fuzzy, and
it is being broken up into multiple flags.

Also, this is an unnecessary restriction (HALs can
be implemented anyway people want).

Fixes: 67975863
Test: multiproduct_kati
Change-Id: I0de36d1ee23052c1fadcdf9a8b1ce85781dd88a0
2017-11-09 12:23:53 -08:00
Andy Hung
4e6a1c01e0 USB audio - make profile const
Test: Record / Playback audio
Bug: 68211730
Change-Id: I73e0a45eb6ea959e784e2a9db67f000badb10d11
2017-10-30 17:54:51 -07:00
Andy Hung
b10ce6d683 USB audio hal - avoid reading alsa profile if input already open
Test: USB headset, recording in background, launch another record.
Bug: 68211730
Change-Id: I12b5c031b4cb9d2e8228bef7234b3c3b75efc8a2
2017-10-30 17:01:40 -07:00
Dan Albert
81895aad17 Add missing includes.
Change-Id: Id6a97bfdb28f155f691891c746cbc1008e6ce083
Exempt-From-Owner-Approval: trivial cleanup
Test: mma
Bug: None
2017-10-12 13:31:52 -07:00
Chih-hung Hsieh
6ac9ba500b Merge "Use -Werror in hardware/libhardware" am: d1a2b9f7c1 am: d67dcc5fc8
am: e142c94113

Change-Id: I03daa2046b0454ab9beb3c72585f76afe485fc96
2017-10-12 01:58:44 +00:00
Chih-hung Hsieh
d67dcc5fc8 Merge "Use -Werror in hardware/libhardware"
am: d1a2b9f7c1

Change-Id: I3185f3d8f36c09ee61ebc3746d369a97c4f8a4c3
2017-10-12 01:27:36 +00:00
Chih-Hung Hsieh
235942389f Use -Werror in hardware/libhardware
* Remove unused local variables and function.
* Fix unused return value warning.

Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I269eca76cda2222c7a0176e85e92df0bb0924a0e
2017-10-04 11:09:30 -07:00
Peng Xu
daef5973d4 Proposing ownership for modules/sensors am: eabdd92f5b am: 1d8d7ca653
am: 0b9a9ec203

Change-Id: I627305f40d136d66395ed7754b1c70eaf285fd00
2017-09-26 12:11:23 +00:00
Peng Xu
d891c81cad Merge changes from topic "equalizer"
am: eba0da9019

Change-Id: I82025275ee812b1e06038f277bdb6a5fa28634ec
2017-09-25 23:05:13 +00:00
Peng Xu
1d8d7ca653 Proposing ownership for modules/sensors
am: eabdd92f5b

Change-Id: I27405024bbdc9b2a6f34aba0c74a91729068feb8
2017-09-25 23:04:40 +00:00
Peng Xu
d8871a7687 Fix potential memory leak in multihal
Bug: 64266341
Test: compile and pixel 2017 device sensor operate normally
Change-Id: I879379106d038ce28937a28ab5863b4bea615bf0
Merged-In: I879379106d038ce28937a28ab5863b4bea615bf0
2017-09-19 12:38:47 -07:00
Alexey Polyudov
516ef86487 sensors: route sensor handle for multi-hal event injection
Change-Id: Iad65c8b7eea7fbe89747123bd3364b6dcde8b839
Merged-In: Iad65c8b7eea7fbe89747123bd3364b6dcde8b839
2017-09-19 12:36:43 -07:00
Peng Xu
15b43e96a3 Add support of sensor direct report and operation parameter
Adds sensor direct report mode support to multihal. Limited
by hal API only the first HAL in configuration list can support
sensor direct report.

Sensor operation parameter support in multihal module is added in
this CL.

In treblized device multihal is enabled by default and implementation
is included in default implementation. Remove multihal shared lib
generation in device specified PRODUCT_FULL_TREBLE.

Test: warning message shows up on device that specified both
      PRODUCT_FULL_TREBLE and USE_SENSOR_MULTI_HAL flags.
Test: cts test passes
Change-Id: I868e7c1ce727370b333f80bbfe737fb106f6d106
Merged-In: I868e7c1ce727370b333f80bbfe737fb106f6d106
2017-09-19 12:36:04 -07:00
Peng Xu
eabdd92f5b Proposing ownership for modules/sensors
Test: n/a
Change-Id: Ie5494af12686ae1bf0545e35ec8dcc00e21b2383
Merged-In: Ie5494af12686ae1bf0545e35ec8dcc00e21b2383
2017-09-19 12:31:49 -07:00
Jiyong Park
888b1351c8 Merge "Don't rely on transitively included headers" am: 1363159d74 am: 6d76606405
am: 873a4a5494

Change-Id: I11b097faac8eb82c3672b18fe2ad581964cd3023
2017-09-06 16:03:56 +00:00
Tri Vo
a486d25b96 Merge changes from topic "libhardware_vndk"
am: 7d03020e96

Change-Id: I13dd1fafc3822d12e9403e467b8b3f803dd990b1
2017-09-06 15:58:26 +00:00
Jiyong Park
6d76606405 Merge "Don't rely on transitively included headers"
am: 1363159d74

Change-Id: I0325773d80680928d47750937e2f4bc6a69b1bf9
2017-09-06 15:56:28 +00:00
Treehugger Robot
7d03020e96 Merge changes from topic "libhardware_vndk"
* changes:
  Build tv_input.default.vendor with BOARD_VNDK_VERSION
  Build fingerprint.default with BOARD_VNDK_VERSION
  Build power.default with BOARD_VNDK_VERSION
  Build local_time.default with BOARD_VNDK_VERSION
  Build nfc.default with BOARD_VNDK_VERSION
  Build vr.default with BOARD_VNDK_VERSION
  Build vibrator.default.vendor with BOARD_VNDK_VERSION
  Build audio.usb.default with BOARD_VNDK_VERSION
  Build vehicle.default with BOARD_VNDK_VERSION
  Build audio.primary.default, audio.stub.default, audio_policy.stub with BOARD_VNDK_VERSION
  Build radio.fm.default.vendor with BOARD_VNDK_VERSION
  Build consumerir.default with BOARD_VNDK_VERSION
2017-09-06 15:52:32 +00:00
Jiyong Park
32dde03332 Don't rely on transitively included headers
One must explicitly include what it need.
time.h for clock_gettime
float.h for FLT_MAX
string.h for memset

Bug: 37629934
Test: build

Change-Id: I1030a9c9ff3c2de4c5febabc3064d6976e9535cf
2017-09-06 12:17:06 +09:00
Tri Vo
b062604399 Build tv_input.default.vendor with BOARD_VNDK_VERSION
Bug: 37342627
Test: BOARD_VNDK_VERSION=current m -j64 tv_input.default.vendor
Change-Id: Ic94a8eb24edc7518f2e2ad62600a9ea4b0d8fba2
Merged-In: Ic94a8eb24edc7518f2e2ad62600a9ea4b0d8fba2
2017-09-05 17:43:16 -07:00
Tri Vo
afd72278fe Build fingerprint.default with BOARD_VNDK_VERSION
Bug: 37342627
Test: BOARD_VNDK_VERSION=current m -j64 fingerprint.default.vendor
Change-Id: Iafdc05862aaa995a5f02cb6a6c29a020846b435f
Merged-In: Iafdc05862aaa995a5f02cb6a6c29a020846b435f
2017-09-05 17:43:16 -07:00
Tri Vo
736bc77a0f Build power.default with BOARD_VNDK_VERSION
Bug: 37342627
Test: BOARD_VNDK_VERSION=current m -j64 power.default.vendor
Change-Id: I4a66d05d4ad45c9c250f1c407b755b2e35f46290
Merged-In: I4a66d05d4ad45c9c250f1c407b755b2e35f46290
2017-09-05 17:43:16 -07:00
Tri Vo
f5c6aa4533 Build local_time.default with BOARD_VNDK_VERSION
Bug: 37342627
Test: BOARD_VNDK_VERSION=current m -j64 local_time.default.vendor
Change-Id: I85c2cbcc86b69148cceb628aae38d1cd4332f69a
Merged-In: I85c2cbcc86b69148cceb628aae38d1cd4332f69a
2017-09-05 17:43:16 -07:00
Tri Vo
6ac6031b25 Build nfc.default with BOARD_VNDK_VERSION
Bug: 37342627
Test: BOARD_VNDK_VERSION=current m -j64 nfc.default.vendor
Change-Id: Ic700f1769eefe880deeae901b658685e00772206
Merged-In: Ic700f1769eefe880deeae901b658685e00772206
2017-09-05 17:43:16 -07:00
Tri Vo
cba3f48617 Build vr.default with BOARD_VNDK_VERSION
Bug: 37342627
Test: BOARD_VNDK_VERSION=current m -j64 vr.default
Change-Id: Id3a52cfd4e5fc278c8c9b7326f0566c0adbed815
Merged-In: Id3a52cfd4e5fc278c8c9b7326f0566c0adbed815
2017-09-05 17:43:16 -07:00
Tri Vo
b355e842e0 Build vibrator.default.vendor with BOARD_VNDK_VERSION
Bug: 37342627
Test: BOARD_VNDK_VERSION=current m -j64 vibrator.default.vendor
Change-Id: I908432b4da9ea1f0e1ceea3e0b154f315a9ba775
Merged-In: I908432b4da9ea1f0e1ceea3e0b154f315a9ba775
2017-09-05 17:43:16 -07:00
Tri Vo
5bf2109d29 Build audio.usb.default with BOARD_VNDK_VERSION
Bug: 37342627
Test: BOARD_VNDK_VERSION=current m -j64 audio.usb.default
Change-Id: I0be8ad7283e200bf36100eca38b28af4220530fd
Merged-In: I0be8ad7283e200bf36100eca38b28af4220530fd
2017-09-05 17:43:16 -07:00
Tri Vo
0d6e1a3da5 Build vehicle.default with BOARD_VNDK_VERSION
Bug: 37342627
Test: BOARD_VNDK_VERSION=current m -j64 vehicle.default
Change-Id: Ib0928bccf4b873020b5a8d4d25f9cb65c11c0270
Merged-In: Ib0928bccf4b873020b5a8d4d25f9cb65c11c0270
2017-09-05 17:43:16 -07:00
Tri Vo
407bff7224 Build audio.primary.default, audio.stub.default, audio_policy.stub with BOARD_VNDK_VERSION
Bug: 37342627
Test: BOARD_VNDK_VERSION=current m -j64 audio.primary.default.vendor
Test: BOARD_VNDK_VERSION=current m -j64 audio.stub.default.vendor
Test: BOARD_VNDK_VERSION=current m -j64 audio_policy.stub.vendor
Change-Id: If3a8668429e20e75fc43aefe3b5a56ff0efc7135
Merged-In: If3a8668429e20e75fc43aefe3b5a56ff0efc7135
2017-09-05 17:43:16 -07:00
Tri Vo
510c9377cd Build radio.fm.default.vendor with BOARD_VNDK_VERSION
Bug: 37342627
Test: BOARD_VNDK_VERSION=current m -j64 radio.fm.default.vendor
Change-Id: I77ad718472f531afdcf6519f3c9979eb1b936a58
Merged-In: I77ad718472f531afdcf6519f3c9979eb1b936a58
2017-09-05 17:43:16 -07:00
Tri Vo
051005af32 Build consumerir.default with BOARD_VNDK_VERSION
Bug: 37342627
Test: BOARD_VNDK_VERSION=current m -j64 consumerir.default.vendor
Change-Id: Ieaa31aaac0264bfbb1592fab51e6d0dbb10404de
Merged-In: Ieaa31aaac0264bfbb1592fab51e6d0dbb10404de
2017-09-05 17:43:16 -07:00
Elliott Hughes
a1ecbec1dd Merge "C++14 is the default now." am: c85724298e am: d53231a511
am: 9e2569e26a

Change-Id: I48ddbdbefd272e37e05c3fe577fe62aae2cc9bc7
2017-08-24 00:07:06 +00:00
Elliott Hughes
d53231a511 Merge "C++14 is the default now."
am: c85724298e

Change-Id: I2f23db3ff90d9fcd541176af87bdff2b95cbf6ae
2017-08-23 23:57:37 +00:00
Elliott Hughes
b2b0d1f5e7 C++14 is the default now.
Bug: http://b/32019064
Test: builds
Change-Id: Iacc91f1150cdab2df40db3e33f5b57933ff79824
2017-08-23 14:34:16 -07:00
Peng Xu
2fd77c0fea Fix potential memory leak in multihal
Bug: 64266341
Test: compile and pixel 2017 device sensor operate normally
Change-Id: I879379106d038ce28937a28ab5863b4bea615bf0
2017-08-10 22:31:50 +00:00
Jiyong Park
0492c375e0 Unmark input.evdev.default from vendor lib
This HAL is using android/input.h which is not available to vendors.
Unmark this HAL back to platform lib so that the header is accessible.

Note that this does not block our effort of splitting system/vendor
builds since this HAL is not used in any Treble-enabled device.

Bug: 37342627
Test: BOARD_VNDK_VERSION=current m -j input.evdev.default
Change-Id: I4f900cb58802bccf8d06f995a4e52c3b450f4799
2017-07-17 17:09:07 +09:00
Jayant Chowdhary
18db97ffa3 Build hwcomposer.default with the VNDK.
When the vndk is enabled (BOARD_VNDK_VERSION=current),
vendor libraries must only link against vendor variants
in the build system. This also means that they receive
restricted sets of headers and that automatic global
headers are restricted.

Test: BOARD_VNDK_VERSION=current m -j k hwcomposer.default

Bug: 37342627

Change-Id: I79d034b71cc69fabb53d1682339da71191a65e3c
2017-07-10 15:39:01 -07:00
Steven Moreland
ee7cf40c01 Make audio_remote_submix build with the VNDK.
When the vndk is enabled (BOARD_VNDK_VERSION=current),
vendor libraries must only link against vendor variants
in the build system. This means that they receive restricted
sets of headers and that automatic global headers are restricted.

Test: build audio_remote_submix with BOARD_VNDK_VERSION=current
Bug: 37342627
Change-Id: I1170443466df58fa7b66096241e881a38f8cf1ac
2017-07-06 11:11:16 -07:00
Jiyong Park
118f3dc236 Build audio.r_submix.default with BOARD_VNDK_VERSION
Add missing header unistd.h

Bug: 37342627
Test: BOARD_VNDK_VERSION=current m -j audio.r_submix.default
Change-Id: I5baa960dcdfc3d93d7cf172b23173dfb48babf88
2017-07-04 12:55:23 +09:00
Tri Vo
67a8cf9f78 Merge "Build consumerir.default with BOARD_VNDK_VERSION" 2017-06-27 22:28:49 +00:00
Tri Vo
ad9dec1f02 Merge "Build radio.fm.default.vendor with BOARD_VNDK_VERSION" 2017-06-27 22:28:49 +00:00
Tri Vo
2b81bfbaa7 Merge "Build nfc_nci.default with BOARD_VNDK_VERSION" 2017-06-27 22:28:49 +00:00
Tri Vo
e631fc99bd Merge "Build audio.primary.default, audio.stub.default, audio_policy.stub with BOARD_VNDK_VERSION" 2017-06-27 22:28:49 +00:00
Tri Vo
d2471f426a Merge "Build vehicle.default with BOARD_VNDK_VERSION" 2017-06-27 22:28:49 +00:00
Tri Vo
cf80241c41 Merge "Build audio.usb.default with BOARD_VNDK_VERSION" 2017-06-27 22:28:49 +00:00
Tri Vo
4ffecfb2c3 Merge "Build vibrator.default.vendor with BOARD_VNDK_VERSION" 2017-06-27 22:28:49 +00:00
Tri Vo
707b138c86 Merge "Build vr.default with BOARD_VNDK_VERSION" 2017-06-27 22:28:49 +00:00
Tri Vo
257197e64d Merge "Build nfc.default with BOARD_VNDK_VERSION" 2017-06-27 22:28:49 +00:00
Tri Vo
189f40a9e9 Merge "Build local_time.default with BOARD_VNDK_VERSION" 2017-06-27 22:28:49 +00:00
Tri Vo
0248c06e13 Merge "Build power.default with BOARD_VNDK_VERSION" 2017-06-27 22:28:49 +00:00
Tri Vo
f6760bf841 Merge "Build fingerprint.default with BOARD_VNDK_VERSION" 2017-06-27 22:28:49 +00:00
Tri Vo
1f5b005bda Merge "Build tv_input.default.vendor with BOARD_VNDK_VERSION" 2017-06-27 22:28:49 +00:00
Tri Vo
912ba94faf Build power.default with BOARD_VNDK_VERSION
Bug: 37342627
Test: BOARD_VNDK_VERSION=current m -j64 power.default.vendor
Change-Id: I4a66d05d4ad45c9c250f1c407b755b2e35f46290
2017-06-27 13:14:51 -07:00
Tri Vo
80a28e0059 Build fingerprint.default with BOARD_VNDK_VERSION
Bug: 37342627
Test: BOARD_VNDK_VERSION=current m -j64 fingerprint.default.vendor
Change-Id: Iafdc05862aaa995a5f02cb6a6c29a020846b435f
2017-06-27 12:54:43 -07:00
Tri Vo
7802ea03db Build consumerir.default with BOARD_VNDK_VERSION
Bug: 37342627
Test: BOARD_VNDK_VERSION=current m -j64 consumerir.default.vendor
Change-Id: Ieaa31aaac0264bfbb1592fab51e6d0dbb10404de
2017-06-27 12:53:53 -07:00
Tri Vo
4bf4a6d02e Build audio.primary.default, audio.stub.default, audio_policy.stub with BOARD_VNDK_VERSION
Bug: 37342627
Test: BOARD_VNDK_VERSION=current m -j64 audio.primary.default.vendor
Test: BOARD_VNDK_VERSION=current m -j64 audio.stub.default.vendor
Test: BOARD_VNDK_VERSION=current m -j64 audio_policy.stub.vendor
Change-Id: If3a8668429e20e75fc43aefe3b5a56ff0efc7135
2017-06-27 12:52:50 -07:00
Tri Vo
59f1d1d826 Build local_time.default with BOARD_VNDK_VERSION
Bug: 37342627
Test: BOARD_VNDK_VERSION=current m -j64 local_time.default.vendor
Change-Id: I85c2cbcc86b69148cceb628aae38d1cd4332f69a
2017-06-27 12:48:13 -07:00
Tri Vo
c060ffc9fc Build nfc_nci.default with BOARD_VNDK_VERSION
Bug: 37342627
Test: BOARD_VNDK_VERSION=current m -j64 nfc_nci.default.vendor
Change-Id: I39859732e5b99e855fac645571e1cb77447434d0
2017-06-27 12:46:58 -07:00
Tri Vo
4f86f33e81 Build nfc.default with BOARD_VNDK_VERSION
Bug: 37342627
Test: BOARD_VNDK_VERSION=current m -j64 nfc.default.vendor
Change-Id: Ic700f1769eefe880deeae901b658685e00772206
2017-06-27 12:45:33 -07:00
Tri Vo
820e9bb5aa Build radio.fm.default.vendor with BOARD_VNDK_VERSION
Bug: 37342627
Test: BOARD_VNDK_VERSION=current m -j64 radio.fm.default.vendor
Change-Id: I77ad718472f531afdcf6519f3c9979eb1b936a58
2017-06-27 12:30:28 -07:00
Tri Vo
ba73f82987 Build tv_input.default.vendor with BOARD_VNDK_VERSION
Bug: 37342627
Test: BOARD_VNDK_VERSION=current m -j64 tv_input.default.vendor
Change-Id: Ic94a8eb24edc7518f2e2ad62600a9ea4b0d8fba2
2017-06-27 11:36:30 -07:00
Tri Vo
00a86735cc Build audio.usb.default with BOARD_VNDK_VERSION
Bug: 37342627
Test: BOARD_VNDK_VERSION=current m -j64 audio.usb.default
Change-Id: I0be8ad7283e200bf36100eca38b28af4220530fd
2017-06-27 11:33:36 -07:00
Tri Vo
b527af3806 Build vehicle.default with BOARD_VNDK_VERSION
Bug: 37342627
Test: BOARD_VNDK_VERSION=current m -j64 vehicle.default
Change-Id: Ib0928bccf4b873020b5a8d4d25f9cb65c11c0270
2017-06-27 11:31:07 -07:00
Tri Vo
ebe7990440 Build vibrator.default.vendor with BOARD_VNDK_VERSION
Bug: 37342627
Test: BOARD_VNDK_VERSION=current m -j64 vibrator.default.vendor
Change-Id: I908432b4da9ea1f0e1ceea3e0b154f315a9ba775
2017-06-27 11:26:36 -07:00
Tri Vo
9382f5b4d0 Build vr.default with BOARD_VNDK_VERSION
Bug: 37342627
Test: BOARD_VNDK_VERSION=current m -j64 vr.default
Change-Id: Id3a52cfd4e5fc278c8c9b7326f0566c0adbed815
2017-06-27 11:18:14 -07:00
Jiyong Park
53c2850600 Build thermal.default with BOARD_VNDK_VERSION
libhardware_headers is added since global include path is not provided
when building with BOARD_VNDK_VERSION

Bug: 37342627
Test: BOARD_VNDK_VERSION=current m -j thermal.default
Change-Id: Ieaa8be8033d13a24539e37e88f7cd858c03f5273
2017-06-27 19:19:35 +09:00
Tri Vo
b12ae8ca55 Fix missing headers in libhardware/modules/sensors.
include headers missing headers from libstagefright_foundation and
libhardware.

Bug: 33241851
Test: cd hardware/libhardware/modules/sensors/ && mma -j64 -k
BOARD_VNDK_VERSION=current
Change-Id: Ie05de74207d7c31598d2cad55ea6b7b8acace0e4
2017-06-23 11:34:15 -07:00
Tomasz Wasilczyk
0526b2c9a8 resolve merge conflicts of a9e037ed to oc-dev-plus-aosp
am: b576a165fa

Change-Id: I7b24eff44f7ff1bdd859f72ac0af265a9c5caa4c
2017-06-10 00:46:08 +00:00
Tomasz Wasilczyk
b576a165fa resolve merge conflicts of a9e037ed to oc-dev-plus-aosp
Test: it builds on AOSP and master
Change-Id: Ic48edc2081579656be43f92ab20ec7a9720595bf
2017-06-09 15:46:42 -07:00
Tomasz Wasilczyk
e2adb6d923 Merge "tune command execute time to resolve FPE_INTDIV error" 2017-06-09 22:25:35 +00:00
Tomasz Wasilczyk
9ec8bc4acc Merge "tune command execute time to resolve FPE_INTDIV error" 2017-06-09 20:12:12 +00:00
Liu Changcheng
d1d3a96bed tune command execute time to resolve FPE_INTDIV error
There's below error which trigger FPE_INTDIV becuase tuner->config isn't
set in time.

CMD_TUNE is executed before CMD_CONFIG after being opened immediately
11:27:10.307 21151 21151 I radio_hw_stub: rdev_open_tuner rdev 0x7b36ea03e000
11:27:10.307 21151 21151 V radio_hw_stub: send_command_l 1 delay_ms 500
11:27:10.307 21151 21151 V radio_hw_stub: send_command_l CMD_CONFIG type 0
11:27:10.307 21151 21151 I radio_hw_stub: rdev_open_tuner DONE
11:27:10.307 21151 22015 I radio_hw_stub: callback_thread_loop
11:27:10.603 21151 22015 E radio_hw_stub: callback_thread_loop processing command 4 time 1321010830.603019830
11:27:10.604 21151 22015 F libc    : Fatal signal 8 (SIGFPE), code 1, fault addr 0x7b36e704b5d6 in tid 22015 (sound trigger c)
11:27:10.632 22021 22021 F DEBUG   : signal 8 (SIGFPE), code 1 (FPE_INTDIV), fault addr 0x7b36e704b5d6

There's no need to use seq lock to correct the sequence. Adjust the time
is the simple way to fix above error.

Change-Id: I1bd5535840fe990db1f6c355af85c93443d9de87
Signed-off-by: Liu Changcheng <changcheng.liu@intel.com>
Signed-off-by: Jerry Liu <primerlink@gmail.com>
2017-06-05 14:19:53 -07:00
Vijay Venkatraman
8352c0dddf Add libhardware_headers and libutils
Bug: 33241851
Test: build target and pass CTS
Test: With BOARD_VNDK_VERSION, mma works
Change-Id: I3303ed86d49207987dc611b3a2112e9361ddd979
2017-06-02 15:56:37 -07:00
Alexey Polyudov
7cc5031132 Merge "sensors: route sensor handle for multi-hal event injection" 2017-05-25 21:00:19 +00:00
Alexey Polyudov
1c50cefc4e sensors: route sensor handle for multi-hal event injection
Change-Id: Iad65c8b7eea7fbe89747123bd3364b6dcde8b839
2017-05-23 18:58:25 -07:00
Tomasz Wasilczyk
13f562865f Make antenna always connected.
Setting configuration shouldn't change antenna state.

Test: instrumentation
Bug: b/36863239
Change-Id: I107c8d45928de2a5bc9c04d9db327a85e5760370
2017-05-17 16:23:28 -07:00
TreeHugger Robot
750b027b93 Merge "Add support of sensor direct report and operation parameter" 2017-05-05 03:06:23 +00:00
Peng Xu
f14a550e7d Add support of sensor direct report and operation parameter
Adds sensor direct report mode support to multihal. Limited
by hal API only the first HAL in configuration list can support
sensor direct report.

Sensor operation parameter support in multihal module is added in
this CL.

In treblized device multihal is enabled by default and implementation
is included in default implementation. Remove multihal shared lib
generation in device specified PRODUCT_FULL_TREBLE.

Test: warning message shows up on device that specified both
      PRODUCT_FULL_TREBLE and USE_SENSOR_MULTI_HAL flags.
Test: cts test passes
Change-Id: I868e7c1ce727370b333f80bbfe737fb106f6d106
2017-05-04 18:12:15 -07:00
Eric Laurent
062adf7689 Merge "usb audio: check proxy_prepare() errors in opne_input_stream()" into oc-dev am: 99d790b67a
am: 896ed1ea40

Change-Id: I1dd44bf1e73e44ee81f4183adc97c511920b8c18
2017-05-04 20:18:02 +00:00
Eric Laurent
896ed1ea40 Merge "usb audio: check proxy_prepare() errors in opne_input_stream()" into oc-dev
am: 99d790b67a

Change-Id: I14d7412015b7c64dc6ffa94a1df0d0d26d622193
2017-05-04 20:14:31 +00:00
TreeHugger Robot
99d790b67a Merge "usb audio: check proxy_prepare() errors in opne_input_stream()" into oc-dev 2017-05-04 20:07:47 +00:00
Peng Xu
84ffda26d4 Merge "Move default multihal configuration file to /vendor/..." into oc-dev am: d3f4f14218
am: 8449dfc061

Change-Id: Ib25322e4ffba41373317bf7251a511f2b3a4075b
2017-05-04 02:14:46 +00:00
Peng Xu
8449dfc061 Merge "Move default multihal configuration file to /vendor/..." into oc-dev
am: d3f4f14218

Change-Id: I569ec7b877e88b7a119ea22485cdfe59ab12573f
2017-05-04 02:10:16 +00:00
TreeHugger Robot
d3f4f14218 Merge "Move default multihal configuration file to /vendor/..." into oc-dev 2017-05-04 02:05:14 +00:00
Peng Xu
900cfac9ee Move default multihal configuration file to /vendor/...
Move default multihal configuration file path to
/vendor/etc/sensors/hals.conf. Retained old definition but changed
varible name to mark it deprecated. get_so_paths() is modified
to search both new and old path for configuration file.

MULTI_HAL_CONFIG_FILE_PATH is only used by hidl default
implementation at this moment outside multihal module.

Bug: 35947802
Test: build ok, sensor works on 2017 devices
Change-Id: I443ff71fa194383646108c8eb0c5438d150a5886
2017-05-03 15:54:02 -07:00
Eric Laurent
981f774496 usb audio: check proxy_prepare() errors in opne_input_stream()
Make sure that open_input_stream() reflects audio parameters
modifications done by proxy_prepare() and returns an error with
proposed parameters if needed.
Alos do not overwrite adev->device_sample_rate when opening an
input stream as this is driven by the output stream.

Bug: 37949012
Test: audio capture, playback and calls over USB headset.
Change-Id: I45fcd895b9a95e7673f2232b4a98c74be0548d0d
2017-05-03 12:53:06 -07:00
Tomasz Wasilczyk
04f5233cb7 Merge commit 'b28bdeefe25a69d9dd2d9c7adfa11b9aadb7baad' into manual_merge_b28bdeef
Bug: 37512442
Bug: 37159108
Test: it builds

Change-Id: I96a78d45e9f63f82a0b0b904c1ecdcd8fe4ff564
2017-05-01 16:38:39 -07:00
Tomasz Wasilczyk
1a7b1be98d Merge "Convert radio.fm.default to soong, set Werror flag and fix warnings." 2017-05-01 22:09:21 +00:00
Tomasz Wasilczyk
4b2daf73c6 Convert radio.fm.default to soong, set Werror flag and fix warnings.
It requires all devices that set AUDIOSERVER_MULTILIB := 64, to specify
64-bit binary when installed (PRODUCT_PACKAGES += radio.fm.default:64).

Bug: 37512442
Bug: 37159108
Test: it builds
Change-Id: I9be897bb1794a12953fe77665596d00519aeac28
2017-05-01 10:12:22 -07:00
Tomasz Wasilczyk
180b7a37b3 Convert radio.fm.default to soong, set Werror flag and fix warnings.
It requires all devices that set AUDIOSERVER_MULTILIB := 64, to specify
64-bit binary when installed (PRODUCT_PACKAGES += radio.fm.default:64).

Bug: 37512442
Bug: 37159108
Test: it builds
Change-Id: I9be897bb1794a12953fe77665596d00519aeac28
2017-04-28 13:57:05 -07:00
Peng Xu
d2f98c1f8a Merge "Correct inotify usage and fix strong count accounting error" into oc-dev am: 3941fc8a67
am: fd7c1ffbcb

Change-Id: I7226cabce79467cd9334b1b7f01f7af367b5ec9f
2017-04-27 18:02:13 +00:00
Peng Xu
fd7c1ffbcb Merge "Correct inotify usage and fix strong count accounting error" into oc-dev
am: 3941fc8a67

Change-Id: I5ea6ca8dd67ceac14e8d90d263917c02c0563896
2017-04-27 17:45:07 +00:00
Peng Xu
172c4014f3 Correct inotify usage and fix strong count accounting error
Fix an error in polling of inotify fd to avoid 100% CPU usage.
Refactored code to use android Looper.

Fix a string count accounting error that causes unpaired decStrong
crashing sensor hidl service.

Bug: 37719320
Bug: 37714835
Test: no longer have 100% CPU usage.
Test: tested connection of a few mouse/keyboard/usb disk/gnubby
      no crash observed.
Test: cts still working properly after fix.
Change-Id: Ibaa026151e5e4919d8dd134c16f5865d5e30ef8a
2017-04-27 00:22:56 -07:00
Greg Kaiser
23c710e7b2 nfc_nci_example: Switch to C++
Our custom UNUSED_ARGUMENT macro was redundant with the sys/defs.h
__unused macro, so it needed to be removed.  But rather than
switch to __unused, we opt to switch this code to C++, so we can
comment out parameter names to silence compiler warnings about
unused arguments.

The switch to C++ requires casting the result of calloc.  We
also change our function argument indentation per our C++
style rules while we're in here.

Test: Compiled and confirmed no compiler warnings.

Change-Id: Ibd0eef7787843597917c3e0e71bdd772f6e9e876
2017-04-25 09:11:27 -07:00
Peng Xu
43320e1095 Build dynamic sensor host test only for linux host am: cc2a92de7b
am: 7ac3e70649

Change-Id: I0f629e859602bb98f23fa5ca5b70c44e0183ea2e
2017-04-21 23:19:02 +00:00
Peng Xu
7ac3e70649 Build dynamic sensor host test only for linux host
am: cc2a92de7b

Change-Id: If8bfba744dc5e3eab942b479fd8b993104a93822
2017-04-21 23:10:25 +00:00
Peng Xu
cc2a92de7b Build dynamic sensor host test only for linux host
This fix a build breakage for mac.

Bug: 37482951
Test: m checkbuild sdk_repo -j32 works
Change-Id: I9d7f35abbaef6c830ba0f7e804451f98a128d887
2017-04-21 15:26:09 -07:00
Peng Xu
fada5a0a18 HID dynamic sensor: add support to three types of sensor am: 4715d1734d
am: 852a75717d

Change-Id: I27ab261f0a6d859a74241fb03bffd572e71f4b47
2017-04-21 17:19:16 +00:00
Peng Xu
852a75717d HID dynamic sensor: add support to three types of sensor
am: 4715d1734d

Change-Id: If2eaeaa5c900a7a7e4f6b5a119866fe551bc603f
2017-04-21 17:16:01 +00:00
Peng Xu
4715d1734d HID dynamic sensor: add support to three types of sensor
Implemented HID dynamic sensor using linux hidraw driver and
HidUtils. Support the following cases:

1) HID Sensor spec defined accelerometer, gyroscope, magnetometer
   and orientation (quaternion).
2) Android defined type sensors (HID sensor custom type): ambient
   temperature, barometer, light and heart rate sensor.
3) Android custom type sensor (based on HID sensor custom type).

Test: run tests/examples in test/
Test: test with a USB HID hardware (launchpad sensor) and marlin
Bug: 37482951
Bug: 31026607
Change-Id: I9d679fb34d15324a9df1cf19647ea638fd1a0e68
2017-04-20 23:23:53 +00:00
Peng Xu
fd0b843e0a Merge "Hid Utilities for HID based dynamic sensor" into oc-dev am: 2577ac2cad
am: 9347e65c5d

Change-Id: I0b47b2376b7140417dadc9ec4bdf5f74ad52f970
2017-04-20 15:16:50 +00:00
Steven Moreland
b3741e1bc7 gralloc: fix dependencies
Test: works with BOARD_VNDK_VERSION := current
Bug: 33241851
(cherry picked from commit e7722d4e3f)
Merged-In: I145488dbf9b6e5257bee47920643c03c31eafbf4
Change-Id: I145488dbf9b6e5257bee47920643c03c31eafbf4
2017-04-19 22:16:20 +00:00
Peng Xu
9347e65c5d Merge "Hid Utilities for HID based dynamic sensor" into oc-dev
am: 2577ac2cad

Change-Id: I037c9d5fc4bcefa0ee83cbb6f0f9fcb973333485
2017-04-19 21:57:35 +00:00
TreeHugger Robot
2577ac2cad Merge "Hid Utilities for HID based dynamic sensor" into oc-dev 2017-04-19 21:23:08 +00:00
Steven Moreland
24576e1221 nfc.default: remove unneeded dependency
libcutils was not used

Test: links
Bug: 33241851
(cherry picked from commit d23bf8aabb)
Merged-In: Ic53e48b95461bb09b44df83952288a96ba9af65a
Change-Id: Ic53e48b95461bb09b44df83952288a96ba9af65a
2017-04-19 10:32:56 -07:00
Peng Xu
5beee10b17 Hid Utilities for HID based dynamic sensor
An HID utility library for constructing HID based dynamic sensor.

Primary functionality is in HidParser.h, which parses HID
descriptor into useful data structures. Supporting classes and
structures can be used individually as well.

Test: run tests in HidUtils/test
Bug: 37482274
Change-Id: Icfb59414bb6a1e7b6cdd1078a1a83820e70bbef8
2017-04-18 15:56:57 -07:00
Tomasz Wasilczyk
116c94ce58 Merge "Make double-open radio tuner failure more verbose." 2017-04-18 19:05:52 +00:00
Treehugger Robot
c871add2f9 Merge "Fix format string warnings in InputHub.cpp." 2017-04-18 18:44:09 +00:00
Steven Moreland
00286df627 gralloc: fix dependencies am: e7722d4e3f
am: a81298a515

Change-Id: I1b7a4a68b36560b12b9301f3b9f2a7771c614183
2017-04-18 02:59:09 +00:00
Steven Moreland
a81298a515 gralloc: fix dependencies
am: e7722d4e3f

Change-Id: Ic543ed400eacd52ee4a99119776e1378e2358e91
2017-04-18 02:01:48 +00:00
Liu Changcheng
f292d562d4 tune command execute time to resolve FPE_INTDIV error
There's below error which trigger FPE_INTDIV becuase tuner->config isn't
set in time.

CMD_TUNE is executed before CMD_CONFIG after being opened immediately
11:27:10.307 21151 21151 I radio_hw_stub: rdev_open_tuner rdev 0x7b36ea03e000
11:27:10.307 21151 21151 V radio_hw_stub: send_command_l 1 delay_ms 500
11:27:10.307 21151 21151 V radio_hw_stub: send_command_l CMD_CONFIG type 0
11:27:10.307 21151 21151 I radio_hw_stub: rdev_open_tuner DONE
11:27:10.307 21151 22015 I radio_hw_stub: callback_thread_loop
11:27:10.603 21151 22015 E radio_hw_stub: callback_thread_loop processing command 4 time 1321010830.603019830
11:27:10.604 21151 22015 F libc    : Fatal signal 8 (SIGFPE), code 1, fault addr 0x7b36e704b5d6 in tid 22015 (sound trigger c)
11:27:10.632 22021 22021 F DEBUG   : signal 8 (SIGFPE), code 1 (FPE_INTDIV), fault addr 0x7b36e704b5d6

There's no need to use seq lock to correct the sequence. Adjust the time
is the simple way to fix above error.

Change-Id: I1bd5535840fe990db1f6c355af85c93443d9de87
Signed-off-by: Liu Changcheng <changcheng.liu@intel.com>
Signed-off-by: Jerry Liu <primerlink@gmail.com>
2017-04-18 09:00:32 +08:00
Tomasz Wasilczyk
12ddfd0e2a Make double-open radio tuner failure more verbose.
Bug: b/36863239
Test: manual (watching logs)
Change-Id: I032349eaa11b4a8008f09113c3898452572db219
2017-04-17 17:05:38 -07:00
Steven Moreland
e7722d4e3f gralloc: fix dependencies
Test: works with BOARD_VNDK_VERSION := current
Bug: 33241851
Change-Id: I145488dbf9b6e5257bee47920643c03c31eafbf4
2017-04-17 16:30:05 -07:00
Steven Moreland
6d7ede918d multihal: move to vendor am: 17d4579494
am: 814cd113c6

Change-Id: I295965266bab46c1ee16edc39f44d3ac1c12b7f5
2017-04-14 23:50:15 +00:00
Steven Moreland
814cd113c6 multihal: move to vendor
am: 17d4579494

Change-Id: I93be9bfd26c24aaaeaa5a38a6665ec3f285bb7e5
2017-04-14 23:44:59 +00:00
Steven Moreland
17d4579494 multihal: move to vendor
Test: works
Bug: 33241851
Change-Id: I752d2a67c0dde2c635970f6aa24f58f5da85e785
2017-04-14 11:07:49 -07:00
Steven Moreland
9a00f689fa Merge "nfc.default: remove unneeded dependency" into oc-dev am: 19e18b3d0e
am: b2e7fd4712

Change-Id: Ic7a2d890fea36f046513fb48935af8fa96095777
2017-04-13 04:31:08 +00:00
Steven Moreland
b2e7fd4712 Merge "nfc.default: remove unneeded dependency" into oc-dev
am: 19e18b3d0e

Change-Id: I694ac1aba965849f5f4bd59b3d7bd61bb60da4e6
2017-04-13 04:25:06 +00:00
Steven Moreland
d23bf8aabb nfc.default: remove unneeded dependency
libcutils was not used

Test: links
Bug: 33241851
Change-Id: Ic53e48b95461bb09b44df83952288a96ba9af65a
2017-04-12 23:00:56 +00:00
Steven Moreland
b61c0f7d78 consumerir.default: remove unneeded dependency.
Only liblog things are being used but libcutils was being included.

Test: links
Merged-In: I50492f49cef449256cad49823a21166f0d089bac
Change-Id: I50492f49cef449256cad49823a21166f0d089bac
2017-04-12 18:51:15 +00:00
Mark Salyzyn
8774152335 resolve merge conflicts of 7c451a93 to oc-dev-plus-aosp
am: 1ae7379baa

Change-Id: Id715cb96a71fc9e48e14ff2e6f9e4883402aa6f6
2017-04-12 16:28:32 +00:00
Mark Salyzyn
1ae7379baa resolve merge conflicts of 7c451a93 to oc-dev-plus-aosp
Test: I solemnly swear I tested this conflict resolution.
Bug: 34250038
Change-Id: I4196a6d5a1365106643ac6c1548fd86faffead6f
2017-04-12 09:11:38 -07:00
Treehugger Robot
15c75832fd Merge "audio.*.default: remove unneeded dependency/IWYU" 2017-04-12 15:49:42 +00:00
Steven Moreland
4e934043ed Merge "consumerir.default: remove unneeded dependency." into oc-dev am: 64e609dda8
am: 9e610d1a3b

Change-Id: I92c961d3fee7de44b261e379b36147126f3b8392
2017-04-12 10:04:21 +00:00
TreeHugger Robot
64e609dda8 Merge "consumerir.default: remove unneeded dependency." into oc-dev 2017-04-12 09:54:11 +00:00
Peng Xu
c6fccf3fd4 Merge "Dynamic sensor manager -- implementation of basic sensor daemon" into oc-dev am: 7c371eb532
am: 2fa64e81e1

Change-Id: Id846a254e47ab6c465a909e083d5c22dab29bfef
2017-04-12 06:41:39 +00:00
Peng Xu
7c371eb532 Merge "Dynamic sensor manager -- implementation of basic sensor daemon" into oc-dev 2017-04-12 06:29:13 +00:00
Steven Moreland
9e20781d64 consumerir.default: remove unneeded dependency.
Only liblog things are being used but libcutils was being included.

Test: links
Change-Id: I50492f49cef449256cad49823a21166f0d089bac
2017-04-12 03:25:10 +00:00
Steven Moreland
1df2ad3daf audio.*.default: remove unneeded dependency/IWYU
libcutils not needed as only functions from liblog are being used

Test: links
(cherry picked from commit 02b5d168f2)
Merged-In: I2a2cb58d883c0ec1e26a2f023865b137517da432
Change-Id: I2a2cb58d883c0ec1e26a2f023865b137517da432
2017-04-11 20:11:15 -07:00
Steven Moreland
9f43245041 audio.*.default: remove unneeded dependency/IWYU am: 02b5d168f2
am: 57963dae24

Change-Id: I0f4b2494e70fa23bba69409d81b866f9ae066fca
2017-04-11 21:28:02 +00:00
Mark Salyzyn
d88dfe8607 libhardware: deprecate cutils/log.h
Replace cutils/log.h with log/log.h. Sort headers. Minimize conflicts.
Add missing required headers.

Test: compile
Bug: 34250038
Change-Id: I5c0f231cbfed90b73e0538c9d32ad3226c7cc5e4
2017-04-11 10:50:06 -07:00
Steven Moreland
02b5d168f2 audio.*.default: remove unneeded dependency/IWYU
libcutils not needed as only functions from liblog are being used

Test: links
Change-Id: I2a2cb58d883c0ec1e26a2f023865b137517da432
2017-04-11 17:37:41 +00:00
Peng Xu
18082bd61f Dynamic sensor manager -- implementation of basic sensor daemon
Library to handle dynamic sensor connection. There are two way to use
this: as hal extension or standalone hal module.

In hal extension mode: add libdynamic_sensor_ext in dependency of hal,
instantiate DynamicSensorManager with appropriate parameters. Then
for all sensor requests, if the handle is owned by dynamic sensor
manager, forward the request.

In standalone mode, add sensor.dynamic_sensor_hal into device make
file. Usually, this also means multihal is necessary. Add
sensor.dynamic_sensor_hal into multihal configuration file.

A dummy sensor module is included for testing.

Test: tested with cts dynamics sensor related test and demo app.
      also verified sensor basic operation with sensor logger.

Change-Id: I16612935fc21b06c173aca875401ece37c6bde01
2017-04-07 20:54:18 +00:00
Ari Hausman-Cohen
7d19579b78 Merge V4L2 camera HAL from nyc-iot-dev into master
Bug: 35856819
Test: Build on master
Change-Id: Ie5bd08bb82cc810964ff9d9ed046a7bc33d16187
2017-03-27 15:19:04 -07:00
Ari Hausman-Cohen
2d1ea3a164 Switch from ScopedFd to unique_fd.
ScopedFd is being deprecated.

Bug: 35856819
Test: Still builds on nyc-iot-dev, now builds on master too.
Change-Id: Ibf131cbac218d581beee17e70f83042289382f17
2017-03-24 18:47:08 -07:00
David Lin
488c55c858 Merge "vibrator: fix issue with ledtrig-transient support" am: 60849b8da4 am: 95d22ed018
am: fdfbcda7ad

Change-Id: Ib2df8e109d5842e3d3eaa0846a153c997908d967
2017-03-11 01:35:14 +00:00
David Lin
95d22ed018 Merge "vibrator: fix issue with ledtrig-transient support"
am: 60849b8da4

Change-Id: I539a36cf4b0ec0d991fefae22f0e65d68704da8f
2017-03-11 01:28:11 +00:00
Peng Xu
e12a0cc39d Merge "Dynamic sensor manager module - framework" 2017-03-10 22:21:31 +00:00
Po-Chien Hsueh
69646f44a5 Merge "Move default HAL libraries to vendor" 2017-03-09 05:15:37 +00:00
David Lin
4e8f561fcd vibrator: fix issue with ledtrig-transient support
There's a problem with enabling the transient trigger in the HAL, that is
the trigger function exports tree properties - activate, state, and
duration which require to be chown'd to system:system during the init
process. Hence, the trigger will be now enabled in the init process and
the HAL will use the "activate" property to determine if the device has
vibrator support via ledtrig-transient.

Test: device vibrates with the driver supports ledtrig-transient

Change-Id: Ieb195ddc199c6372f5dcf3ca1b2be4fd59724717
Signed-off-by: David Lin <dtwlin@google.com>
2017-03-08 17:41:53 -08:00
Peng Xu
57d8af7f5e Dynamic sensor manager module - framework
Library to handle dynamic sensor connection. There are two way to use
this: as hal extension or standalone hal module.

In hal extension mode: add libdynamic_sensor_ext in dependency of hal,
instantiate DynamicSensorManager with appropriate parameters. Then
for all sensor requests, if the handle is owned by dynamic sensor
manager, forward the request.

In standalone mode, add sensor.dynamic_sensor_hal into device make
file. Usually, this also means multihal is necessary. Add
sensor.dynamic_sensor_hal into multihal configuration file.

This CL implements the dynamic sensor manager framework. Sensor daemon
will be added in follow up CL.

Test: test compile (functionality test done in a follow up CL)

Change-Id: I3b96ee135d8dbe3e199af01bed4b61637358803e
2017-03-07 20:50:56 -08:00
Tomasz Wasilczyk
ad78c8d922 Check set_configuration input to make VTS negative test pass.
Bug: b/33382424
Test: VTS
Change-Id: I11b00e0a9797a30549cca989ea5c6a09c2d513c2
2017-03-07 17:05:41 -08:00
Po-Chien Hsueh
c535b2fded Move default HAL libraries to vendor
Libraries under /hardware/libhardware/modules should go to /vendor/.

These are conventionl HALs for default implementations, most of them
are not used.

Camera and thermal are already moved in other CLs.

Bug: 35907904
Test: Compiled and checked install path. Verified on Sailfish with
$ lsof | grep default.

Change-Id: Ibde574001c01cbfea014a20a0fbbb3265e6cdc8a
2017-03-07 11:28:32 +08:00
Jiyong Park
5067fe1a19 Move thermal HAL to vendor partition
In order to build generic system image that is agnostic to SoC or
device, HALs should be moved from system partition to vendor
partition.

Bug: 34826389, 35743509
Test: build & run and check whether the HAL is loaded from
/vendor/lib[64]/hw.
$ su; lsof | grep thermal.

Change-Id: Ia2bb060590f31688528de4a3b9b9ab8fbd376b6c
2017-02-27 13:11:33 +09:00
Tomasz Wasilczyk
33683bf92b Review radio metadata allocations/deallocations.
Bug: b/34054813
Test: VTS, manual
Change-Id: I1cbd7baf5b852cd3d4cab374eb67289f3938fff3
2017-02-16 22:59:22 +00:00
David Benjamin
5cb33dca19 Fix format string warnings in InputHub.cpp.
The format string for ssize_t is %zd, not %d.

Change-Id: I3a2eec959f8aa8fc7eb55522642cf22681e0c8ef
Test: mma
2017-02-13 15:37:23 -05:00
Tomasz Wasilczyk
3e9a5396b0 Merge "Add radio HAL stub to the build list; fix format warning." am: cd4bc27771 am: 9e1874d6a3 am: ac4a492730
am: 105fea4ab3

Change-Id: I2b43feb5969e39b80740716f08cf559b660eaf21
2017-02-09 20:27:33 +00:00
Tomasz Wasilczyk
ac4a492730 Merge "Add radio HAL stub to the build list; fix format warning." am: cd4bc27771
am: 9e1874d6a3

Change-Id: I01a1c7aa5db67f4bb368fbadc5939fd1fc3df5c8
2017-02-09 20:23:31 +00:00
Tomasz Wasilczyk
dd2f59e4ab Add radio HAL stub to the build list; fix format warning.
Test: it builds
Change-Id: Id093441b9909f564d30f8351931ee3ccf55f2617
2017-02-08 15:04:31 -08:00
Ari Hausman-Cohen
cf688cc15d Add README for V4L2 Camera HAL
Change-Id: Ic4038d471b79685ee6139bfb4613aa5b87b03e72
2017-01-17 15:08:33 -08:00
Ashutosh Joshi
9eb5bbd45f Drop support for old Sensor HALs.
Dropping support for Sensor HAL version 1.0.
Sensor HALs version 1.1 and 1.2 are already depracated.
This makes version 1.3 as the earliest supported version.

Test: Sensors CTS tests still pass.
Change-Id: I806ce1d0d9277cbb312d9f90749975420cef2109
2017-01-09 17:09:35 -08:00
Tomasz Wasilczyk
3c7297a55a Make metadata field mandatory for program info struct.
Test: VTS, manual
Change-Id: I105f960442839f512db593615e2f2548ffdded35
2017-01-06 14:19:52 -08:00
Romain Guy
d0eb44c6da Add support for *_FP16 pixel formats
Bug: 32984164
Test: compile
Change-Id: I0851c62f140801c6784fdb597b3d947402aa5876
2016-12-16 09:53:20 -08:00
Nick Vaccaro
8a83708dae Sensors: MultiHal: add support for HIDL
Add get_multi_hal_module_info() to support using multi-hal
functionality within the HIDL sensor implementation.

Move externally relevant constants and prototypes to new multihal.h
file.

Add new Android.bp for Treble to build multi-hal into a static
library that is now included by the HIDL sensor implementation.

Bug: 32022308
Change-Id: I2b3afa9ff1e0a2e5a098e643dde99ec86bb88206
2016-12-15 14:09:34 -08:00
TreeHugger Robot
00f43fc376 Merge "fifo: add dependency needed after re-implementation of MonoPipe" 2016-12-14 00:29:01 +00:00
Eric Laurent
de8e013f54 stub radio HAL: fix default antenna connected state for FM.
Bug: 33583729
Change-Id: Ifbd2c95ab34a8faa7d31f4a1b2f28c6d7df38766

Test: build and run broadcast radio VTS
2016-12-13 14:21:51 -08:00
Glenn Kasten
57eaa9bcd8 fifo: add dependency needed after re-implementation of MonoPipe
MonoPipe is being re-implemented on top of FIFO in audio_utils.

Test: builds OK
Change-Id: I42a30c5cc859150c3b9e2b23aad3c9c14c7c341a
2016-12-12 15:54:14 -08:00
Ari Hausman-Cohen
c9bfa59e13 Reduce sizes camera reports.
Due to gpu freezing on larger images.

BUG: http://b/33221285, http://b/33058456
TEST: ImageWriter cts tests no longer fail.
Change-Id: Ibc0fe4ec78181646074333c50ef6cd2b386ba3a4
2016-11-29 18:42:41 -08:00
Ari Hausman-Cohen
5acb400d18 Fix camera close sequencing.
Flush the device before disconnecting from it.
Hasn't caused identifiable bugs yet, but seems
dangerous and easy to fix.

TEST: builds & runs sample

Change-Id: Icaf27d4de5628087278b84bff586aab8e1e62e28
2016-11-29 18:41:56 -08:00
Ari Hausman-Cohen
0d3a35d6e6 Add stubs for missing metadata entries
AE lock, AWB lock, crop region, test pattern mode/available modes,
hyperfocal distance, partial result count, and scene flicker.

BUG: b/33110513
TEST: CTS testCameraCaptureResultAllKeys and testKeys pass
Change-Id: I1f2e73647bdff3e4382b3186cfd7a5d4ee4e8f0c
2016-11-23 15:53:22 -08:00
Ari Hausman-Cohen
55fb035c11 Remove incorrect menu support from metadata factory
The partial_metadata_factory method to create V4L2 controls
incorrectly used V4L2_CTRL_TYPE_MENU - it assumed that all
values between min and max were supported. Actually, each value
must be queried using QUERY_MENU to confirm support.

BUG: b/30921166
TEST: unit tests pass, android.hardware.camera2.cts.CaptureRequestTest#testSceneModes now passes.
Change-Id: I763eb767e21c082a629d0ba91fdaaa0d6ce162f5
2016-11-23 14:57:39 -08:00
Ari Hausman-Cohen
ef1c325cd4 Get real timestamps, better frame durations.
Uses clock_gettime instead of using a spoofed "1" all the time.

Only offers approximate default FPS of 30 as the valid range,
instead of the true maximum reported by the device,
as actually changing it isn't hooked up yet.

Removes the sensor frame duration variable;
CTS at least will just default to reading from the timestamp.

BUG: b/29457051
TEST: unit tests pass. Some previously failing cts tests now pass.

Change-Id: I505d7dd51fe45de55214cb802184bea46245f316
2016-11-23 14:57:39 -08:00
Ari Hausman-Cohen
ede3298608 Only report AE_MODE_OFF if supported.
Supported if exposure time & sensitivity are available.

BUG: b/30510395
TEST: unit tests pass, previously failing CTS test
(CaptureRequestTest#testFlashControl) now passes.

Change-Id: Ibf99b2c0d8919dc91fcd6280042a6974d0f3690c
2016-11-23 14:57:39 -08:00
Ari Hausman-Cohen
ef52310613 Correctly process streams
The reference implementation stream validation/setting
was all out of whack, particularly the handling of "reuse"
streams. This CL does away with that, and plugs in the
static_properties/request_tracker validation/tracking of
configured streams.

Implementation specific features, such as gralloc flags,
are moved down into the V4L2Camera class out of the Camera class.

BUG: https://b/33057320, https://b/31044638
TEST: unit tests pass, some previously failing CTS tests are passing
(and no regressions), simple test camera preview app runs.

Change-Id: Ie8568239a1348dac45bf829ef928e500e01fdcda
2016-11-23 14:57:36 -08:00
liuchao
2c038fa66f Merge "Add else branch to avoide fclose(NULL)" am: 10b043bb13 am: dded161774 am: 903044c667
am: f7e0b5185e

Change-Id: I63549a1b35a0ffb82f90f0cf0ea0fdc5005f4943
2016-11-22 16:52:00 +00:00
liuchao
903044c667 Merge "Add else branch to avoide fclose(NULL)" am: 10b043bb13
am: dded161774

Change-Id: Ifda3e38fe8129b8ea680c99689f9b0a49fdba831
2016-11-22 16:26:40 +00:00
liuchao
dded161774 Merge "Add else branch to avoide fclose(NULL)"
am: 10b043bb13

Change-Id: I224fec5854599172b49792167a7c92af56d55443
2016-11-22 16:24:09 +00:00
Ari Hausman-Cohen
b5edf328ed Add PIPELINE_DEPTH metadata status
BUG: b/33011972
TEST: failing CTS test now passing
Change-Id: I888244707097e53b71edab4c1e9e0def105a5ed4
2016-11-21 17:48:27 -08:00
Ari Hausman-Cohen
a5c9bfde31 Always fill max buffers when setting format.
BUG: b/33011932
TEST: failing CTS test is now passing
Change-Id: I3ac961c83ec3e49c1d2e7aeb44ad09c5a2e049ca
2016-11-21 17:48:21 -08:00
Ari Hausman-Cohen
2491b37d80 Dynamic default metadata based on templates
Instead of controls picking their own defaults,
a delegate taking a mapping of template : desired default
is taken instead. These defaults are honored if able.

BUG: b/31017806
TEST: unit tests pass, multiple CTS tests fixed, test app runs.
Change-Id: I8212580c9aee1d7fe223fa6b3ff17a6cfb97552f
2016-11-21 17:48:18 -08:00
Ari Hausman-Cohen
e31e1f33b4 Only provide templates for supported capabilities
Plugs in the StaticProperties class for ease of accessing the
static metadata.

Expands StaticProperties to handle checking template support.

Test: Unit tests pass, test app runs, fixes 2 failing CTS tests on rpi3
BUG: b/32951283
Change-Id: I3077a3507751c3072b88f7d91902bdaa5b53c30e
2016-11-21 17:17:33 -08:00
Ari Hausman-Cohen
c5a4852451 Implement flushing and improve request tracking.
BUG: https://b/29937783, https://b/32941326
TEST: unit tests pass, fixes 8 failing cts tests
Change-Id: Idc390bdc1e51ba2bdbda91d90acc459a09a5f174
2016-11-21 17:17:29 -08:00
Ari Hausman-Cohen
ad6fe2b033 Remove spurious logging.
When logging was enabled, the log was a little *too*
verbose, making it unreadable. Removing some of the
more frequently hit log messages.

BUG: b/32942120
TEST: Can run camera samples
Change-Id: I136c20279699e4c87b3ef1c3042b88c20c301002
2016-11-18 11:27:30 -08:00
Ari Hausman-Cohen
089c737809 Correct FormatMetadataFactoryTest
Was assuming HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED was either YUV or JPEG.

BUG: b/32942342
TEST: unit tests pass
Change-Id: I3aaa6ee8040efa699c2856b687fc3b8a6d84b5cc
2016-11-16 11:27:28 -08:00
liuchao
df7d84a049 Add else branch to avoide fclose(NULL)
This fixes a potential NULL-pointer reference crash in case
cpu_file == NULL and pass NULL to fclose().

Test: mm -j 8
Change-Id: Ib3267676bea910533bd85ac2935efe02d361fc6b
2016-11-16 09:26:53 +08:00
Ari Hausman-Cohen
0b2113c54f Track in-flight requests
This allows for verification of callbacks, and will also be helpful
when implementing flush.

BUG: 31653306
TEST: unit tests pass, test program runs
Change-Id: Id43d6cb3c2b9ca4adc96fc08282f88e0b7b904e1
2016-11-11 15:04:57 -08:00
Dmitry Shmidt
4d2f024df6 resolve merge conflicts of d20fe45 to stage-aosp-master
am: a905c234da

Change-Id: I7406c544bdb2a0ffa545640bc6a4e56acbd4e1ef
2016-10-26 23:13:58 +00:00
Dmitry Shmidt
a905c234da resolve merge conflicts of d20fe45 to stage-aosp-master
Change-Id: I4669a7566205f01217c9104b489fed4ee8d3fe3b
2016-10-26 16:02:39 -07:00
Dmitry Shmidt
a898f93475 audio: Fix size_t related warnings
Test: manual

Change-Id: I34961243f2d4b95c47d954fc616404391302595a
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2016-10-26 13:54:25 -07:00
Eric Laurent
c37e6fe0ce radio: fixes in stub FM radio HAL.
Change-Id: I0adf39a08a364ffdecb1c7f618190174804865f4
2016-10-25 14:26:29 -07:00
Nick Vaccaro
1e8c5b1e22 Sensors: MultiHal: support sensor API version 1.4 am: c1ded2afef
am: 2fef0a95e9

Change-Id: I5c63fa98b137c64f906543ff23748e2ef683fe8b
2016-10-14 21:42:44 +00:00
Nick Vaccaro
2fef0a95e9 Sensors: MultiHal: support sensor API version 1.4
am: c1ded2afef

Change-Id: I74d275a51937754917d5115750bfb783fbb06b2c
2016-10-14 21:38:48 +00:00
Nick Vaccaro
c1ded2afef Sensors: MultiHal: support sensor API version 1.4
Add ability to support HALs with an API version of
SENSORS_DEVICE_API_VERSION_1_4.

Bug: 32113642
Change-Id: If61ff54faa9aefc959102a097df60e75a230cae3
2016-10-14 10:31:56 -07:00
Glenn Kasten
2494caec36 Be stricter about warnings
Test: build for several platforms
Change-Id: I8d66a74c72713f3cd7021b1924f72ea4a9e11c15
2016-10-07 08:44:58 -07:00
Ari Hausman-Cohen
fb161115c8 Send error notification when request fails.
Sends a generic request error when a request fails.

BUG: 31653322
TEST: Test program runs
Change-Id: Ib0694d655e584dcfeaeacc1ce55177191abe42e3
2016-10-03 14:00:32 -07:00
Ari Hausman-Cohen
0fbcaf53ca Prevent duplicate buffer indices
Track which buffer indices are in use to prevent duplicates.

BUG: 31831808
TEST: Test app runs, enqueue errors no longer showing up in logs.
Change-Id: I319f9a1906170c861e194e357bdb57fab81d8c34
2016-10-03 13:52:44 -07:00
Ari Hausman-Cohen
fbac174a46 Use correct gralloc flags in V4L2 Camera HAL
Also checks gralloc return results, and cleans up style.

BUG: https://b/31595935, https://b/31589070
TEST: test streaming app works
Change-Id: I4d910524ae21a7b666a1f456e2b7122a8671560f
2016-09-30 11:43:14 -07:00
Ari Hausman-Cohen
0457010119 Add RGBA_8888 support to V4L2 camera HAL
Actually returns GBR data for now, based on available formats for
RPi3 camera, but claims it's RGB.

BUG: b/31829804
TEST: test program runs, can handle format 0x1 (RGBA_8888)

Change-Id: I41c9ced5c1fa25d1254530d3d0a1446d2d514a1f
2016-09-30 11:38:01 -07:00
Ari Hausman-Cohen
71cb874e34 Add threading to camera.
Camera now has special synchronized threads to enqueue
buffers and dequeue buffers.

BUG: 29334616
TEST: manually tested with test app

Change-Id: Ibce14cd6b269c4d26403534b3f7985914263bf2b
2016-09-28 14:02:58 -07:00
Ari Hausman-Cohen
2738a9c3b5 Refactor capture processing to be async friendly
Set up a series of methods that can be producers/consumers/callbacks.
For now, they call each other synchronously.

TEST: manually tested with app
BUG: 29334616

Change-Id: Icb6cf9d9970521d5291c54f02dc5032f43b26616
2016-09-28 14:01:47 -07:00
Ari Hausman-Cohen
cb11a4df53 Add request tracking.
RequestTracker keeps track of how many buffers are in flight for
each stream, and what frame numbers correspond to what requests/buffers.

BUG: 31044638
TEST: unit tests pass

Change-Id: I8ef3fcacdf8171514ea7f7eaf77301a641bff61e
2016-09-21 16:42:57 -07:00
Ari Hausman-Cohen
ffb9b72e4e Add configs & validation to static properties
Static properties read and validate stream configurations,
stall durations, and reprocess formats.

Static properties can be used to validate a given
camera3_stream_configuration_t to check if the streams
all work together as defined by the metadata properties.

BUG: 31044638
TEST: unit tests pass
Change-Id: I2c8eecb680cd86fbe0340c07e4d73bd25429b4e9
2016-09-20 18:03:04 -07:00
Ari Hausman-Cohen
737cfd31a6 Add stream capabilites to metadata reader
Read configs, stall durations, and reprocess formats.

BUG: 31044638
TEST: unit tests pass

Change-Id: I9089de0d51b7c4d8ef940a3737785177f257382f
2016-09-20 15:28:27 -07:00
Ari Hausman-Cohen
f45f8d4fa1 Add StaticProperties and MetadataReader
MetadataReader provides a clean wrapper around getting
and translating certain metadata values in a nice form.

StaticProperties will be used by Camera as the source of
truth for metadata properties, extracted directly from a reader,
rather than calling down into the device again.

BUG: 31044638
TEST: unit tests pass
Change-Id: I712a80f87e629a7288c678637de0eae0225acf96
2016-09-16 14:34:28 -07:00
Ari Hausman-Cohen
e7e93ca678 Move V4L2 camera HAL work to libhardware
BUG: 31117512
2016-09-01 14:55:17 -07:00
Greg Kaiser
09c2455a67 Merge "modules/camera: Fix compiler warnings" am: f7888e1130 am: f832261e65 am: d6cebded75
am: c25d13db4a

Change-Id: Ie66d7974be62bb0db5bfcf73a3ddbb28cd9f8390
2016-09-01 01:53:45 +00:00
Greg Kaiser
c25d13db4a Merge "modules/camera: Fix compiler warnings" am: f7888e1130 am: f832261e65
am: d6cebded75

Change-Id: I503be65fbe7c7f40f6700705f70184eebba182ab
2016-08-31 22:10:26 +00:00
Greg Kaiser
f7888e1130 Merge "modules/camera: Fix compiler warnings" 2016-08-31 21:55:30 +00:00
Ari Hausman-Cohen
d77917bde2 Move Camera HAL 3.0 reference implementation.
Moved files to a subdir to allow reference implementations
of other versions to join this same space without conflict.

Chery picked from master.

BUG: b/31117512
TEST: lunch bullhead-eng, make -j32, m -j32 camera.default
Change-Id: I9bc3047bd3c00c53ce4d4e4f2070d8ee1453c936
2016-08-31 13:42:54 -07:00
Ari Hausman-Cohen
9430ad946f Clean up format of V4L2Camera and V4L2CameraHAL.
BUG: 30224839
TEST: unit tests pass
Change-Id: I0d41927fb6e56cf32f5e04a3fe98be1139e6c4a8
2016-08-30 18:19:31 -07:00
Ari Hausman-Cohen
abbf9cc0bd Plug in metadata refactor.
Replaces metadata usage in Camera/V4L2Camera with the
new Metadata class.

Switches Camera from camera_metadata_t to android::CameraMetadata
where appropriate for ease of use/clarity of ownership.

Also cleaned up some "error" logs that were potentially expected,
leaving it to the caller to log if something goes wrong, since
they were numerous and cluttering the log feed.

BUG: https://b/30140438, https://b/29335262
TEST: unit tests pass, test picture program still works,
  tested setting a V4L2 control to a non-default value.
Change-Id: I24e50c9b71736dfc576debf8d09dbe36b9bbf23a
2016-08-30 18:18:28 -07:00
Ari Hausman-Cohen
cf5f57f263 Add states to metadata.
States are dynamically changing values. For now
none of them have implementations; they're all fixed
values.

BUG: 30140438
TEST: unit tests pass
Change-Id: I60f97fce5db4542e6b77694bb323934e32eab9f6
2016-08-29 17:24:58 -07:00
Ari Hausman-Cohen
4f7139e6d9 Move Camera HAL 3.0 reference implementation.
Moved files to a subdir to allow reference implementations
of other versions to join this same space without conflict.

BUG: b/31117512
TEST: lunch bullhead-eng, make -j32, m -j32 camera.default
Change-Id: I9bc3047bd3c00c53ce4d4e4f2070d8ee1453c936
2016-08-26 15:49:50 -07:00
Greg Kaiser
ba31c43d96 Merge "modules/power: Silence compiler warnings" am: cbd7b77367 am: 161beacc8c am: 82fdd04600
am: 81284e97f1

Change-Id: I8de30429715f7f3b551191254a649cfbf6569639
2016-08-25 16:59:22 +00:00
Greg Kaiser
81284e97f1 Merge "modules/power: Silence compiler warnings" am: cbd7b77367 am: 161beacc8c
am: 82fdd04600

Change-Id: I0d4f8aa78f78f3f6d9f2d01171e5cadf052afbba
2016-08-25 16:38:17 +00:00
Greg Kaiser
5e53f5d85e modules/camera: Fix compiler warnings
Change-Id: I9a58f45cbfc09e4e1a243fa657dd0955648bf101
2016-08-25 06:20:32 -07:00
Greg Kaiser
854bf684af modules/power: Silence compiler warnings
Change-Id: Ib70ea23bd70ac39990cee5e1c435e346ab8f244d
2016-08-25 06:13:52 -07:00
Ari Hausman-Cohen
784bc68d3c Added default metadata entries.
Default entries for controls/properties that could theoretically
be queried from/controlled by V4L2, but are not yet implemented
in this HAL.

BUG: 30140438
TEST: unit tests pass
Change-Id: I78264f3f0d37b41614b24ef71000fee175a3bb17
2016-08-24 17:14:40 -07:00
Ari Hausman-Cohen
1026477818 Add default template initialization.
Adds a flow for Metadata to initialize templates.
PartialMetadataInterfaces expose another populate method,
which use a default value getter from ControlOptionsInterfaces.

BUG: 30140438
TEST: unit tests pass

Change-Id: I1c01469dcf4d06f7c4c62ebe2acd3d9b2294a161
2016-08-24 17:14:40 -07:00
Ari Hausman-Cohen
ffdc628720 Add V4L2 Format Metadata Factory.
This factory queries the device for the properties detailing
what formats it supports. Since this may fail, Metadata/V4L2Metadata
was moved from the weird inheritance/constructor stuff it was doing
to Metadata having a better constructor and V4L2Metadata being a
factory.

BUG: 30140438
TEST: unit tests pass

Change-Id: Id4bcb27fbd8b517e3a9a8e9fb8a984af139254b3
2016-08-24 17:14:36 -07:00
Ari Hausman-Cohen
6cd3fe9b14 Add V4L2 Control Factory
Also moves all control factory methods into a separate file.

BUG: 30900438
TEST: unit tests pass
Change-Id: I885903d8e23a548b63fd20006568145a233c0316
2016-08-22 15:56:18 -07:00
Ari Hausman-Cohen
fd0ecb791c Switch to composition over inheritance.
Switches v4l2_metadata over to the updated controls/properties
using inheritance over composition. Slight regression
in that the V4L2-based control factory method was removed,
will be replaced (and improved) in a CL soon.

BUG: 30140438
TEST: unit tests pass
Change-Id: I636fef67cd3ceeb3ebf9853d04b068988c4c4944
2016-08-17 10:59:51 -07:00
Ari Hausman-Cohen
9bd94f5581 Add tagged control delegates/options.
Simple wrappers that associate a control delegate
or set of control options with a corresponding
metadata tag.

BUG: 30140438
TEST: unit tests pass

Change-Id: Ib4d769f4a860d661128c8af47d317937d96feb96
2016-08-17 10:59:51 -07:00
Ari Hausman-Cohen
899426f581 Add control delegates.
Part of moving towards composition over inheritance.

Ignored: Requests to set are ignored.
NoEffect: Tracks a value but does nothing.
V4L2: Goes through a V4l2 device.

TEST: unit tests pass
BUG: 30140438
Change-Id: I9ca636556f4a6ddfe4b8ddfbd042371ed56343b9
2016-08-17 10:59:42 -07:00
Ari Hausman-Cohen
e2a9a01296 Add menu and slider options.
ControlOptionsInterfaces for lists and ranges.

BUG: 30140438
TEST: unit tests pass
Change-Id: I7bcb63777600cff18347c8eae54112025b6556b3
2016-08-16 18:20:35 -07:00
Ari Hausman-Cohen
8c13aaf1ac Add Control/State Interfaces.
These interfaces will be used to increase composition
and decrease inheritance in the metadata controls.

ControlDelegates are responsible for getting/setting values,
While ControlOptions are responsible for validating values
(breaking these two apart allows, for example, unused sliders
and unused enums to share the same ControlDelegate, but have different
options, with minimal code duplication).

StateDelegates are for read-only values that may change.
ControlDelegate inherits from this because it will allow
the State interface to be passed around, while one owner
maintains control of updating it behind the scenes.

BUG: 30140438
TEST: unit tests pass. Interfaces only so no new tests
Change-Id: I8042c1ccf97655558f45a1f8411e3a4a36de7506
2016-08-16 18:20:16 -07:00
Ari Hausman-Cohen
1760aa2912 Add scaling converters and secondary converters.
Scaling converters scale, as the name implies.

The two wrapping converters, map & ranged sanitize
data for sending to V4L2, either converting a value
to be within a map, or within a range, respectively.
(These are intended for use with V4L2 int menu and int
controls, respectively).

TEST: Unit tests pass
BUG: 30140438
Change-Id: Ie7d86118e00c0b59e6457fc16449228706098952
2016-08-16 14:08:52 -07:00
Ari Hausman-Cohen
f60dcc25c3 Add enum converter.
Converts between two different enumerations.

BUG: 30140438
TEST: Unit tests pass
Change-Id: I0976c440f0a48491fa52d26e173808917d53ebe7
2016-08-15 18:41:45 -07:00
Ari Hausman-Cohen
61399b5945 Merge "Use extended get/set controls." into nyc-jaqen-dev 2016-08-15 22:00:14 +00:00
Greg Kaiser
c9011b87c0 Merge "usbcamera: Fix compiler warnings" 2016-08-15 21:17:52 +00:00
Ari Hausman-Cohen
872ec62e0f Adds a simple conversion interface.
Using composition for conversion will allow more
code to be shared by different V4L2 controls.

BUG: 30140438
TEST: unit tests pass
Change-Id: I467efc72d71b9593d2476a61615fa44f7a975649
2016-08-12 15:49:09 -07:00
Ari Hausman-Cohen
7a1fba6127 Use extended get/set controls.
The normal G_CTRL and S_CTRL ioctls are only intended
for the basic user control interface. For the HAL,
we want access to quite a few extended controls as well.

BUG: 30140438
Change-Id: I750e9b1dc5e9e18cf5ad25daf1e1c1e34e756169
2016-08-10 14:38:42 -07:00
Ari Hausman-Cohen
5d7532337a Style fixes.
Was previously running the clang-format command incorrectly;
was not using the .clang-format file, and so was formatting
in some different style.

Change-Id: I09e81b919d1e6d40a56eb4f3f519aaed281a0c86
TEST: unit tests pass
2016-08-10 14:27:36 -07:00
Ari Hausman-Cohen
c7abfe7448 Add V4L2EnumControls to V4L2Metadata.
Add all current enum controls and their mappings
to the metadata constructor.

BUG: https://b/30140438

Change-Id: Ie4a5b89d8bc4bc75531425e5fc8bfb4a181b0a03
2016-08-09 13:52:12 -07:00
Ari Hausman-Cohen
3a4c3bba32 Add v4l2 enum controls.
Some V4L2 controls are simple enum menus, and are directly
analagous to metadata controls. The new V4L2EnumControl class
is a generalized converter between the two.

BUG: https://b/30140438, https://b/29394024
TEST: unit tests pass

Change-Id: I9f8bed200e21cb7e3f3336608fe210f094b7aa42
2016-08-09 13:52:02 -07:00
Ari Hausman-Cohen
e55f0c795c Refactor static functions.
Common static functions for manipulating metadata moved
from patial_metadata_interface to metadata_common.h

Common static functions for comparing equivalence with
metadata for tests moved to test_common.h

BUG: 30140438
TEST: Unit tests pass

Change-Id: I4310b4ff05bdd68f7f92f533028989914d0f4c82
2016-08-09 13:43:08 -07:00
Ari Hausman-Cohen
9e6fd98945 Add format querying.
Query formats, sizes, and frame rates.

BUG: https://b/29394024, https://b/30605346
TEST: Test java program shows a bunch of formats & rates,
can take pictures in different sizes now.

Change-Id: I203fd8f200dda79cf6946c58f130548b05269fbd
2016-08-08 16:29:21 -07:00
Greg Kaiser
e8343251f5 modules/local_time: Silence compiler warning.
Change-Id: If1fe4fcdf38171c696498d7a3d74d4a1fbb7b706
2016-08-08 13:57:40 -07:00
Nick Vaccaro
3fa9ea788f Sensors: MultiHal: ignore errors from poll calls
am: 59d9fb4f88

Change-Id: Iaebf7d97b6ed89247a5e125930269ab01ccb52ea
2016-08-08 17:05:52 +00:00
Greg Kaiser
7a915effde usbcamera: Fix compiler warnings
Change-Id: Ifc9fec5e90f5295d2b4a5b4c8648510565b9ba17
2016-08-08 09:35:54 -07:00
Nick Vaccaro
59d9fb4f88 Sensors: MultiHal: ignore errors from poll calls
MultiHal was not properly fielding errors from the poll() calls of
sub-HALs.  Propagating errors received from sub-HALs up to Sensor
Services causes Sensor Services to abort, so instead of propagating
the error up to Sensor Services, the MultiHal logs a message to
logcat to fix the sub-HAL problem.

Bug: 30060537
Change-Id: I6e20c193a2f2d228da48cf3d5a23e439eaf663df
2016-08-05 21:04:24 -07:00
Ari Hausman-Cohen
183ffc3cde Add ignored controls to v4l2_metadata.
BUG: 30140438
Change-Id: If3891e4c59bb8e510e626fdc13a5e1d7e2f29ba9
2016-08-04 18:47:09 -07:00
Ari Hausman-Cohen
b03fabba70 Add ignored controls metadata.
Ignored controls are optioned controls where the value
set by the user is tracked, but doesn't actually matter.

BUG: 30140438
Change-Id: I45819c3c6c855922418f76fd34309a44660fc3f0
TEST: unit tests pass
2016-08-04 18:47:09 -07:00