Commit Graph

1969 Commits

Author SHA1 Message Date
Philip P. Moltmann
71985f5e23 Merge "Do not access MTP devices when disabled." 2016-09-21 18:14:25 +00:00
Eino-Ville Talvala
2ce4b7a8a0 DngCreator: Fix calculation of date/time stamps am: 3fc21ef78b am: 215c76b1f4
am: ba57a47375

Change-Id: I818087e4a3495162eedceaebcd4da93c9eecfe87
2016-09-20 03:04:26 +00:00
Eino-Ville Talvala
3fc21ef78b DngCreator: Fix calculation of date/time stamps
Converting the sensor timestamp to date/time requires checking
what the timebase of those timestamps is; getting it wrong will
create drift that increases with device uptime.

Test: android.hardware.camera2.cts.
      DngCreatorTest#testSingleImageThumbnail
Bug: 30125412
Change-Id: Ia5db86012bc9e1c06463b8dc4434d3e063f62cf5
2016-09-18 17:11:41 -07:00
Philip P. Moltmann
2c6fe63b4c Merge "Set buffer before UsbRequest is queued" 2016-09-15 16:17:50 +00:00
Philip P. Moltmann
4346f3c5ec Set buffer before UsbRequest is queued
Otherwise a second thread might dequeue() it in between
native_queue_direct and mBuffer = buffer. If that happens the dequeue
operation does mBuffer.isDirect which triggers a NPE.

Fixes: 30914003
Change-Id: I3ca3b72db8f53a14be1c5f0e37f8924eba44b9bc
2016-09-14 22:44:50 +00:00
Philip P. Moltmann
3390281f71 Leak UsbDeviceConnection fd if not closed
This is the previous behavior and there are users that just copy the fd
and then forget about the connection. In this case it is unsafe to close
the fd when finalizing.

Change-Id: I5cd76564e1e8ddbd61c829b34b0f43b9c699f094
2016-09-14 14:13:46 -07:00
Philip P. Moltmann
ec3cbb2a66 Do not access MTP devices when disabled.
The USB data transfer is disabled we should not allow access MTP devices (e.g.
usb sticks). We have two ways of accessing them: Either by mounting them
or by creating a MTPDevice in an app.

Of course an app could implement implement their own MTPDevice
implementation. In this case we cannot enforce the policy without
completely suppressing all MTP USB devices which would be too
restrictive.

Note: When the policy is set we do _not_ disconnect already connected
MTP devices

Fixes: 31472955
Change-Id: I6080c48c49657102774b2b3b4d89ff030245a266
2016-09-14 13:29:45 -07:00
Eino-Ville Talvala
1a64580308 Camera2: Unhide deferred surface configuration APIs
To speed up camera startup, allow setting up a camera capture session
before all the output Surfaces are available (but their eventual sizes
and types are known). Also allow images to be captured to the
non-deferred outputs even before the deferred outputs are available.

This allows parallelizing of camera startup and UI layout.

Test: android.hardware.camera2.cts.SurfaceViewPreviewTest#testDeferrredSurfaces 
passes
Bug: 31319716
Change-Id: I657efc39bb8cc2d4bf201e5d70807a227ef82dde
2016-09-08 21:59:16 +00:00
Eino-Ville Talvala
3c8c16f9f1 Camera2: Clean up some obsolete trampolines left from original API launch
Test: Checkbuild passes on angler-userdebug
Change-Id: Iddcb72616be2eb07a4499647b3383ff9d37f73d2
2016-09-07 22:46:33 +00:00
TreeHugger Robot
1ae9143d7a Merge "Do not leak usb device connection FD" 2016-08-31 18:03:12 +00:00
Greg Kaiser
f4d609b9c0 ContextHubService: Hack in Google vendor value am: 5817ce0c13 am: 3d2f2a4305
am: ee483f7d78

Change-Id: I8ca30026b44d6ccea7cefa4b6671b4f286c352b5
2016-08-31 03:04:41 +00:00
Philip P. Moltmann
674e8c3825 Do not leak usb device connection FD
The native code uses mNativeContext=0 to indicate that is was already
closed and checks this properly. Hence let's leave the checking in the
native code.

