Commit Graph

3977 Commits

Author SHA1 Message Date
TreeHugger Robot
000e6794a2 Merge "Update Biometric TestApis" 2020-10-14 17:53:17 +00:00
Darryl Johnson
829b71b0f1 Merge "Add binder interface to DeviceStateManagerService." 2020-10-14 02:59:36 +00:00
Darryl L Johnson
76b1f31b9a Add binder interface to DeviceStateManagerService.
Test: None
Bug: 159401801

Change-Id: Ia37bb555d2baf43de8d1415731eb0ce5064da907
2020-10-13 14:43:04 -07:00
Charles Chen
558cee47d3 Merge "Add foldable support for RouteInfo#getPresentationDisplay" 2020-10-13 05:59:53 +00:00
Kevin Chyn
79f689dd56 Merge "4/n: Add RevokeChallenge and ResetLockout for IFingerprint" 2020-10-12 20:30:09 +00:00
Kevin Chyn
6a97e964cb Update Biometric TestApis
Fixes: 169459906
Test: make -j update-api && make -j
Change-Id: I128b55cac9ba76652c7c6228790278ac89d9122c
2020-10-12 13:16:39 -07:00
Charles Chen
9ba52e22a5 Add foldable support for RouteInfo#getPresentationDisplay
In this CL, RouteInfo#getPresentationDisplay by following order:
1. Connected Wifi displays (Ex: chromecast)
2. Attached external displays (Ex: an external display plugged by HDMI)
3. Non-default built-in displays

Test: MediaRouteInfoTest
Bug: 130035480
Change-Id: Ib2dd63217ebe415c2bda57f60e42713ca325f56e
2020-10-12 19:05:49 +08:00
Kevin Chyn
b3cf50a338 4/n: Add RevokeChallenge and ResetLockout for IFingerprint
Bug: 168843828
Test: Builds

Change-Id: I73631dd82498975044997ee623fdec61fd6b4599
2020-10-09 17:21:42 -07:00
Kevin Chyn
9b9d4b2e09 Merge changes Ieabf61aa,Ib566e3f3
* changes:
  3/n: Start adding plumbing for some HAL callbacks
  2/n: Add HardwareAuthTokenUtils
2020-10-09 22:47:19 +00:00
Kevin Chyn
50b13e5325 3/n: Start adding plumbing for some HAL callbacks
Fixes: 168843828
Test: Builds
Change-Id: Ieabf61aa3f447072f23b748d4101ba7908266ad0
2020-10-09 13:18:17 -07:00
Kevin Chyn
fc26e8a0e0 Add wireframe for biometric TestApis
1) Adds BiometricTestSession and empty implementations
2) Adds TEST_BIOMETRIC permission
3) Grants Shell USE_BIOMETRIC and TEST_BIOMETRIC permission

Bug: 169459906
Test: make -j update-api && make -j

Change-Id: Iea9fd37d7234eb7e5e34a7a2698cbf0ca7a33a77
2020-10-09 11:15:03 -07:00
Kevin Chyn
97b3630985 Merge "1/n: Start implementation of IFingerprint aidl" 2020-10-09 02:44:25 +00:00
Jeff Sharkey
f76ffeaff1 Merge changes from topic "oct6"
* changes:
  Upgrade AndroidFrameworkBinderIdentity to fatal.
  Tighten up Binder.clearCallingIdentity() usage.
  Tighten up Binder.clearCallingIdentity() usage.
  Tighten up Binder.clearCallingIdentity() usage.
2020-10-08 18:50:22 +00:00
Kevin Chyn
06e8478edb 1/n: Start implementation of IFingerprint aidl
Adds first IFingerprint ClientMonitor (GenerateChallenge)
Adds first ISession ClientMonitor (Enroll)

Bug: 168843828
Test: No effect on existing devices
Test: ./vendor/bin/hw/android.hardware.biometrics.fingerprint-service.example
Change-Id: Id8ed52f599d358880213350eddd44cd7913fcc86
2020-10-08 11:14:14 -07:00
TreeHugger Robot
b2ddafa37f Merge "Remove deprecated VibrationAttributes.getAudioAttrs method" 2020-10-08 12:48:17 +00:00
Jeff Sharkey
b93712f623 Tighten up Binder.clearCallingIdentity() usage.
This is a third CL in a chain that adjusts existing malformed code
to follow AndroidFrameworkBinderIdentity best-practices.

Specifically, if a thread clears an identity they need to restore it
to avoid obscure security vulnerabilities.  In addition, the relevant
"try" block must start immediately after the identity is cleared to
ensure that its restored if/when any exceptions are thrown.

