Commit Graph

4065 Commits

Author SHA1 Message Date
Kevin Chyn
b55a8d49e9 Merge changes from topic "biometricservice-cts"
* changes:
  Initial implementation of BiometricManager TestApis
  Add BiometricManager#getUiPackage TestApi
2020-11-16 18:50:24 +00:00
TreeHugger Robot
baf630d362 Merge changes from topic "USB-GADGET-HAL-v1.2"
* changes:
  Add methods for Usb Gadget Hal v1.2
  Support USB Gadget V1.2 HAL
2020-11-16 10:43:46 +00:00
TreeHugger Robot
886277e4d0 Merge "Fix up some camera API javadocs" 2020-11-14 06:37:43 +00:00
Kevin Chyn
3eb5c9c2d7 Initial implementation of BiometricManager TestApis
1) Finishes Face10 test implementation

2) Adds createTestSession and getSensorProperties to
   IBiometricAuthenticator. This way, BiometricService, which
   is the source of truth for all sensors is able to implement or
   forward TestApi requests as appropriate.

3) Removes a few unused parameters (callingUid, callingPid,
   callingUserId)

4) Moves proto def to a biometric proto. This is basically the
   common TestApi equivalent for getting states of _any_ sensor
   service (FingerprintService, FaceService, etc)

5) Moves AuthSession states to biometric.proto

6) Updates SysUI components to use separate positive buttons
   for better readability and testing

Bug: 171357779
Test: atest CtsBiometricsTestCases on fingerprint/face devices
Test: atest com.android.server.biometrics

Change-Id: I5d884d4a9f4afa3f947eb4587e869bacd6b2f805
2020-11-13 20:05:16 -08:00
Eino-Ville Talvala
5671dcdfb6 Fix up some camera API javadocs
Test: m offline-sdk-docs
Bug: 173204437
Change-Id: If333d6fd5023d0bc5d778437d1745dcd209ccbd9
2020-11-13 17:51:02 -08:00
Kevin Chyn
ef4cd62246 Add BiometricManager#getUiPackage TestApi
Bug: 171357779
Test: atest CtsBiometricsTestCases
Change-Id: I3847c7bf63260ebef8436704826af37e15f2da92
2020-11-13 17:50:12 -08:00
Kevin Chyn
1baf2aa687 Merge changes I77ed66b3,Iaedc26c5
* changes:
  Un-overload Biometric UI negative button
  Start UDFPS sensors only after BiometricPrompt UI is showing
2020-11-14 01:39:49 +00:00
Kevin Chyn
bf80ecae16 Start UDFPS sensors only after BiometricPrompt UI is showing
Since UDFPS sensors have a UI affordance, and the affordance is
controlled by FingerprintAuthenticationClient, start the prepared
sensor only after the BiometricPrompt dialog is done animating.

Plumbing-wise, adds:
1) Adds AuthSession.STATE_AUTH_STARTED_UI_SHOWING
2) Adds IBiometricSysuiReceiver#onDialogAnimatedIn

Since not all sensors are started immediately anymore, adds
logic in BiometricScheduler when attempting to cancel auth
for a sensor that's waiting for cookie (HAL still idle).

Fixes: 171931476
Test: atest com.android.server.biometrics
Test: atest com.android.systemui.biometrics

Change-Id: Iaedc26c51e274614ac2af6ebd98afe26263dad81
2020-11-13 14:39:03 -08:00
Aurimas Liutikas
1394a019e7 Remove legacy style metalava suppression
@SuppressLint("Doclava125") is a legacy way of suppressing
RequiresPermission check. Updating to the new style of suppression
so metalava no longer has to support the legacy mode.

sed -i "s/@SuppressLint(\"Doclava125/@SuppressLint(\"RequiresPermission/" \
core/java/android/app/admin/DevicePolicyManager.java \
core/java/android/hardware/hdmi/HdmiControlManager.java \
core/java/android/hardware/location/ContextHubManager.java \
core/java/android/hardware/usb/UsbDeviceConnection.java \
core/java/android/net/TrafficStats.java \
core/java/android/os/RecoverySystem.java \
core/java/android/os/storage/StorageManager.java \
core/java/android/service/persistentdata/PersistentDataBlockManager.java \
location/java/android/location/LocationManager.java \
media/java/android/media/AudioManager.java \
telecomm/java/android/telecom/TelecomManager.java \
telephony/java/android/telephony/CarrierConfigManager.java \
telephony/java/android/telephony/TelephonyManager.java \
wifi/java/android/net/wifi/RttManager.java \
wifi/java/android/net/wifi/WifiScanner.java