We need to keep a reference in UsbRequest as otherwise the
UsbDeviceConnection might get finalized while a UsbRequest is in
progress. The UsbRequest itself makes sure that it is not garbage
collected while the I/O is in progress.

Also I added CloseGuards to make sure the classes are used properly and
fixed an error string in the native code.

Fixes: 31124312
Bug: 31021315
Change-Id: I96deb73957eba0e14e6b656988a2ae9b409bf55f
2016-08-30 10:52:39 -07:00
Greg Kaiser
ed2a5f8592 ContextHubManager: Document InstanceInfo bug am: 3be73d3950 am: 6f155aa4bf
am: 7fd9e40381

Change-Id: I0f95997e013d5cb8fb23b18ad82763cc091e38f1
2016-08-30 17:20:09 +00:00
Greg Kaiser
786676eb39 NanoAppFilter: Workaround HubId issues am: 3907049080 am: 41ef2a038d
am: d20ed26dff

Change-Id: Iba85f8939fca3bf097f8778fdd980bd9290a7530
2016-08-30 01:38:27 +00:00
Greg Kaiser
45cad7f70c ContextHubManager: Fix API documentation. am: fac5be2ace am: 921e7ef350
am: fce14d1808

Change-Id: Ib5e0ba71519b2be92064b691c4e7d5b1b51deb81
2016-08-30 01:32:36 +00:00
Greg Kaiser
974c0b6a2c ContextHubService: Don't double report app loads am: fe6d4f518a am: ca627a8cc3
am: 8c94f54e0f

Change-Id: I34887862a05e0cbe3c21e038c31072cd41f363a3
2016-08-30 01:26:40 +00:00
Greg Kaiser
3d2f2a4305 ContextHubService: Hack in Google vendor value
am: 5817ce0c13

Change-Id: I168a2a2a50168f7590842b5c51fbc8a80842b00e
2016-08-29 17:59:23 +00:00
Greg Kaiser
143aaa6d05 Merge "ContextHubService: Hack in Google vendor value" into nyc-mr1-dev 2016-08-29 17:43:31 +00:00
Greg Kaiser
6f155aa4bf ContextHubManager: Document InstanceInfo bug
am: 3be73d3950

Change-Id: I8a1418086d7e9c4f60205234394dd1cc8d1215df
2016-08-26 18:27:50 +00:00
Brian Duddie
73f511e471 Merge "ContextHubManager: Document InstanceInfo bug" into nyc-mr1-dev 2016-08-26 18:20:19 +00:00
Greg Kaiser
5817ce0c13 ContextHubService: Hack in Google vendor value
To workaround b/30808791 without changing the NanoApp API,
we make the assumption that if the most significant byte
of our four-byte app ID is a lower-case 'L', then this
is a Google Nanoapp and thus we should use "Googl" for
our vendor ID, and set the most significant four bytes
of our eight byte app ID accordingly.

Bug: 30922112
Change-Id: I155dff58cdda1ef36a68e6d25df1e9059b1252f1
2016-08-25 23:18:16 -07:00
Greg Kaiser
41ef2a038d NanoAppFilter: Workaround HubId issues
am: 3907049080

Change-Id: I0b9b272e05bc2ff4ecbc74b5570eda066dedede1
2016-08-26 03:44:47 +00:00
Greg Kaiser
921e7ef350 ContextHubManager: Fix API documentation.
am: fac5be2ace

Change-Id: I220af0f42791d1210acf9e88da670994f3c6ae45
2016-08-26 03:37:12 +00:00
Greg Kaiser
f8d61675ac Merge "NanoAppFilter: Workaround HubId issues" into nyc-mr1-dev 2016-08-26 03:34:39 +00:00
Greg Kaiser
1e07e392c3 Merge "ContextHubManager: Fix API documentation." into nyc-mr1-dev 2016-08-26 03:30:19 +00:00
Keun-young Park
badbbae6fa allow external USB host management
- Setting config_UsbDeviceConnectionHandling_component leads into
  launching specified Activity whenever USB device is connected.
- This allows external Activity to manage USB device based on
  its own setup and settings.
- Device access can be passed to other app with permission update
  by UsbManager.grantPermission.
- added UsbDeviceConnection.resetDevice() to reset USB device connected.
  This is necessary to get device out from AOAP.
