Commit Graph

2183 Commits

Author SHA1 Message Date
Will Brazil
5884f6ce0d Merge "Camera2: Cache method list in MethodNameInvoker." into oc-dev
am: 71029bf631

Change-Id: I24120e653feef23b155111cbc69f6b3033b2427c
2017-06-12 20:49:49 +00:00
Will Brazil
cd92f92fa4 Camera2: Cache method list in MethodNameInvoker.
Retrieving list of methods in every invoke() call is very expensive.
Caching the list inside the constructor prevents several unnecessary
calls to Class.getMethods().

Test: Run camera2 CTS
Bug: 62490715

Change-Id: Ib2a93af0f364b055df2eab9bd7870730428429ad
2017-06-12 19:02:52 +00:00
Jeff Sharkey
67cb5f5210 Merge "Give Doclava our manifest; more permission docs." into oc-dev
am: 65d4cbba37

Change-Id: I2ec50efb67debd15d354db69b84fb620eb74bc0e
2017-06-06 15:28:26 +00:00
Jeff Sharkey
bfc4fcde9f Give Doclava our manifest; more permission docs.
We've seen some @SystemApi methods protected with non-system
permissions, so give Doclava the platform AndroidManifest.xml so it
can parse the actual permission protection levels to look for APIs
that are letting in non-system apps.

Also document more @SystemApi permissions.

This is purely a docs change; no logic changes are being made.

Test: make -j32 update-api
Bug: 62263906
Change-Id: Ie0f0a5fb0033817bcc95060f2183a52ae4ae7b06
2017-06-05 17:38:19 -06:00
Jeff Sharkey
7a2e4a8486 Merge "Annotate @SystemApi with required permissions." into oc-dev
am: c1406978a4

Change-Id: I305967cad945a807c3f8234efabaad0ef8b591d1
2017-06-05 22:28:21 +00:00
Jeff Sharkey
d86b8fea43 Annotate @SystemApi with required permissions.
Most @SystemApi methods should be protected with system (or higher)
permissions, so annotate common methods with @RequiresPermission to
make automatic verification easier.

Verification is really only relevant when calling into system
services (where permissions checking can happen on the other side of
a Binder call), so annotate managers with the new @SystemService
annotation, which is now automatically documented.

This is purely a docs change; no logic changes are being made.

Test: make -j32 update-api && make -j32 offline-sdk-docs
Bug: 62263906
Change-Id: I2554227202d84465676aa4ab0dd336b5c45fc651
2017-06-05 13:27:11 -06:00
Eino-Ville Talvala
d939f92dd0 Merge "Camera2: Fix broken onCaptureBufferLost callback" into oc-dev
am: 906948e7e2

Change-Id: I0007db72b0ca923c0e42bbb6ddadf34e927b5612
2017-05-25 17:25:34 +00:00
Eino-Ville Talvala
906948e7e2 Merge "Camera2: Fix broken onCaptureBufferLost callback" into oc-dev 2017-05-25 17:11:06 +00:00
Kevin Chyn
23e33539cd Merge "Revert fix for FingerprintManager leak" into oc-dev
am: 807a8c6e7c

Change-Id: I9f9132b1785c4e7c7d04dcc7decfbc4e447fbdd0
2017-05-25 04:33:07 +00:00
Kevin Chyn
5e797faaf4 Revert fix for FingerprintManager leak
Bug: 38509779
Bug: 32295793

Setting to null causes problem seen in b/38509779
Using weakreference will cause problems if the application
declares AuthenticationClient as a weak reference as well and would
very likely break a lot of existing apps.

Test: manual
Change-Id: Iedbdd76f3a402b766ce8a799bf76324d1164a0ec
2017-05-24 16:58:18 -07:00
Eino-Ville Talvala
cad1bfe68b Camera2: Fix broken onCaptureBufferLost callback
Turns out this never worked. 😱

- Add missing oncaptureBufferLost proxy method
- To avoid this issue in the future, change CameraDeviceImpl.CaptureCallback to be
  an interface instead of an abstract class; now all implementers _must_ implement
  all the methods
- For the short-circuit local callback when no callback is provided by the user,
  implement all no-ops explicitly.

Test: Camera CTS continues to pass; manual testing with injected buffer drops
Bug: 62004599
Change-Id: I7732903dbc00e80084162e067de66b5db6cee74c
2017-05-23 14:29:31 -07:00
Charles He
16a2759492 Merge "Fingerprint: call onRemovalSucceeded with # of remaining templates." into oc-dev
am: 50be382341

