Commit Graph

3387 Commits

Author SHA1 Message Date
Ytai Ben-tsvi
d63953379b Merge "Doc fix" 2020-01-07 22:17:44 +00:00
Ytai Ben-Tsvi
c59b280c81 Doc fix
The previous doc goes into implementation detail (bad idea anyway),
which is no longer true.

Change-Id: I6923c55f9505cfc3d59e4dc76fe76c95d1bae74d
2020-01-07 14:08:16 -08:00
TreeHugger Robot
fab33b6bf5 Merge "Use new UnsupportedAppUsage annotation." 2020-01-07 07:58:18 +00:00
Eino-Ville Talvala
d2d749afd2 Camera: Add visual samples for android.scaler.cropRegion docs
To better document the cropping specification for camera2, add diagrams
from source.android.com into the reference docs as well.

Test: Docs build, look correct

Change-Id: I18a9c3801e19f39164f0d8c19c0cc001f142024f
2020-01-06 16:10:29 -08:00
Artur Satayev
269580069b Use new UnsupportedAppUsage annotation.
Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library.

Bug: 145132366
Test: m && diff unsupportedappusage_index.csv
Change-Id: I0c336de56bc4a041dc97ff9b7927f62f0b44b457
2020-01-06 16:47:35 +00:00
TreeHugger Robot
c4a819f5f5 Merge "Replace com.android.internal.util.Preconditions.checkNotNull with java.util.Objects.requireNonNull" 2020-01-06 13:46:54 +00:00
Daulet Zhanguzin
0eb0a776a7 Replace com.android.internal.util.Preconditions.checkNotNull with
java.util.Objects.requireNonNull

Bug: 126528330

Test: Treehugger
Exempt-From-Owner-Approval: Global refactoring.
Change-Id: I9ca95bd74a32d913bd6bd06d0194c8f4d8da2142
2020-01-03 18:10:19 +00:00
TreeHugger Robot
046f1d8502 Merge "Camera: Cache tag id to avoid repeatative lookup" 2020-01-02 22:35:12 +00:00
Curtis Belmonte
3833bdcb0a Merge "Reformat biometric auth constants to 4 hex digits" 2020-01-02 18:10:53 +00:00
Shuzhen Wang
fe33a3aa32 Camera: Cache tag id to avoid repeatative lookup
Looking up tag id based on tag name for each key is potentially time
consuming. Instead, cache the id in the Key object so that only when the
first getTag() triggers a look-up. All subsequent calls doesn't do
look-up.

Bug: 144028609
Test: Run GCA and observe CameraMetadata CPU consumption
Change-Id: Iadd92e7e3b6cb4d610a6c9704ca2066291291f43
2020-01-02 08:55:29 -08:00
Daulet Zhanguzin
fcc8d868be Replace com.android.internal.util.Preconditions.checkNotNull with
java.util.Objects.requireNonNull

Bug: 126528330

Test: Treehugger
Change-Id: I2afb61144af7bdd058df1311062ed8f4859ad861
2019-12-31 14:21:51 +00:00
TreeHugger Robot
c3a20c3b2c Merge "Make the short term brightness model configurable." 2019-12-31 13:06:29 +00:00
Kenny Guy
b29fdf1d71 Make the short term brightness model configurable.
Bug: 146141793
Test: atest BrightnessConfigurationTest
Test: atest AutomaticBrightnessControllerTest
Test: manual - use reflection to configure the new parameters from turbo app and check dumpsys

Change-Id: I78af8009f15400f2f91e55363066d97f008a7922
2019-12-30 16:19:59 +00:00
Robin Lee
9fa43dad06 Make getCameraIdListNoLazy handle no service case
If we have sCameraServiceDisabled, we know for sure that calling
addListener on the mCameraService is going to fail with NPE, so the best
option is to just return an empty list.

Fix: 146994502
Test: atest android.camera.cts.HeifWriterTest
Change-Id: Ie3a1457fbace0879a5d66600acd83541a9d78182
2019-12-30 13:05:46 +01:00
TreeHugger Robot
7512419419 Merge "Reject messages larger than MTU size" 2019-12-27 02:19:14 +00:00
Arthur Ishiguro
3009e50fe8 Reject messages larger than MTU size
Bug: 143360045
Test: Compile only
Change-Id: I2b8c226a5b8dffd3b9e9f7d533588592f6a1ec9b
2019-12-26 14:38:13 -08:00
Galia Peycheva
056b3ee745 Add minimal post processing API to framework
This API allows applications to instruct the connected display to do minimal
post processing on the produced image or video frames. This will switch the
display to a low latency mode (ALLM, Game mode or some other custom
implementation thereof), reducing lag in the final images. Thus, minimal post
processing would greatly enhance performance for gaming and video
conferencing applications. It would not, however, suit applications that
prioritise image quality over performance.