Bug: 155703208
Test: make
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: I74cb958b68d55a647547aae21baff6ddc364859b
2020-10-07 21:24:05 -06:00
Siarhei Vishniakou
f87e43299e Use enum class for injection modes and result
Since injection-related constants are now enum class, use the new
versions here.

Bug: 161009325
Test: presubmit
Change-Id: Icae277f73d693cdc502b70b8299a9763cc276471
2020-10-07 14:14:31 -05:00
Bernardo Rufino
0cbce5de93 Merge "Block untrusted touches opt-in" 2020-10-06 08:05:00 +00:00
Bernardo Rufino
64bbd4b1d9 Block untrusted touches opt-in
The feature is disabled by default and can be in one of 3 modes:
disabled, permissive and block. In permissive we only log but
don't block the touch. This knob is implemented in a global setting
block_untrusted_touches. It can also be disabled per occluding app using
app-compat infrastructure, so if you disable for a certain app, overlays
of that app won't have the chance of blocking touches. More details
on these on go/try-cross-uid-touches.

Each window has 3 modes related to touch occlusion: ALLOW, USE_OPACITY
or BLOCK_UNTRUSTRED. Check code comments for the meaning of each. If the
feature is turned off for the app, then the mode is ALLOW. Else if it's
a SAW, then it's USE_OPACITY. Else it's BLOCK_UNTRUSTED. These states
are passed to InputDispatcher, who then perform the proper checks and
blocks or not the touch.

If input dispatcher deems the touch unsafe, depending on the feature
mode, we filter out such touches and log a message to logcat.

I also introduce a global (secure) setting
MAXIMUM_OBSCURING_OPACITY_FOR_TOUCH which represents the maximum
opacity allowed per UID that's obscuring the touch-consuming window
according to some rules, which are discussed in topic CL for
InputDispatcher code. This maximum is initially set to 0.8, but we'll
be conducting local experiments to determine the final value.

Test: atest WindowUntrustedTouchTest
Test: atest inputflinger_tests inputflinger_benchmarks libinput_tests
Test: go/try-cross-uid-touches for manual testing
Bug: 158002302
Change-Id: I462858ad5f0d11b1261748489385e6409e38e4b1
2020-10-05 11:44:37 +00:00
Lais Andrade
8f2674b2dc Remove deprecated VibrationAttributes.getAudioAttrs method
Removing the deprecated AudioAttributes field from VibrationAttributes
in favor of a usage mapping to be used with AppOpsManager.checkAudioOp.

The mapping ensures the heuristic applied in VibrationAttributes.Builder
is taken into account by the VibratorManager.

This also adds a hidden method to Vibrator to allow forwarding a
VibrationAttributes to input device vibrators instead of relying on the
original AudioAttributes.

Bug: 163119475
Test: atest FrameworksServicesTests:VibratorServiceTest
      atest FrameworksCoreTests:VibratorTest
Change-Id: I83dbe079865b453c4cf42a6fd7e71f822acc39ea
2020-10-01 16:32:19 +00:00
Kevin Chyn
dee230f919 Merge "Rename existing getSensorProperties, prepare for TestApi" 2020-10-01 01:24:01 +00:00
Kevin Chyn
bb1d1c52b9 Rename existing getSensorProperties, prepare for TestApi
Parcelables cannot easily become TestApi, since CREATOR, etc
all come as extra baggage. So, rename internal usage to
*SensorPropertiesInternal, and add a new class that exposes
only specific parts of the properties for future TestApi

Bug: 169459906
Test: Enroll, Auth on existing devices
Test: atest com.android.systemui.biometrics
Test: atest com.android.server.biometrics
Change-Id: I59ae6bd30bef0eccbbcb58ddd7fa443be8a42ccf
2020-09-30 11:44:07 -07:00
TreeHugger Robot
4fea692b57 Merge "Camera: Track native metadata allocations" 2020-09-30 18:40:09 +00:00
Darryl Johnson
5d5f71ee3e Merge "Add support to InputManagerService for listening to lid switch events." 2020-09-29 22:07:51 +00:00
Darryl L Johnson
5d0d141178 Add support to InputManagerService for listening to lid switch events.
This extracts the notifyLidSwitchChanged() method from
WindowManagerCallbacks to allow services other than window manager to
receive lid switch notifications

Test: Manual, register callback and trigger lid switch
Bug: 159401801

Change-Id: I8967d4f2f5a9c56c2b7e0822224d1c0ea0f1bc06
2020-09-29 13:00:05 -07:00
TreeHugger Robot
832d1543fb Merge "Camera: Clarify SCALER_CROP_REGION usage" into rvc-dev am: 601e34fdd7 am: 7b0ce3eded
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12586676