Change-Id: I5c6f8dfed5777de8098fa6a02d5a3124addedf22
2017-05-17 13:15:42 +00:00
Charles He
ee17d352d6 Fingerprint: call onRemovalSucceeded with # of remaining templates.
The onRemoved() callback from fingerprint daemon provides a "remaining"
parameter which contains the number of fingerprint templates yet to be
removed in the current removal operation. This is especially useful when
a group is removed, as remaining == 0 indicates the end of the group
removal.

In this CL, we wire up FingerprintManager so that the "remaining"
parameter gets passed to RemovalCallback#onRemovalSucceeded(). This
would allow clients like Settings to make use of the information.

Bug: 37938345
Test: manual, both with and without work profile
Change-Id: Idf46ef42e1d178cd3dc267aaf4219f03e27be766
2017-05-16 16:34:21 +01:00
Kevin Chyn
c7a3cf5850 Merge "Add missing break statements in FingerprintManager" into oc-dev
am: e25a2564e5

Change-Id: Iae1ded28be8ea7df2c466ce2592a5574b1cee994
2017-05-13 00:32:46 +00:00
TreeHugger Robot
e25a2564e5 Merge "Add missing break statements in FingerprintManager" into oc-dev 2017-05-13 00:27:13 +00:00
Kevin Chyn
3ed8955aa3 Merge "strong fp lockout after 20 failed attempts" into oc-dev
am: 310818ff82

Change-Id: I52787e3db92ae9795932156335ee5c55f5c920a9
2017-05-12 23:49:48 +00:00
Kevin Chyn
e64399649a Add missing break statements in FingerprintManager
Fixes: 38268065

Test: manual

Change-Id: I64ac92b2c5682bcaa494f43ff5defdf9915c5a65
2017-05-12 14:57:32 -07:00
Kevin Chyn
df9d33e903 strong fp lockout after 20 failed attempts
Fingerprint currently locks out for 30s after every 5 failed attempts.

This change makes it so that in addition to the above,
PIN/pattern/password will be required after 20 failed attempts.

Fixes: 35954316

Test: manual
Change-Id: I3aeb0e5b5b4d5011555f60fbe6cc2c1ce702a670
2017-05-12 13:01:01 -07:00
TreeHugger Robot
424e328bba Merge "Add uniqueId to Virtual Display and pass through to inputflinger (1/2)" into oc-dev 2017-05-11 03:55:40 +00:00
Santos Cordon
b0608636a2 Add uniqueId to Virtual Display and pass through to inputflinger (1/2)
This CL adds:
1) Adds uniqueId (protected via system/sig permission) to virtual
displays.
2) Add support for N virtual display viewports into inputflinger.
3) Set the virtual display's viewports in inputflinger if it has the
uniqueId value set to non-null. (a) Moving the new viewport from java to
native inputflinger and (b) adding "uniqueId" value to viewports makes
up the great majority of this change.
4) From the inputflinger side, we also read in a new value from the
input device configuration files called 'touch.displayId'.
5) When touch.displayId and the virtual display's uniqueId match,
inputflinger links the two.

Test: Start VR and ensure that the virtual viewport shows up when running
'adb shell dump input".  Run a VR app, and ensure that the virtual input
device is associated with the new virtual viewport.
Test: com.android.server.display.DisplayManagerServiceTest

Bug: 36051620
Change-Id: Ic2117eb8e19f7f3c59687160591f8bc6692c1f12
Merged-In: Ic2117eb8e19f7f3c59687160591f8bc6692c1f12
2017-05-11 01:52:53 +00:00
Kevin Chyn
7096712148 Merge "AuthenticationCallback should not be cleared onAuthenticationFailed" into oc-dev
am: 6fddc2472e

Change-Id: I3493866a4e594a186f897b02dca0773e4a7a0d49
2017-05-11 01:13:10 +00:00
Kevin Chyn
7a6b44bcee AuthenticationCallback should not be cleared onAuthenticationFailed
Fixes: 38197608

Test: 1) enroll a finger
2) enter keyguard, touch sensor with an unenrolled finger
3) touch sensor with enrolled finger
4) phone should enter keyguard
5) do this test from screen off as well

