Commit Graph

1932 Commits

Author SHA1 Message Date
Ashutosh Joshi
835da289fa Change the name of the contexthub service.
Change the name used by the contexthub service. Specifically, this
change switches from using the "ContexthubService.CONTEXTHUB_SERVICE"
constant to using the "Context.CONTEXTHUB_SERVICE" constant- which is in
line with the other Android services.

Merged-In: I18ae73ed0fda2f938e3233670dc52b5692d321ae
Test: GTS tests pass.

Change-Id: I18ae73ed0fda2f938e3233670dc52b5692d321ae
2016-12-28 13:57:27 -08:00
Jerry Zhang
bb598ee16f Modify UsbDeviceManager stack to allow MtpServer to use FunctionFS drivers.
Functionfs requires MtpServer to write descriptors before the device can be
configured. This adds a new configure call that will occur only when
functions are changed (new argument added to updateUsbStateBroadcast for this)
and be called after sys.usb.config is changed but before the waitForState
call to ensure compatibility with configfs devices.

Bug: 30976142
Change-Id: I7e94a5847d3b19c0fd75139e1b15a3f2a1cea01d
Test: Manual
2016-12-12 11:05:32 -08:00
Jerry Zhang
5cbd151d40 Refactored setCurrentFunction and setUsbDataUnlocked into single method.
am: 935372bfd6

Change-Id: I5436278e092f691c9179f7cc3709c4578b544e74
2016-11-17 00:12:50 +00:00
Jerry Zhang
935372bfd6 Refactored setCurrentFunction and setUsbDataUnlocked into single method.
This gets rid of an extraneous configuration change when going from
adb to adb + file transfer as previously the config would have been
reset once for functions and once for data unlocked.

It also simplifies some of the code.

Test: manually changing usb configurations
Change-Id: Ica10a195338b2189db13113f44657393db110bee
(cherry picked from commit 7a396be6d5)
2016-11-15 15:29:45 -08:00
Yin-Chia Yeh
50f9b6e71f Merge "Camera2 Legacy: catch more surface abandoned error"
am: 03f14bef41

Change-Id: If2e05eeb8c7fe24f97fc0c5e20bfe03a6c8c9e23
2016-10-21 21:07:44 +00:00
Yin-Chia Yeh
091661334b Camera2 Legacy: catch more surface abandoned error
Bug: 30140107
Change-Id: Ia293bdbb85c8078e17def55db9c599cfe70458db
2016-10-21 11:40:46 -07:00
Philip P. Moltmann
5201f1e61c 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-30 22:24:23 +00:00
Eino-Ville Talvala
4e3bb26f64 Merge "DngCreator: Do not cache timezone in static initializer" into nyc-mr1-dev 2016-09-28 21:20:21 +00:00
Eino-Ville Talvala
ec727411d2 DngCreator: Do not cache timezone in static initializer
The static initializer for a pre-loaded framework class is run
no later than at zygote startup, which happens at device boot.

Which means that if the timezone later changes, DngCreator will use
an incorrect cached timezone until the next reboot.  This is especially
evident in freshly wiped devices, where initial setup will typically
change the timezone.

Instead, read the timezone each time DngCreator is created, which is
also when we query the current time for constructing the timestamps.

Test: android.hardware.camera2.cts.DngCreatorTest#testSingleImageThumbnail
Bug: 31743060
Change-Id: I83a4eac762650e5f904f3b8fa779c094cef30562
2016-09-28 11:10:00 -07:00
Greg Kaiser
1983f9b05b ContextHubService: Hack around 32-bit app ID
The NanoApp.java class has a bug (b/30808791) where the API treats
app IDs as 32-bits, instead of 64-bits.  We are too late in the
Android N release cycle to change this API.

We previously put in a hack to fix this only for Google nanoapps.
However, our GTS nanoapps need this to work, and there are other
partners who need this to work in the N timeframe.  So we make
a more robust hack which parses the full 64-bit app ID out of
the header binary.

Test: Compiles and runs GTS
Bug: 31767599
Change-Id: Ic43f1f62c685fb99aac08d08767d1a67c329503f
2016-09-27 15:01:48 -07:00
Chien-Yu Chen
dd6629ef86 Camera2: Support early finished tasks
Add support to track finished tasks before it starts.

Bug: 30117138
Change-Id: I42eb0377f719d57d820d9c1b2484600116c8807a
2016-09-23 17:23:45 -07: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
Greg Kaiser
143aaa6d05 Merge "ContextHubService: Hack in Google vendor value" into nyc-mr1-dev 2016-08-29 17:43:31 +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
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
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
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
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
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
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
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
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
Mark Lu
3e15a43732 Merge \"docs: fixed broken link in UsbManager javadocs\" into nyc-dev
am: 162a6fad72

Change-Id: If11947a089756b7ca72f6a579d4b1cbe54535185
2016-07-11 20:20:31 +00:00
Eino-Ville Talvala
62deabcc4f Camera2: Add @hide variant for openCamera for UID forwarding
Trusted services may open a camera device on behalf of some client
of theirs; such services need to forward the UID of their client to
the camera service for validation of permissions, etc.

Add a variant of openCamera that makes this simple, only accessible
to unbundled services for now.  Only services explicitly trusted
by the camera service can pass an argument other than USE_CALLING_UID
to this method.

Bug: 27616192
Change-Id: Idb06112201b805a8b5c979b5f0761fec1c6994a3
2016-07-08 12:11:11 -07:00
Mark Lu
8b739903a9 docs: fixed broken link in UsbManager javadocs
Bug: 29236606
Change-Id: I07fc82d741c106b6a679b7881757d4293359d384
2016-06-28 11:27:23 -07:00
Peng Xu
0ad55d5769 Merge \"Sensor: Make getId() more varied\" into nyc-dev
am: 94b61cb340