Change-Id: If42cde5ad9cac034cad7fa675cc8f275fe50bdac
2020-09-29 17:32:42 +00:00
Kevin Chyn
2da7757314 Merge "Add and use ServiceProvider interface on fingerprint2.1" 2020-09-29 00:50:35 +00:00
Kevin Chyn
ed18d80855 Add and use ServiceProvider interface on fingerprint2.1
This interface should allow easy support for multiple HAL interfaces.
For example,

for (ServiceProvider p : providers) {
    if (p.containsSensor(sensorId)) {
        p.authenticate(sensorId, ...)
    }
}

or,

ServiceProvider provider = getProviderFor(sensorId)
if (provider != null) provider.authenticate(sensorId, ...)

This should reduce lots of repeated null checks, sensorId checks,
etc. and give FingerprintService a easy way to perform operations
on providers, given a sensorId.

Some of the FingerprintManager code is not sensorId-specific,
but we can update those in the future. Otherwise we have to
touch multiple projects (settings, etc). For now, all client-side
code assumes only a single sensor, so that's what we'll support
from FingerprintService.

Bug: 168843828
Test: No effect on existing devices
Test: atest com.android.server.biometrics
Test: atest com.android.systemui.biometrics

Change-Id: Icca5bc1e128afa1bb7b2c05227e87567e564e4cf
2020-09-25 18:41:41 -07:00
Jayant Chowdhary
bec0a90161 Merge "camera2: Remove partial result nodes for error frames." 2020-09-25 19:06:12 +00:00
Jayant Chowdhary
ff85804681 Merge "camera2: Improve code readability for FrameNumberTracker." 2020-09-25 18:56:41 +00:00
Treehugger Robot
3aed0006e3 Merge "Fix setType() return value for high angle sensor" am: 5a2d80de45 am: 89d18e94e4 am: 1e97e64bf2 am: a57b4b75c5 am: cec2a6d20f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1436893

Change-Id: I8a247f6af7e2a018896e8c92aff441f269792292
2020-09-25 05:46:56 +00:00
Treehugger Robot
cec2a6d20f Merge "Fix setType() return value for high angle sensor" am: 5a2d80de45 am: 89d18e94e4 am: 1e97e64bf2 am: a57b4b75c5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1436893

Change-Id: I4a6974cab2f97b5c9f2a550c99857788592f3db1
2020-09-25 05:24:31 +00:00
Treehugger Robot
a57b4b75c5 Merge "Fix setType() return value for high angle sensor" am: 5a2d80de45 am: 89d18e94e4 am: 1e97e64bf2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1436893

Change-Id: If7aabccc5c08ec1d6e640a0b3361abaf96346f59
2020-09-24 21:52:53 +00:00
Treehugger Robot
1e97e64bf2 Merge "Fix setType() return value for high angle sensor" am: 5a2d80de45 am: 89d18e94e4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1436893

Change-Id: I5d4a833884e9c732b9f96cd0ca6f72a889b89254
2020-09-24 21:24:53 +00:00
Jayant Chowdhary
91e64e2d3a camera2: Remove partial result nodes for error frames.
When there's an capture error reported for a frame, remove its nodes in
mPartialResults map node, since they'll not be used by clients of
FrameTracker. This should also reduce slow memory pressure build up
because of mPartialResult growth as and when there are error frames
which have some partial results as well.

Bug: 167944895

Test: GCA on Pixel2, constant mode changes don't show steady state increase in
      mPartialResults map size (Basic validity)

Change-Id: I6de585deb24039321310ddbd5dccd9119b25b23d
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2020-09-24 10:19:49 -07:00
Jayant Chowdhary
91f7bc0b3b camera2: Improve code readability for FrameNumberTracker.
Bug: 168713666

Test: builds
Test: GCA (basic validity)

Change-Id: Id0f9b5a9a6363f40daa9384ee5f01b47d36ad139
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2020-09-24 10:18:59 -07:00
Wang Han
fcf671890f Fix setType() return value for high angle sensor
Change-Id: I712fd77f8079fc17c45dcbc1c2fdf1be72d338f2
2020-09-24 13:16:18 +00:00
Kevin Chyn
c1ef4186c8 Match Framework and AIDL SensorProps
This should be enough to get started. We can plumb the remaining
AIDL properties through when we need them.

This is also fundamental to future TestApis

Test: No effect on existing fingerprint/face devices
Test: atest com.android.server.biometrics
Test: atest com.android.systemui.biometrics