Change-Id: I1c7b060888128b4a6b492fd6a7a8ebc85d2b3353
2017-05-10 14:39:55 -07:00
TreeHugger Robot
baed8c1321 Merge "Add uniqueId to Virtual Display and pass through to inputflinger (1/2)" into oc-dev-plus-aosp 2017-05-10 21:18:51 +00:00
Santos Cordon
023b6b9d23 Add uniqueId to Virtual Display and pass through to inputflinger (1/2)
This CL adds :
1) Adds uniqueId (protected via system/sig permission) to virtual
displays.
2) Add support for N virtual display viewports into inputflinger.
3) Set the virtual display's viewports in inputflinger if it has the
uniqueId value set to non-null. (a) Moving the new viewport from java to
native inputflinger and (b) adding "uniqueId" value to viewports makes
up the great majority of this change.
4) From the inputflinger side, we also read in a new value from the
input device configuration files called 'touch.displayId'.
5) When touch.displayId and the virtual display's uniqueId match,
inputflinger links the two.

Test: Start VR and ensure that the virtual viewport shows up when running
'adb shell dump input".  Run a VR app, and ensure that the virtual input
device is associated with the new virtual viewport.
Test: com.android.server.display.DisplayManagerServiceTest

Bug: 36051620
Change-Id: Id728d6e7292feaa1d8de7660bc6a2ec90fa1ff3c
2017-05-10 13:03:32 -07:00
Bryce Lee
356cccd67c Merge "Use application context getting secondary displays." into oc-dev
am: 456882b5ae

Change-Id: Ib45a340b34f11f0112c91893893f32e0a849cf93
2017-05-10 19:22:15 +00:00
Bryce Lee
456882b5ae Merge "Use application context getting secondary displays." into oc-dev 2017-05-10 16:27:14 +00:00
Bryce Lee
c406152f5f Use application context getting secondary displays.
Activity contexts include override configurations in their resources
associated with the primary display. There currently is no way to
specify overrides for another display from the same context. As a
result, getting metrics for other displays will reflect the metrics
of the context's display.

This change provides the application context when we create a display
if the display id does not match the display associated with the
context.

Change-Id: I68a7b609ead6d7cc652d36e7e8af432700af8efa
Fixes:37923030
Test: cts-tradefed run cts-dev --module CtsDisplayTestCases --test android.display.cts.DisplayTest#testActivityContextGetMetrics
2017-05-09 10:40:23 -07:00
Chien-Yu Chen
fe04ad53de Merge changes from topic 'enableZslApi' into oc-dev
am: 9414a25592

Change-Id: I9d4fb74e37782f269966dda855f716e24ed42000
2017-05-08 22:33:56 +00:00
TreeHugger Robot
9414a25592 Merge changes from topic 'enableZslApi' into oc-dev
* changes:
  camera: Clarify TEMPLATE_ZERO_SHUTTER_LAG
  camera: Clarify ZSL supports
2017-05-08 22:28:38 +00:00
Kevin Chyn
6935c33abd Merge "Fix AuthenticationCallback leak in FingerprintManager" into oc-dev
am: a0cd8eb55d

Change-Id: If67639ed1f93f76a1ed225209869545572571484
2017-05-08 20:58:17 +00:00
Kevin Chyn
d717808bd0 Fix AuthenticationCallback leak in FingerprintManager
Fixes: 32295793

Test: 1) modify/build/run apk attached in BR
2) run garbage collection after FingerprintActivity is done
3) use HPROF, FingerprintActivity should have "0 total count"
4) do this test for auth success, auth fail, auth cancel

Change-Id: I5fe7937a26d4673226b87c9c95a136dd9510e21f
2017-05-07 22:42:22 +00:00
Chien-Yu Chen
6828bb92bd camera: Clarify TEMPLATE_ZERO_SHUTTER_LAG
Clarify that TEMPLATE_ZERO_SHUTTER_LAG is intended for application
operated ZSL.

Test: make
Bug: 34689167
Change-Id: Ice5fcb11ce43b411376d22976741720a5abbf322
2017-05-03 12:41:39 -07:00
Chien-Yu Chen
8102638c71 camera: Clarify ZSL supports
For application-operated ZSL, use CAMERA3_TEMPLATE_ZERO_SHUTTER_LAG
template.

Test: make
Bug: 34689167
Change-Id: I39dba6f9a23a8c714c31cf5fb825a8bee3f01f2b
2017-05-03 12:41:07 -07:00
Tomasz Wasilczyk
ffe7134de5 Merge "Fix equality method implementation in BandConfig class." am: 30a34ec0e2 am: 5acbf70872
am: 3329b63b40

Change-Id: I45bf3234ccc66e5bcac071c0931846eed2e27f2b
2017-04-28 21:46:20 +00:00
Tomasz Wasilczyk
3329b63b40 Merge "Fix equality method implementation in BandConfig class." am: 30a34ec0e2
am: 5acbf70872