Change-Id: I896ed5531533d55bd1ed3f2e3f21d21be04a1f5f
2016-06-23 03:32:46 +00:00
Peng Xu
716866d565 Sensor: Make getId() more varied
Apps from different developers will now receive a different
ID for the same dynamic sensor.  Additionally, all apps
will now receive a different/new ID for the same dynamic
sensor after a factory reset.

Bug: 28775590, 29547335
Change-Id: I15b48b974cbb1d53cc33dfdb7b9eb5f1b562190c
2016-06-22 13:28:29 -07:00
Adrian Roos
9918234dcf Enable tap-to-pulse only when needed
- Adds InputManager.setPulseEnabled().
- Adds a config overlay for the file controlling touch-to-pulse.
- Hooks up DreamManagerService with InputManager.setPulseEnabled().

Bug: 29253550
Change-Id: I4892311cc30e97d31f7be778930397fbe5c03945
2016-06-20 08:59:48 -07:00
Brian Duddie
93a2410f2d Merge \"Send VR mode notification to AR app on context hub\" into nyc-dev
am: 9a31e8be48

Change-Id: Ied704de01ddc2b9754a5a2d88b7b9624d711dd11
2016-06-15 21:28:52 +00:00
Brian Duddie
c3d8a529c6 Send VR mode notification to AR app on context hub
Bug: 28793778
Change-Id: I7417ba7f696dc61689687bd56b165a81aea1715a
2016-06-15 11:36:09 -07:00
Eino-Ville Talvala
2c21b5b651 Merge changes I069e2b7e,Ic5e9e58a into nyc-dev
am: f4de8dd77c

Change-Id: I439643be2fd5699f1a98d8ca15d14167ea3ffde1
2016-06-10 20:02:20 +00:00
Eino-Ville Talvala
50eebe057b Camera2: Fix error codes for CameraDevice.StateCallback.onError()
Existing code assumed that ICameraDeviceCallbacks and
CameraDevice.StateCallback have the same error code values for matching
errors.

They do not.

Also remove duplicate error code definitions now present in the AIDL
file for ICameraDeviceCallbacks.

Bug: 29248704
Change-Id: I069e2b7ef3be7887634e128f1accb50b7558f3fd
2016-06-10 10:28:34 -07:00
Eino-Ville Talvala
4a2c7c5549 Camera2: Protect MarshalRegistry against concurrent access
Multiple CameraMetadataNative objects could be reading and writing
to the metadata marshaler registry simultaneously.

This can lead to an infinite loop in the HashMap in the worst case,
so add synchronization against this.

Bug: 29043079
Change-Id: Ic5e9e58a9333b99b4bea87bf790c9fbfadfbbea9
2016-06-10 10:28:34 -07:00
Eino-Ville Talvala
02c43050af Merge "Camera2: Update lensShadingMap documentation" into nyc-dev
am: cd44a32dfe

* commit 'cd44a32dfe6a5a39db496af6de7764e164cda6f5':
  Camera2: Update lensShadingMap documentation

Change-Id: I8011b348ebc133ab6664db5948066ded857d5285
2016-06-03 18:01:57 +00:00
Zhijun He
c8b181e95d Camera2: add deferred output config support
Allow surfaces to be deferred during session creation. Once the surfaces are ready,
the application can finish the deferred output configuration to be able to submit
requests with these surface targets.

Bug: 28323863
Change-Id: Id6634c3ef2ecc84422a88f63de0a19a0cb496e96
2016-06-02 17:30:20 -07:00
Eino-Ville Talvala
c62cea89ce Camera2: Update lensShadingMap documentation
Revert added language about shading map being the full flat-field
correction; it's actually the same correction as applied to camera
device-processed data.

Also fix a few other wording issues in the lens shading documentation.

Bug: 18175853
Change-Id: I27691925e6496afe18f3506084d89f2523b5555d
2016-06-02 14:21:27 -07:00
Michael Wright
28984d4d80 Merge "DO NOT MERGE Remove Pointer Capture API" into nyc-dev
am: c396f0f70e

* commit 'c396f0f70ef40ea0fb42a0872a13f4c4e9a6a5f0':
  DO NOT MERGE Remove Pointer Capture API

Change-Id: I77cb742feacdd3b8af0cf33d4e7ab246f776417f
2016-05-26 14:38:56 +00:00
Michael Wright
c396f0f70e Merge "DO NOT MERGE Remove Pointer Capture API" into nyc-dev 2016-05-26 14:03:47 +00:00
Johan T. Halseth
244259a063 Adding grantPermission for packageName
Adding a hidden API in UsbManager for system services to grant
permissions to a specific package for a USB device without showing a
user dialog.

Bug: 28760255
Change-Id: Ie68cfc784b7894e9db12ab61bab0f7e6bfa369e3
2016-05-24 22:34:35 +01:00
TreeHugger Robot
a1e0cebf3a Merge "DO NOT MERGE Rename PointerIcon and Pointer Capture APIs" into nyc-dev 2016-05-19 15:03:36 +00:00
Yohei Yukawa
23cbe85610 Move LocaleList to avoid layering violation.
Since LocaleList needs to depend on android.os.Parcelable, we cannot let
that class belong to "android.util" package, which causes layering
violation.

Bug: 28819696
Change-Id: Ia8de2ee9df3dd0a42b1fe84574439519b680fe18
2016-05-17 16:42:58 -07:00