Fixes: 169195610

Change-Id: I376567b4a59672b68d83c04738866b58334f8011
2020-09-23 12:22:20 -07:00
Charles Chen
853a7f4a36 Merge "Update language to comply with Android's inclusive language guidance" 2020-09-23 05:17:35 +00:00
Ytai Ben-Tsvi
da7c21ec51 Separate AIDL packages
This moves the android.media.audio.common, android.media.permission and
android.media.soundtrigger_middleware AIDL files to a their own
separate aidl_interface module for Java.

Previously, because of how the framework JAR is configured, those
files were automatically compiled into it and we had to disable Java
for this target, creating a discrepancy between C++ and Java, which
would require us to similarly diverge any dependent targets if we want
cross-language support.

As part of this change, we also had to switch from using the
FileDescriptor type to ParcelFileDescriptor, as this is the only type
supported outside of the framework JAR and is also the recommended
practice.

Test: Manual verification of basic soundtrigger functionality.
Change-Id: Ib65c19dd7c7f5433cfa527fa74bb61ac677f5cf5
2020-09-22 10:07:00 -07:00
Charles Chen
af5cb5e0ff Update language to comply with Android's inclusive language guidance
1. Rename HighRefreshRateBlacklist to HighRefreshRateDenylist
2. Remove crazy from DisplayContent

See https://source.android.com/setup/contribute/respectful-code for
reference

Bug: 162536543
Test: atest HighRefreshRateDenylistTest RefreshRatePolicyTest

Change-Id: Id41a370916448173f5928c91b15219cbaf36f691
2020-09-22 19:11:54 +08:00
Ytai Ben-tsvi
189d6050da Merge changes from topic "new-perm"
* changes:
  Demote AlwaysOnHotwordDetector to SystemApi
  Sessionize VoiceInteractionManagerService
  Sessionize the SoundTriggerService layer.
  Use standard API in SoundTriggerTestApp
  Fix bug in dumpsys
  Require identity information in SoundTrigger.java
  Associate an originator identity to sessions
  Extract permission checking as a separate aspect
  Correctly handle HAL death
2020-09-21 19:07:04 +00:00
Marin Shalamanov
768cbbd32c Merge "Add TestApi to always select the app requested display mode" 2020-09-21 12:02:28 +00:00
Marin Shalamanov
97ba024fb0 Add TestApi to always select the app requested display mode
The added test API is used to ignore all votes in
DisplayModeDirector app votes. This way only the app
requested display mode will be picked. The API will be
used for testing app mode switch requests.

Bug: 159113268
Bug: 158316271
Test: m
Change-Id: I257636ae2a6ed74044e71e49a99024682c3a92c5
2020-09-18 13:32:54 +02:00
Shuzhen Wang
477c23ed89 Camera: Clarify SCALER_CROP_REGION usage
1. Document same SCALER_CROP_REGION may map to different aspect
ratio/output size for different sessions.
2. Remove the text in ZOOM_RATIO about using SCALER_CROP to change
aspect ratio.

Test: Build and read docs
Bug: 168493526
Change-Id: I405fe52d0e0a14e6a1cfbec169d33f20715fa4fb
2020-09-16 11:53:38 -07:00
Jeff Sharkey
4b5b0174d0 Merge changes from topic "sep11" am: c0b288133a am: 69e6f07347 am: 741c0a78cc am: da7478b570 am: 487d394296
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426195

Change-Id: Id01f468b43fd5b2aada78608010625b392c1b647
2020-09-15 21:01:48 +00:00
TreeHugger Robot
cf71d0c13a Merge "UDFPS on AOD" 2020-09-15 12:40:59 +00:00
Jeff Sharkey
487d394296 Merge changes from topic "sep11" am: c0b288133a am: 69e6f07347 am: 741c0a78cc am: da7478b570
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426195

Change-Id: I79488866c538bf9e76d0a6429e30262978f6fdab
2020-09-15 00:13:08 +00:00
Jeff Sharkey
da7478b570 Merge changes from topic "sep11" am: c0b288133a am: 69e6f07347 am: 741c0a78cc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426195

Change-Id: I9b79dbf3e9983523db11599d8ae289b05aabf80c
2020-09-14 23:42:34 +00:00
Emilian Peev
0173af0189 Add RAW_DEPTH10 image format
Add support for 10bit opaque and private RAW_DEPTH10 image format
which is similar to RAW_DEPTH.

Bug: 167250258
Test: Manual using camera application.
Change-Id: Ib2ee11570429d7a9a53e9dd6bc2042a1f5eaa760
2020-09-14 23:34:49 +00:00