This CL adds 2 public method:
 - Window.setPreferMinimalPostProcessing()
(this can also be set in WindowManager.LayoutParams.preferMinimalPostProcessing)
If minimal post processing is preferred, the connected display will be requested
to go into low latency mode, which reduces image processing, resulting in better
performance for gaming applications. If the Display sink is connected via HDMI,
the device will begin to send infoframes with Auto Low Latency Mode enabled and
Game Content Type. This will switch the connected display to a lower latency
mode (if available).
For more information, see HDMI 2.1 specification.

If the Display sink has an internal connection or uses some other protocol than
HDMI, effects may be similar but implementation-defined.

 - Display.isMinimalPostProcessingPreferred()
Returns true if the connected display supports either Low Latency Mode (ALLM or
some other custom low latency implementation) or Game content type.

Bug: 135116095

Test: make -> flash on ATV OTT device -> open an activity which requests minimal
post processing -> check SurfaceControl logs -> verify correct signals are
passed to native

Change-Id: I5508bb9e5c138b0f2b42d8f8fab10e1915ba3cb6
2019-12-23 17:27:55 +01:00
Joshua Mccloskey
0cf243eafd Merge "Add builder method to check DevicePolicyManager" 2019-12-19 18:21:44 +00:00
Shuzhen Wang
f8aca7b463 Merge "Camera: Add support for CONTROL_ZOOM_RATIO" 2019-12-19 03:32:59 +00:00
joshmccloskey
15c0a441c9 Add builder method to check DevicePolicyManager
This is a hidden method and BiometricService will enforce
that 3rd party applications cannot use it.

Fixes: 142966163
Test: Verified disabling fingerprint will not allow
the user to unlock work apps with fingerprint. (But can use fingeprint
within apps.)
Test: Verified disabling face and/or iris on a fingerprint device will
continue to
allow the user to unlock work apps with fingerprint.
Test: Verified disabling face on a face authentication device
will not allow the user to unlock work apps with face authentication.
(But can use face
authentication within apps.)
Test: Verified disabling fingerprint and/or iris on a face
authentication device will continue to allow the user to unlock work
apps with face authentication.

Change-Id: I21ae00d0993d78a641cb8c5d8af2dd02be0b4a21
2019-12-18 16:12:36 -08:00
Ytai Ben-tsvi
0d52f4202c Merge changes from topic "soundtrigger_refactor"
* changes:
  Migrate SoundTrigger implementation to new service
  Implement the soundtrigger_middlewware service
  Add a permission for preempting sound trigger sessions
  Sound trigger middleware service definition
  Add audio.common types AIDL definition
2019-12-17 22:33:55 +00:00
TreeHugger Robot
37ea48adc8 Merge "Camera: Fix typo when comparing display size height" 2019-12-17 17:57:02 +00:00
TreeHugger Robot
2067b230a0 Merge "Camera: add OFFLINE_PROCESSING capability" 2019-12-17 09:31:41 +00:00
Curtis Belmonte
b8449365ca Reformat biometric auth constants to 4 hex digits
Updates these constants to retain their current values while making them
easier to read/compare. No API changes required.

Test: m -j
Bug: 80525177
Change-Id: Icf4900e11cc28be3c1a7a558c43db57c52d943c0
2019-12-16 15:35:49 -08:00
Ytai Ben-Tsvi
7d383d1a98 Migrate SoundTrigger implementation to new service
The API offered by SoundTrigger.java is now implemented on top of
the new soundtrigger_middleware service.
There is no longer any need for JNI - the API now talks directly
with the AIDL interface of the new service.

In the process, some annotations and input validation have been added
to improve the overall quality of this API.

Change-Id: I731ffd5a275b88f38d84dd3daa022a13f97a5ee1
Bug: 142070343
2019-12-16 14:15:37 -08:00
Emilian Peev
8649a91686 Camera: Fix typo when comparing display size height
Call "getHeight()" instead of "getWidth()" when
comparing against preview size height.

Bug: 146364316
Test: Camera CTS
Change-Id: I588fd3b331380ff20762c24762e997d4a878cc44
2019-12-16 13:57:12 -08:00
Kevin Chyn
14ff3aab30 Merge changes from topic "biometric-strength"
* changes:
  Enforce that registered authenticators are not null
  Ensure that cancelling authentication ends up in the correct state
  Enforce authenticator registration
  Enforce that only public authenticator combinations are accepted
  Add phenotype namespace and flag for biometrics
  Use @Authenticators.Types for authenticator selection
  Add setAllowedAuthenticators(int) to BiometricPrompt
2019-12-16 20:06:31 +00:00
Robin Lee
75ba497beb Merge "Revert submission" 2019-12-14 03:06:25 +00:00
Hansong Zhang
b62b7b724d Revert submission
Based on Forrest run with earlier base build 6069142, the build with this submission failed apct/bluetooth/instrumentation_test