Test: make
Exempt-From-Owner-Approval: No-op change
Change-Id: I6d5df95cfca2950ea86872d2f0afc1ba828841dc
2020-11-12 18:27:15 -08:00
Aurimas Liutikas
8f8eaec801 Merge "Suppress all hidden abstract methods in constructable classes." 2020-11-12 23:37:21 +00:00
raychi
88254a2b56 Support USB Gadget V1.2 HAL
USB Gadget V1.2 HAL include:
1. support NCM function
2. add api to inquiry USB speed
3. add api to inquiry HAL version

Bug: 168282708
Test: build pass and functions are working normally
Change-Id: Idd07c55f4610740c0cf9023391125a86ba39ddee
2020-11-12 10:59:40 +08:00
TreeHugger Robot
5aa16fb5b9 Merge "Initialize AIDL biometric HALs after BiometricService is started" 2020-11-12 02:41:49 +00:00
Kevin Chyn
13161747db Initialize AIDL biometric HALs after BiometricService is started
Fixes: 172291793
Test: On device with default AIDL HAL, notice it's registered
      with BiometricService
Test: atest com.android.server.biometrics

Change-Id: Ia7283cf9473ef1d33237f2b4788d81b79ae26824
2020-11-11 16:37:57 -08:00
Aurimas Liutikas
796760c56e Suppress all hidden abstract methods in constructable classes.
Having a hidden abstract method for a class that can be extended
means that public implementors cannot implement these hidden methods
posing a risk that custom implementations will not have required
abstract methods resulting in an exception.

Bug: 151134792
Test: make update-api
Change-Id: I758d12465fabc671be19bedeeceb16885de23c87
Exempt-From-Owner-Approval: large scale suppression of existing issues,
    no-op in terms of behavior
2020-11-11 23:16:32 +00:00
Marvin Ramin
456042754f Migrate CEC version Setting to use HdmiCecConfig
Expose getter/setter for CEC version including new constants and change
internal usages to rely on HdmiCecConfig.

Bug: 170297951
Test: atest HdmiControlServiceTest

Change-Id: I6237d83078874f266e12bdd43f77ed644569180b
2020-11-11 00:29:14 +01:00
Kevin Chyn
cd0710b086 Merge "Add AuthBiometricUdfpsView for portrait" 2020-11-07 06:12:54 +00:00
Kevin Chyn
90e442a741 Add AuthBiometricUdfpsView for portrait
Adds AuthDialog.LayoutParams which should be used to hold any
layout or measurement related information.

Adds onMeasureInternal which returns AuthDialog.LayoutParams
so that subclasses can return custom layout parameters while
keeping common things like setMeasuredDimension in the
base class.

The AuthBiometricUdfpsView in portrait mode includes a
spacer whose height is calculated based on the sizes of
everything that's below the physical sensor, including
1) Text indicator area (for error messages)
2) Footer button bar
3) BiometricPrompt distance to navigation bar
4) Height of navigation bar

The indicator text is the only non-static element below the
icon. Changes it to marquee on a single line for now.

AuthBiometricView animates the icon's holder instead of the
icon itself. Otherwise, the holder would need to allow drawing
outside of its bounds.

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

Fixes: 171071087

Change-Id: I3b62f02a44f4d3cf6925d7782451596fbf8db0e1
2020-11-06 19:55:17 -08:00
Darryl Johnson
e4cbd03782 Merge changes I9ccdbd8c,Ifc24ba37
* changes:
  Add onDeviceStateChanged() callback to DeviceStateManager.
  Fix DeviceStateManagerServiceTests and add to presubmit.
2020-11-06 20:38:27 +00:00
Kevin Chyn
54c1598b59 Merge "Add sensorId to IBiometricAuthenticator methods" 2020-11-05 00:55:57 +00:00
Eugene Susla
3f1e82b12c Merge "Disregard annotation params for stale dataclass detection" 2020-11-04 23:57:15 +00:00
Kevin Chyn
d781e2066a Add sensorId to IBiometricAuthenticator methods
IBiometricAuthenticator is the interface that BiometricService
uses to do BiometricManager/BiometricPrompt-related stuff. This
change updates the implementations to pass sensorId as a parameter,
since the current design allows for FingerprintService, FaceService
etc to host multiple HALs and/or sensors.

Maintains functionality of deprecated FingerprintManager APIs.
Since getSensorProperties() requires internal or test permission,
use different binder calls for FingerprintManager invocations
vs BiometricService invocations of methods such as
isHardwareDetected and hasEnrolledFingerprints.