Change-Id: I57e6fa0f946f25048da1524f07fa4eb13fdb2f1c
2017-04-28 20:25:43 +00:00
Dianne Hackborn
9cd47a8ff2 Merge "Fix issue #37714224: API Review: ACTION_NEW_VIDEO" into oc-dev 2017-04-28 18:10:39 +00:00
Tomasz Wasilczyk
dd767065fe Fix equality method implementation in BandConfig class.
Test: instrumentation (in master branch)
Bug: b/36863239
Change-Id: I2f3b68ba3fac75b849ee99dc06d0a13478168b7e
2017-04-28 08:19:34 -07:00
Mathias Agopian
910ab13e66 Plumb gralloc producer/consumer bits correctly
Bug: 33350696
Test: compile, boot device, its
Change-Id: I6129cedce0b35acfef1702afdd178ba043dd53cb
2017-04-28 00:13:29 +00:00
Dianne Hackborn
c154195d27 Fix issue #37714224: API Review: ACTION_NEW_VIDEO
Test: none, docs only.

Change-Id: Id6e3667884a5907c0877aabb3760fac88863ff7a
2017-04-27 10:56:12 -07:00
songjinshi
b5322b2be5 [Stability]: fix system_server crash issue caused by fd leak.
If an app incorrect use of registerListener, it will cause
system_server socket fd leak, for example:
    protected void onResume() {
        super.onResume();
        mSensorManager.registerListener(new MySensorEventListener(),
                mSensor, SensorManager.SENSOR_DELAY_UI);
Each time a new SensorEventQueue, then in the system_server
will open a new socket fd, as time increases system_server's
fd will be more than 1024 and crash, so we needed add count limit
for sensor listener to improve the system stability.

Test: use the apk attached in the issue
      https://code.google.com/p/android/issues/detail?id=258634
Bug: 37543280

Change-Id: I35006966a1638c25bb0f54611e117e16a764e12b
Signed-off-by: songjinshi <songjinshi@xiaomi.com>
2017-04-27 02:40:45 +00:00
TreeHugger Robot
1c5b71ec1f Merge "Return correct value at initDataInjection and avoid crash" into oc-dev 2017-04-25 23:18:24 +00:00
TreeHugger Robot
f879357cae Merge "Camera: Update docs for new auto-generation features" into oc-dev 2017-04-25 22:11:47 +00:00
Jeff Sharkey
a00c7c0a99 Merge "Fix some issues found by new doclava linter." into oc-dev 2017-04-25 22:11:01 +00:00
Jeff Sharkey
0f3f60b576 Fix some issues found by new doclava linter.
Add missing API annotations for permissions and SdkConstants, and
invoke doclava with new "-android" flag.

Test: make -j32 offline-sdk-docs
Bug: 37526420
Change-Id: I970bb2655eb568fd25004636f134c794663a6c33
2017-04-25 13:12:45 -06:00
Peng Xu
9098a0260f Merge "sensors: fix concurrent modification exception" into oc-dev 2017-04-25 17:51:26 +00:00
TreeHugger Robot
06d84c3a86 Merge "camera: Update for enableZsl values in template" into oc-dev 2017-04-24 22:36:54 +00:00
Eino-Ville Talvala
16ffbc65c0 Camera: Update docs for new auto-generation features
Annotate @IntDef with prefixes where possible.

Test: Look at doc output
Bug: 37635513
Change-Id: Iff3a9ecf83f348b56b3186e4dfe94a1e7697cfaf
2017-04-24 13:10:21 -07:00
Peng Xu
d9d4e1bc3b Return correct value at initDataInjection and avoid crash
When data inject channel cannot be initialized return false, instead
of causing crash.

Bug: 37549731
Test: run GTS SensorHostTest, test succeed with no failures observed.
Change-Id: Ia7a078b9e7d4f61927da8d76a0206e588fd6686c
2017-04-23 15:23:07 -07:00
TreeHugger Robot
649040c7f6 Merge "Update HardwareBuffer API." into oc-dev 2017-04-21 19:28:32 +00:00
Craig Donner
fd5d331efb Update HardwareBuffer API.
Bug: 37514517
Test: cts-tradefed run cts -t CtsHardwareTestCases -t android.hardware.cts.HardwareBufferTest
Change-Id: I5e381964b780472081ef9a65c3c37f63dbaf1e51
2017-04-20 15:47:49 -07:00