- Test requires installing UsbHostExternalManagmentTestApp and
  AoapTestHost to USB host, and AoapTestDevice to USB Device.

bug: 26404209
Change-Id: I8e77ddc646c15454d9b2ecf1356924cf6351fc28
2016-08-24 15:00:08 -07:00
Greg Kaiser
3be73d3950 ContextHubManager: Document InstanceInfo bug
Our getNanoAppInstanceInfo() method returns incorrect information
for several fields in many cases.  We're too late in the release
cycle to fix the core of this issue, but we can at least document
it so users aren't surprised.

Bug: 30944457
Change-Id: I9330c3b77d08c36befbe20258c6cc45dc640f103
2016-08-19 11:09:01 -07:00
Greg Kaiser
3907049080 NanoAppFilter: Workaround HubId issues
There's no API to set mContextHubId, but testMatch() uses this.

We can't add API at this point of the release cycle, so instead
we default mContextHubId to HUB_ANY, which makes it always match.

Bug:30018518
Change-Id: I4e08afc65889dc109a4da1bd99a027345da865ca
2016-08-19 11:04:32 -07:00
Greg Kaiser
fac5be2ace ContextHubManager: Fix API documentation.
Most notably, the loadNanoApp() claimed it was returning the
nano app instance handle on success, when it actually was just
returning 0 on success.

Bug: 30475803
Change-Id: I436255f0103a743a02f40c41ee4c6f653d007d89
2016-08-19 11:02:10 -07:00
Greg Kaiser
fe6d4f518a ContextHubService: Don't double report app loads
Our logs would show us loading apps twice, when in reality we
load them once, and then update our caches with the app
version later.

There are other issues around how this code works (for example,
b/30970527), but this is an appropriate approach at this
stage of the release.

Bug: 30836667
Change-Id: I2e2a65bc8a2ef4d1703df0a0586a8ed251607af7
2016-08-19 10:24:07 -07:00
Jeff Sharkey
e2fc1055c5 Merge "Avoid caching services with missing binders." 2016-08-11 18:52:03 +00:00
Jeff Sharkey
49ca529a85 Avoid caching services with missing binders.
When fetching system services early during boot, if the underlying
binder interface hasn't been published yet, we end up caching a
manager class that is broken for the remainder of the process
lifetime, and innocent downstream callers end up using the broken
cached manager.

Fix this by using an explicit exception to quickly abort manager
creation when the underlying binder is missing.  The exception is
only used to skip the remainder of the manager creation, and it
doesn't actually crash the process.

Bug: 28634953
Change-Id: I0cb62261e6d6833660704b93a11185aa11a2ac97
2016-08-11 09:44:30 -06:00
Yin-Chia Yeh
e9ee3f487c Camera: ensure lock ordering (device->session) am: b0025e1f68 am: de71f83c2c
am: 162c8b84b5

Change-Id: Ia2b36acc9f945c7ab838681f8ea63a6b94579207
2016-08-11 00:54:01 +00:00
Yin-Chia Yeh
de71f83c2c Camera: ensure lock ordering (device->session)
am: b0025e1f68

Change-Id: Idcb9b48274ecfe9fe2f306ae201491d1e485d601
2016-08-11 00:39:26 +00:00
Yin-Chia Yeh
58b4623d1f Merge "Camera: ensure lock ordering (device->session)" into nyc-mr1-dev 2016-08-11 00:32:15 +00:00
Yin-Chia Yeh
b0025e1f68 Camera: ensure lock ordering (device->session)
On close/abort calls, which are more likely to run in parallel
with CameraDevice APIs.

Bug: 30742426
Change-Id: I6550283d1026373d48bb730164e65b25c7037bab
2016-08-10 12:50:19 -07:00
Jim Miller
391a1019e3 Bind fingerprint when we start authentication am: 837fa7e56d am: 3871272fc6
am: 1b3261902d

Change-Id: I0d974f25f0565b3d2724db4ac78a007324cd5f8a
2016-08-10 00:12:22 +00:00
Jim Miller
837fa7e56d Bind fingerprint when we start authentication
This fixes a bug where it was possible to authenticate the wrong user.
We now bind the userId when we start authentication and confirm it when
authentication completes.

Fixes bug 30744668