Moves HIDL HAL registration out of *Authenticator class and up
one layer (into AuthService), since *Authenticator code is to
be shared with AIDL HALs, which provide sensorId, strength,
and other configuration via the HAL interface.

Bug: 172291793
Test: Enroll, auth (BiometricPrompt and Lockscreen) on face and
      fingerprint devices

Change-Id: Ib2d8b792f0afde49550f320c4041ff1b1b3d5a50
2020-11-04 14:33:32 -08:00
Darryl L Johnson
73676b48be Add onDeviceStateChanged() callback to DeviceStateManager.
This change introduces the DeviceStateCallback API to DeviceStateManager
which allows processes outside system_server (as well as system_server)
to receive notifications about changes in the system's device state.

Test: atest DeviceStateManagerServiceTest
Bug: 159401801

Change-Id: I9ccdbd8c4a51858a13b0152ed39a8bf20e41e64f
2020-11-04 13:24:44 -08:00
Eugene Susla
ddb2681455 Disregard annotation params for stale dataclass detection
Annotation processor seens annotation args with constants already inlined,
making it challenging to compare to the souce-generated metadata that contains
initial expressions.

For now just ignoring args for all non-DataClass annotations to prevent false positives

Test: . frameworks/base/tests/Codegen/runTest.sh
Exempt-From-Owner-Approval: changing metadata on multiple files
Change-Id: I640816ae0f20f36b1b828bc2161f53788c4a4dae
2020-11-04 12:40:58 -08:00
Michal Olech
2c7804034b [CEC Configuration] Introduce 'int' type to the API
Change type of 'hdmi_cec_enabled' and 'system_audio_mode_muting' to integer.

Bug: 168020131
Test: atest HdmiCecConfig
Change-Id: Idc7056fbb7ff01459106bd292553f1ad2f0c4154
2020-11-04 14:15:42 +01:00
Daniel Peykov
033e0432c5 Merge "Fix possible NPE when matching accessory version" 2020-11-03 02:48:02 +00:00
Ilya Matyukhin
68cf25280c Merge "Define face/ServiceProvider and prepare for migration" 2020-11-02 22:12:48 +00:00
Kevin Chyn
8cc774101a Merge "Add FingerprintManager#hasEnrolledTemplatesForAnySensor" 2020-11-02 19:23:56 +00:00
Ilya Matyukhin
74bfec509e Define face/ServiceProvider and prepare for migration
Bug: 171335732
Test: atest com.android.server.biometrics
Test: enrolled and authenticated face on device
Change-Id: I7dc7dfd666c488b7d5ce8767d88888264cbf1f9f
2020-11-02 18:22:22 +00:00
Daniel Peykov
25dca30e2f Fix possible NPE when matching accessory version
As UsbAccessory#getVersion is nullable, a NPE can occur if the manufacturer/model match.

Bug: 172002066
Change-Id: I751a01e3d182e01e5a9dbc011b60535997f9bc15
2020-11-02 18:04:59 +00:00
Kevin Chyn
1f57d49356 Add FingerprintManager#hasEnrolledTemplatesForAnySensor
Also fixes places where "e.rethrowFromSystemServer()" wasn't actually
throwing the exception

Bug: 171420675
Test: Builds

Change-Id: I8a077a9184d6efaeb39ed66652a7f44fa9f8ddb6
2020-10-30 15:10:36 -07:00
Ilya Matyukhin
1c69bac012 Merge "Remove surface from fingerprint methods" 2020-10-29 18:59:38 +00:00
Ilya Matyukhin
ce07974e1b Remove surface from fingerprint methods
Bug: 171912347
Test: atest com.android.server.biometrics
Test: atest FingerprintServiceTest
Test: enrolled and authenticated on blueline
Change-Id: I139569b873e38515d16bbc96a563198d866236ef
2020-10-29 11:56:06 -07:00
Mathew Inwood
3af3fc63fe Add trackingBug to code used by tests.
INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH appears to be used by espresso.

Bug: 171972397
Change-Id: Ic9df340620bf6c4e2cdd0dff077548f5807fa8e3
2020-10-29 16:42:26 +00:00
Mathew Inwood
8e742f928e Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

This is a resubmit of ag/12929664 with some APIs excluded that caused
test failures; see bugs 171886397, 171888296, 171864568.