Reason for revert: Break tests
Bug: 146198238
Change-Id: I65060ca389bf3ae1f107552ca828bfc1e7baa7c1
2019-12-13 22:10:01 +00:00
Yin-Chia Yeh
440ee2608f Camera: add OFFLINE_PROCESSING capability
Test: N/A. New API skeletion without implementation yet.
Bug: 135142453
Change-Id: I8b019c6a3eee7e0fbfd328a1db71280a210ad5e2
2019-12-13 11:17:31 -08:00
Galia Peycheva
a4aff1e1df Merge "Add minimal post processing API to framework" 2019-12-13 10:09:00 +00:00
Haining Chen
5c7ed9affd Add phenotype namespace and flag for biometrics
This allows the ability to enforce biometric modality strength (downgrade only) on certain devices.

Bug: 141025588

Test: atest com.android.server.biometrics
Test: make system-api-stubs-docs-update-current-api
Test: make test-api-stubs-docs-update-current-api
Test: manual testing using "adb shell device_config put NAMESPACE KEY VALUE"

Change-Id: Ib167a038d717216ec0a54d6f4f6f5f88a70e1a6e
2019-12-12 19:37:52 -08:00
Ilya Matyukhin
30f1dd8be1 Use @Authenticators.Types for authenticator selection
This CL adds "canAuthenticate(int)" to BiometricManager.

Currently, authenticators can be one or more of the following:
    DEVICE_CREDENTIAL
    BIOMETRIC_STRONG
    BIOMETRIC_WEAK

Test: Auth on existing devices
Test: atest com.android.server.biometrics

Bug: 141025588
Change-Id: Idf52c5a76a0e24a8610ee5f46d55cd4197605fe7
2019-12-12 19:10:14 -08:00
Curtis Belmonte
13eb5813a1 Add setAllowedAuthenticators(int) to BiometricPrompt
Introduces a BiometricPrompt.PromptInfo#setAllowedAuthenticators(int)
method to allow a caller to specify whether to allow BiometricPrompt to
authenticate with device credential, biometric auth, or either. Also
renames the non-public Authenticator class to Authenticators, to avoid a
name collision and potential confusion with other Authenticator classes.

Test: make -j update-api
Test: atest AuthBiometricViewTest
Test: atest AuthContainerViewTest
Test: atest AuthControllerTest
Test: atest BiometricServiceTest

Bug: 80525177
Change-Id: I51da3ff0dcc7e49adb2d7f1c9cdaa12a55b11565
2019-12-12 18:15:39 -08:00
Nicholas Ambur
a0be6be387 add SoundTrigger HAL 2.3 per model parameter apis
add support for model parameter control APIs with THRESHOLD_FACTOR
as the first supported parameter

Bug: 141929369
Test: Tested manually with test app and confirmed with GTS test
gts-tradefed run gts-dev -m GtsAssistIntentTestCases
Change-Id: I06874fcf2ae2ef8796e7c52c4475252e8a026e2c
2019-12-11 19:16:48 -08:00
Shuzhen Wang
55c1c3f874 Camera: Add support for CONTROL_ZOOM_RATIO
- The new zoom API combines optical and digital zoom, and supports both
zoom-out and zoom-in with more precision.
- Support separate zoom ratio ranges for different bokeh modes.

Test: Camera CTS/ITS/CtsVerifier
Bug: 130025314
Bug: 145592831
Change-Id: I4febe047643bfd1ceb398b99cb99f3011e506d88
2019-12-11 13:49:02 -08:00
Kevin Chyn
f182a1e8d6 Merge "Update BIOMETRIC_ERROR_VENDOR javadoc" 2019-12-06 21:58:29 +00:00
TreeHugger Robot
bd52bdf8b7 Merge "Fix signedness of DisplayAddress.Physical ports" 2019-12-06 21:51:21 +00:00
Kevin Chyn
a73bfa27a9 Update BIOMETRIC_ERROR_VENDOR javadoc
Bug: 142157673

Test: Builds
Change-Id: I46f918806db3f50abfbe3aeb407f2e58e15edafd
2019-12-06 20:19:20 +00:00
Galia Peycheva
ea9457585a Add minimal post processing API to framework
This API allows applications to instruct the connected display to do minimal
post processing on the produced image or video frames. This will switch the
display to a low latency mode (ALLM, Game mode or some other custom
implementation thereof), reducing lag in the final images. Thus, minimal post
processing would greatly enhance performance for gaming and video
conferencing applications. It would not, however, suit applications that
prioritise image quality over performance.

This CL adds 2 public method:
 - Window.setPreferMinimalPostProcessing()
