Commit Graph

4015 Commits

Author SHA1 Message Date
Michal Olech
b71636ad79 [CEC Configuration] Rename getAvailableCecSettings to getUserCecSettings
Also:
* use @CecSettingName more extensively in the API and method signature.
* add getAllCecSettings() method to HdmiCecConfig.

Bug: 168020131
Test: atest HdmiCecConfigTest
Change-Id: I318357befb05324afd0132dfcbaf2d9cc6f7bf33
2020-10-22 14:50:31 +02:00
Michal Olech
ec820fd42c Merge changes from topic "CecConfigZero"
* changes:
  [CEC Configuration] Add CEC Configuration APIs
  [CEC Configuration] Add XML schema parser API
2020-10-22 11:41:21 +00:00
Michal Olech
b4fd0e8576 [CEC Configuration] Add CEC Configuration APIs
Bug: 166426337
Bug: 169144568
Test: atest HdmiCecConfigTest

Change-Id: I7f109027103e73955d09b251a7a94aee9beded67
2020-10-22 11:26:40 +02:00
Jeff Sharkey
1992cdb4de Merge changes from topic "oct16c"
* changes:
  Apply fixes for EfficientStrings.
  Apply fixes for EfficientStrings.
  Apply fixes for EfficientStringsChecker.
  Apply fixes for EfficientCollections.
  Trivial refactor for consistent naming.
  Expand formatSimple() to support widths.
  Refinement of EfficientStringsChecker.
2020-10-21 15:27:15 +00:00
Jeff Sharkey
c603ca2dd8 Apply fixes for EfficientStrings.
Refactoring to avoid StringBuffer synchronization overhead.

Bug: 170978902
Test: none
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: Ibf843ed780c1202d5d96a11eaca889e592f19263
2020-10-20 22:00:20 -06:00
Jeff Sharkey
1c08f48253 Apply fixes for EfficientStringsChecker.
The recently-built Error Prone checker has found many instances where
we're always paying the cost of StringBuilder concatenation, even in
the typical cases where preconditions are successfully met.

Benchmarks have shown that even when replacing these with varargs
formatter strings, the default case is 20x faster.

Bug: 170978902
Test: none
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: If8c00bc73467bfb91ec16c162969c9d26ca53646
2020-10-20 22:00:16 -06:00
Kevin Chyn
e89674f9d8 Merge "Add missing parameters to notifyAcquired and notifyError" 2020-10-20 21:32:39 +00:00
Kevin Chyn
247408b28f Add missing parameters to notifyAcquired and notifyError
Adds missing acquireInfo and errorCode parameters

Bug: 169459906
Test: make -j update-api && make -j
Change-Id: I8cae7662e9d4ad7dad6064365479d0e08b7e4d11
2020-10-20 12:21:33 -07:00
Anton Hansson
c0e3a09690 Merge "Remove @TestApi from @SystemApi symbols" 2020-10-20 13:41:39 +00:00
Santos Cordon
ae31181f13 Merge "Integrate LogicalDisplayMapper with DisplayFoldController." 2020-10-20 11:47:44 +00:00
Anton Hansson
586a3cf229 Remove @TestApi from @SystemApi symbols
I ran these commands:
    cd frameworks/base
    grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \
        's/\@SystemApi[\s\n]+(\@\w+[\s\n]+)?\@TestApi/\@SystemApi\1/gs'
    grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \
        's/\@TestApi[\s\n]+(\@\w+[\s\n]+)?\@SystemApi/\1\@SystemApi/gs'

Bug: 171179806
Test: m checkapi
Change-Id: I772790b783b0a8730b8bf680c9e569a886b8d789
2020-10-20 09:04:03 +01:00
Treehugger Robot
3c61e7fd71 Merge "Fix documentation of heart beat sensor" am: 3bef7fe58b am: a3d54aaa88 am: 4807d99163 am: 8570351c5a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1465663

Change-Id: Id274e65bade2dbafdf213f282bd7343bb9425d18
2020-10-20 00:29:06 +00:00
Treehugger Robot
8570351c5a Merge "Fix documentation of heart beat sensor" am: 3bef7fe58b am: a3d54aaa88 am: 4807d99163
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1465663