APIs excluded:
Landroid/bluetooth/le/ScanRecord;->parseFromBytes([B)Landroid/bluetooth/le/ScanRecord;
Landroid/os/Process;->myPpid()I
Landroid/os/SharedMemory;->getFd()I
Landroid/hardware/input/InputManager;->INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH:I

Bug: 170729553
Test: Treehugger
Change-Id: I8285daa8530260251ecad6f3f38f98e263629ca7
2020-10-29 11:51:12 +00:00
Kevin Chyn
6a7992b9dd Merge "Add sensorLocationX/Y and sensorRadius to SensorProps" 2020-10-29 00:11:59 +00:00
Hongwei Wang
286c33a5c5 Merge "Revert "Add maxTargetSdk restriction to unused APIs."" 2020-10-28 23:58:21 +00:00
Hongwei Wang
050275cd83 Revert "Add maxTargetSdk restriction to unused APIs."
This reverts commit 72f07d6a8a.

Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?testMethod=testAppZygotePreload&testClass=android.app.cts.ServiceTest&atpConfigName=suite%2Ftest-mapping-presubmit-retry_cloud-tf&testModule=CtsAppTestCases&fkbb=6936597&lkbb=6936969&lkgb=6936551&testResults=true&branch=git_master&target=cf_x86_phone-userdebug>, bug b/171886397

Bug: 171886397
Change-Id: Ibe0f0430a3451477c1ee8ef56a596e91ea1e7672
2020-10-28 20:16:22 +00:00
Mathew Inwood
ee5d369323 Merge "Add maxTargetSdk restriction to unused APIs." 2020-10-28 09:39:20 +00:00
Sean Stout
54755995ac Merge "Introduce DisplayGroup" 2020-10-28 04:30:04 +00:00
Kevin Chyn
cf22a0bcdc Add sensorLocationX/Y and sensorRadius to SensorProps
Removes the above properties from the Udfps Styleable, but
ensures that the properties are passed in after inflation and
before attachment.

Bug: 171071087
Test: atest com.android.systemui.biometrics
Test: com.android.server.biometrics
Change-Id: I6ff932772c8e2be22210c16b58e603f8a363f247
2020-10-27 20:43:24 -07:00
Jayant Chowdhary
16695b9a47 Merge "Fix minor typos in CameraCharacteristics documentation." 2020-10-28 01:44:17 +00:00
Sean Stout
a9f63583d0 Introduce DisplayGroup
A DisplayGroup is a collection of LogicalDisplays which are tied
together for certain behaviors and operations. This CL simply introduces
the class, however in the future it will be used for multi-display power
state work.

Bug: 138328918
Test: manual - build and deploy
Change-Id: I3d736b2758a3363678afc962872fcbe7f4e96806
2020-10-27 18:38:55 -07:00
Mathew Inwood
72f07d6a8a Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

Bug: 170729553
Test: Treehugger
Change-Id: I4c8fd0006f950de9955242e93968fb0996ceb372
2020-10-27 15:46:07 +00:00
Jayant Chowdhary
222f878c0a Fix minor typos in CameraCharacteristics documentation.
Test: builds

Change-Id: I76dcdecbbe27be44f6e8a1a8e11d9399c5e0d32a
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2020-10-26 15:56:22 -07:00
TreeHugger Robot
2c3b30b430 Merge "Camera: Add CaptureResult#getCameraId()" 2020-10-26 22:35:17 +00:00
Eino-Ville Talvala
575f3d7e47 Camera: Add CaptureResult#getCameraId()
To simplify tracking of capture results from multi-camera clusters,
add a method to get the camera ID that produced the capture result.

Test: atest CtsCameraTestCases
Bug: 171709658
Change-Id: I1109fd000ce9fbb57bb5b7ae281d0f42a5218cf7
2020-10-26 13:13:19 -07:00
Kevin Chyn
688d81ebc9 Merge changes from topics "fingerprintmanager-cts", "fp-aidl-cts"
* changes:
  Update IFingerprint providers for CTS
  Initial FingerprintManager E2E CTS
2020-10-26 17:42:00 +00:00
Kevin Chyn
a524fc37db Initial FingerprintManager E2E CTS
Bug: 170518383
Test: atest FingerprintManagerTest

Change-Id: Iea5b281a6a799491c25030ad87f48225a1cfb387
2020-10-23 12:40:15 -07:00
Bernardo Rufino
3d5a183897 Merge "Block untrusted touches in permissive mode" 2020-10-23 19:40:01 +00:00
Bernardo Rufino
bf4e8931bc Block untrusted touches in permissive mode
Don't block the touch but show a toast and log a message. After having
fixed b/166617888, we should start getting dogfood feedback.

Test: Simulate untrusted touch and verify toast
Bug: 158002302
Change-Id: I7de1bfc2bb4b7d7ce018790b33b1c162f3ebe82a
2020-10-23 07:38:42 +00:00