(this can also be set in WindowManager.LayoutParams.preferMinimalPostProcessing)
If minimal post processing is preferred, the connected display will be requested
to go into low latency mode, which reduces image processing, resulting in better
performance for gaming applications. If the Display sink is connected via HDMI,
the device will begin to send infoframes with Auto Low Latency Mode enabled and
Game Content Type. This will switch the connected display to a lower latency
mode (if available).
For more information, see HDMI 2.1 specification.

If the Display sink has an internal connection or uses some other protocol than
HDMI, effects may be similar but implementation-defined.

 - Display.isMinimalPostProcessingPreferred()
Returns true if the connected display supports either Low Latency Mode (ALLM or
some other custom low latency implementation) or Game content type.

Bug: 135116095

Test: make -> flash on ATV OTT device -> open an activity which requests minimal
post processing -> check SurfaceControl logs -> verify correct signals are
passed to native

Change-Id: Id09160ba1513fef4dac979162bcda3bfeaace0e6
2019-12-06 15:20:02 +01:00
Automerger Merge Worker
3a9ace7b43 Merge "Camera: Avoid removing valid repeating requests" am: 0e7782c87b am: 468c1263cf
Change-Id: I5fec062950b09211988c3b784c1608dcfbaae191
2019-12-04 15:54:17 +00:00
Emilian Peev
a491caf3fb Merge "Camera: Avoid removing valid repeating requests"
am: 0e7782c87b

Change-Id: Iee1a2277935c0b8a5f04ef9cd85ce7cfbd3415c9
2019-12-03 11:46:08 -08:00
Dominik Laskowski
67cc7f819e Fix signedness of DisplayAddress.Physical ports
Interpret port as unsigned byte for consistency with uint8_t in SF/IF,
and clarify signedness in doc comments.

Bug: 143713778
Test: adb shell dumpsys display | grep physicalPort
Test: LocalDisplayAdapterTest
Test: DisplayWindowSettingsTests
Change-Id: I56ce0067367372a3a747fde783a1956975e833a0
2019-11-25 14:46:29 -08:00
Ilya Matyukhin
e4675b3067 Implemented and integrated AuthService
AuthService in its current form is a thin wrapper around
BiometricService. It initializes BiometricService in onStart();
registers fingerprint, face, and iris authenticators; and forwards all
of the incoming calls to the corresponding methonds in BiometricService.

The next step will be to move non-biometric related functionality from
BiometricService to AuthService, and turn BiometricService into a module
with a stable API.

Bug: 141025588
Test: atest AuthServiceTest
Test: atest BiometricServiceTest
Test: BiometricPrompt works in BiometricPromptDemo
Change-Id: Ia861b7c2d80bfca386c3e0b44ec35b4aca3b0ffc
2019-11-18 22:10:50 +00:00
Kenny Guy
e9eb313f14 Merge "Add an API to BrightnessConfiguration to enable colour sampling." 2019-11-18 16:50:34 +00:00
Kenny Guy
d6fd7d661e Add an API to BrightnessConfiguration to enable colour sampling.
Default colour sampling off and add an API to enable it.

Bug: 143556482
Test: atest BrightnessTrackerTest
Test: atest BrightnessConfigurationTest
Change-Id: I955fa683d6410c7851e8f6ad503d5bfbdf0677f5
2019-11-14 16:42:08 +00:00
Philip P. Moltmann
a6359b825e Pipe though featureId from context to note-ops by camera code
Bug: 136595429
Test: atest CtsAppOpsTestCases (now including two new test cases that
              open a camera with a null and a non-null feature)
Change-Id: Ia9be1016e4e6a1a2af09b7b08c9d0373440813c6
2019-11-14 08:40:16 -08:00
Emilian Peev
6f3e5a0d49 Camera: Avoid removing valid repeating requests
Due to lock contention between the legacy camera
device implementation and the Camera2 framework,
result and error callbacks can be delayed which
can allow clients to update the repeating request
resulting in incorrect behavior.
To avoid this, check whether repeating request
errors still refer to valid and active request ids
tracked by the request queue before posting
callbacks.

Bug: 143727669
Test: Camera CTS

Change-Id: I8f2da0aace40b33757b3c3ac4febc3af7f0ec6cd
2019-11-04 14:24:30 -08:00
Shuzhen Wang
1ab8514517 Camera: Add bokeh mode tags in camera metadata
Introduce new bokeh mode metadata tags for camera device to enable bokeh
effect.

Test: Build and read docs
Bug: 118258123
Change-Id: Id0bb30b0fc9a50eb12b6062132fdac65755b0cdf
2019-10-28 17:55:58 -07:00
TreeHugger Robot
ddd425e522 Merge "change KeyphraseEnrollmentInfo to store services" 2019-10-25 03:08:40 +00:00