Change-Id: I9197744b37e3f2a082624e28a59a0a7e36536d87
2020-10-20 00:06:15 +00:00
Treehugger Robot
4807d99163 Merge "Fix documentation of heart beat sensor" am: 3bef7fe58b am: a3d54aaa88
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1465663

Change-Id: I7ccbaa984ded806aee599066dc13eacc31244ead
2020-10-19 23:45:44 +00:00
Treehugger Robot
a3d54aaa88 Merge "Fix documentation of heart beat sensor" am: 3bef7fe58b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1465663

Change-Id: Ib6ec0365c09e32ea0bce3cb00c20d1d3d8345916
2020-10-19 23:16:43 +00:00
Arthur Ishiguro
63b75dd100 Fix documentation of heart beat sensor
Bug: 158617116
Test: None
Change-Id: Ic6b2c631e0deced70790860ed2080eb5a8089091
2020-10-19 12:35:12 -07:00
Santos Cordon
5838d68069 Integrate LogicalDisplayMapper with DisplayFoldController.
Test: Manual - ensure folding mechanism still works
Bug: 130724654
Change-Id: I5fe88e2635ed2b1731ac2f1a197b6b99e18d4ebc
2020-10-19 17:28:59 +01:00
Ilya Matyukhin
c9046a071a Merge "Move generateChallenge/revokeChallenge to ISession" 2020-10-17 00:10:47 +00:00
Santos Cordon
b254db1866 Swap default display when lid-switch is toggled.
For devices with multiple internal displays that support
a lid-switch, automatically swap which DisplayDevice is
associated with the default Logical Display.

Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/display
Bug: 130724654
Change-Id: I7280b4f49c0f11df4ecd0f2a1547c95c168265c7
2020-10-16 11:55:44 +00:00
Kevin Chyn
1a77a3bea7 Move generateChallenge/revokeChallenge to ISession
This also makes challenges user-specific, which is fine. Older
HAL interfaces can just ignore the userId parameter.

Test: Enroll, auth on existing devices
Fixes: 170517180
Fixes: 171002801
Change-Id: Ie0fc030476350bc3c35fc28643108ad4d4d3f2ce
2020-10-15 19:00:51 -07:00
Roman Kalukiewicz
24403f7ef2 Add @Nullable annotation to the parameter of Object.equals() methods.
Those annotations could be inferred by some tools (like Kotlin), but the
https://checkerframework.org/ doesn't check inherited annotations
complaining about all equals() invocations that get nullable argument.

The change was generated by running

find . -name \*.java | xargs sed -i 's/public boolean equals(Object /public boolean equals(@Nullable Object /'

in the frameworks/base directory and by automatically adding and
formatting required imports if needed. No manual edits.

Bug: 170883422
Test: Annotation change only. Should have not impact.
Exempt-From-Owner-Approval: Mechanical change not specific to any component.
Change-Id: I5eedb571c9d78862115dfdc5dae1cf2a35343580
2020-10-15 10:48:01 -07:00
TreeHugger Robot
e339e9fabe Merge "Remove unnecessary @hide from private method" 2020-10-15 01:44:50 +00:00
Kevin Chyn
2857c4d19a Remove unnecessary @hide from private method
Bug: 169459906
Test: Builds
Change-Id: I9d69ed4fa016abc69f7987b4ec51754f561ae508
2020-10-14 10:59:00 -07:00
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
Xin Li
986e6eeddf Merge ab/6749736 in stage.
Bug: 167233921
Merged-In: Iecef31f7bf10ad97b7e0075cf302ae94e248474a
Change-Id: I9e9c873bc2e05a0cfe3af0bf74725500f3f108db
2020-10-10 20:38:57 -07: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
TreeHugger Robot
bf304b8b4c Merge "Camera: Track native metadata allocations" into rvc-qpr-dev am: 2ac809e71d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12775153

Change-Id: I9fad1d424ed9c6c5b8350abc73f0a77b822c80b1
2020-10-08 01:29:23 +00: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
Emilian Peev
0f1fd8c236 Camera: Track native metadata allocations
Native camera metadata buffers can increase both in size
and count over prolonged periods of camera usage.
Register and track the native buffer allocation in the Java
VM to improve GC.

Bug: 168100424
Bug: 170243539
Test: Camera CTS
Change-Id: I7a10c2f360307a6c1afeecde24dc42184106b872
2020-10-07 18:16:35 +00: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