Change-Id: I346d92c301414ed81e11fa9c171584c7ae4341c2
2016-08-08 20:16:22 -07:00
Michael Wright
bc702e5d42 Merge commit \'f8bc27d9683e4089cdfd778dcb61ae67f44665b7\' into manual_merge_f8bc27d
am: 49bcc5dd80

Change-Id: Iee2a7015eefd6a75be2968ec855334f68ec5f79e
2016-07-20 18:49:43 +00:00
TreeHugger Robot
f8bc27d968 Merge "Rename color transform to color mode and persist the value." into nyc-mr1-dev 2016-07-20 17:21:35 +00:00
Kevin Hufnagle
8af36d225d Merge \\\\\\\"docs: Updated descriptions of device orientation angles.\\\\\\\" into mnc-docs am: d312201b74 am: 6b4d2a2e6d am: a812012c52 am: b9487874fe am: 55b52a2b3f am: 87a8e5eebd
am: 6aa834498b

Change-Id: I9eb2556d72919f43e84336d57b6276028669f627
2016-07-20 03:02:15 +00:00
Kevin Hufnagle
87a8e5eebd Merge \\\\\"docs: Updated descriptions of device orientation angles.\\\\\" into mnc-docs am: d312201b74 am: 6b4d2a2e6d am: a812012c52 am: b9487874fe
am: 55b52a2b3f

Change-Id: I8c9a6fe4778a3344e8c6270f865567ba4bf05dbb
2016-07-20 01:28:59 +00:00
Kevin Hufnagle
55b52a2b3f Merge \\\\"docs: Updated descriptions of device orientation angles.\\\\" into mnc-docs am: d312201b74 am: 6b4d2a2e6d am: a812012c52
am: b9487874fe

Change-Id: I034ce5c4a115fa4b694569c66a7e764543191cf7
2016-07-20 01:20:20 +00:00
Kevin Hufnagle
b9487874fe Merge \\\"docs: Updated descriptions of device orientation angles.\\\" into mnc-docs am: d312201b74 am: 6b4d2a2e6d
am: a812012c52

Change-Id: Ifff8f0ca783a601dab3b4968a0e9708e34aa83f4
2016-07-20 01:12:40 +00:00
Michael Wright
1c9977b762 Rename color transform to color mode and persist the value.
Also, standardize on a set of possible modes for the displays to
enter and separate the configuration of the color mode from the
configuration of the display mode.

Bug: 29044347

Change-Id: I6af0a7d1f11bc72d4cefc380f115c1fb00788864
2016-07-18 19:49:18 +01:00
Ashutosh Joshi
d51413ec49 Merge \\"Loading NanoApps now works.\\" into nyc-mr1-dev am: 095979b463
am: 820ab55e1c

Change-Id: Ib92f140990ed577483bcafdbdc87118f2528144e
2016-07-15 23:28:28 +00:00
Ashutosh Joshi
118644056f Loading NanoApps now works.
Fixing transaction handling for loading/unloading nanoApps.

Bug: 30165105
Change-Id: I540243d730040e70b2d104ccd9ea5a0baaa0d97d
2016-07-15 13:46:22 -07:00
Ashutosh Joshi
5bcbe74198 Merge \"Merge \\"Add state for loading/unloading apps\\" into nyc-mr1-dev am: 2e42020eab\" into nyc-mr1-dev-plus-aosp
am: 5c99851d23

Change-Id: I0f52f1406840b9ddcfe9dd30c19c5ea01755039f
2016-07-13 23:46:22 +00:00
Ashutosh Joshi
0ce29c421e Merge \\"MediaPlayer: fix typo for OnInfoListener.\\" into nyc-mr1-dev am: ebc3c9ca3f
am: 3ed59e2fda

Change-Id: Ib10558712b5e7abe1b0a853eceb4c20beacd6153
2016-07-13 23:31:13 +00:00
Ashutosh Joshi
54787a5f9f Add state for loading/unloading apps
Add state for loading/unloading nanoApps.
Pass on OS response to ContextHubService clients.
Fix Build Breakage due to uninitalized variables.

Bug: 29193948
Change-Id: Ibebecf704bb3ad2583e110f1fcf05400a53b1b4c
2016-07-13 15:28:16 -07:00