Commit Graph

2929 Commits

Author SHA1 Message Date
Kevin Chyn
3d9b0fc963 Merge changes from topic "biometric-refactor"
* changes:
  3/n: For passive modalities, add plumbing for "try again"
  2/n: Multi-modal support for BiometricPrompt
  1/n: Move BiometricDialog management to BiometricService
2018-12-01 05:04:02 +00:00
Kevin Chyn
23289ef7b6 3/n: For passive modalities, add plumbing for "try again"
When "try again" is showing, authentication is canceled internally.
BiometricService caches the client's info so that authentication can
be restarted when "try again" is pressed. Because authentication
is not running when "try again" is showing, BiometricService also needs
to have a TaskStackListener so that BP can be dismissed and an error can
be sent to the client when the app loses focus.

IBiometricServiceReceiver has been split into two. One for BiometricPrompt
to receive messages from BiometricService, and another for BiometricService
to receive messages from SystemUI/<Biometric>Services.

When we get locked out, don't send the last onAuthenticationFailed
to the client, since "Authentication failed" will be shown briefly
and be replaced by "Device locked out" which is janky

Bug: 111461540

Test: Tested with requireConfirmation enabled/disabled
Test: Tested onConfigurationChange corner cases, e.g. when "try again"
      or "confirm" buttons are showing, rotate the device. Buttons
      persist correctly and don't appear when unexpected
Test: Tested task stack corner cases, e.g. when "try again" is showing,
      press home button. BP dismisses and client receives ERROR_CANCELED
Test: BiometricPromptDemo receives all callbacks

Change-Id: I62126708ce8db8b358c666a07aa7c39607642c9d
2018-11-30 11:34:35 -08:00
TreeHugger Robot
c4a8c6d7c2 Merge "Add physical port to DisplayViewport" 2018-11-30 01:49:43 +00:00
Siarhei Vishniakou
15a412d2c2 Add physical port to DisplayViewport
DisplayViewport now contains the information about the physical port
that the corresponding display is connected to (for example, HDMI1,
HDMI2, etc).
This information is needed in order to determine which input device is
associated with which display.

Add a new config file to vendor directory that will contain the actual
associations.

Bug: 116239493
Test: atest ConfigurationProcessorTest
Change-Id: I679203747753803e9635a4eaf74287ce7e69dc3f
2018-11-29 15:34:48 +08:00
Vishnu Nair
e86bd98a8b WM: Removes setSize from buffer-less surfaces
- Make a better distinction between surface bounds and buffer size by renaming setSize to
  setBufferSize and removing setSize for all buffer-less surfaces.
- Adds an error check in SurfaceControl to ensure buffer size is only set for buffer-less surfaces.
- Updates color fade surface to use passed in transaction object.

Bug:114413815
Test: go/wm-smoke
Test: atest FrameworksServicesTests:DimmerTests
Test: atest FrameworksServicesTests:SurfaceAnimatorTest
Change-Id: I88bd1452d6b3b3009e73e26986027d6a5a9efebc
2018-11-28 14:24:03 -08:00
Kevin Chyn
87f257a9e5 2/n: Multi-modal support for BiometricPrompt
Part 2 of decoupling BiometricDialog lifecycle from AuthenticationClient
lifecycle. This change introduces cookies which are used to keep track
of clients within BiometricService and <Biometric>Services. This allows

1) Much easier support for BiometricPrompt to authenticate using more than
   one modality
2) Much easier to support "continue" button on BiometricPrompt for passive
   modalities, which should be pressed before authentication continues

Bug: 111461540

Test: BiometricPromptDemo works, error messages are propagated to clients
Test: Keyguard/Settings smoke test
Test: ConfirmDeviceCredentials works

Change-Id: Iaa246488fb027c3397a3191841524b389145b281
2018-11-28 13:01:29 -08:00
Kevin Chyn
e92cdae277 1/n: Move BiometricDialog management to BiometricService
The BiometricDialog management was done in AuthenticationClient, but
this is not great for the following reasons
1) The dialog lifecycle should not be 1:1 tied to the client monitor,
   since this restricts flexibility
2) Devices with multiple biometrics implemented on BiometricDialog
   will require extra work. Moving the dialog management up one layer
   should solve this limitation

BiometricService now sends both its own receiver and the client's receiver
to the appropriate <Biometric>Service. When the client is actually started
by the <Biometric>Service, it will forward the client's (BiometricPrompt's)
receiver to BiometricService. Lifecycle management is currently still in
<Biometric>Service since the platform still uses <Biometric>Service
directly. AuthenticationClient for BP is now started with the wrapper
receiver, which allows BiometricService to handle messages before deciding
if it should forward the message to the client.

Moving lifecycle management to BiometricService is currently not a great
idea since framework doesn't always go through BiometricService.

Also merged IBiometricPromptReceiver with IBiometricServiceReceiver

Bug: 111461540

Test: Negative button works (error received by demo app)
Test: Cancelling via back or tapping gray area works (error received
      by demo app), and hardware is no longer authenticating
Test: Dismissing BP via negative button or gray area returns only a single
      error and is not followed by ERROR_CANCELED (as expected)
Test: Error messages are delayed when BP is showing, not delayed
      when BP is not showing (pre-auth check errors e.g. no hardware)
Test: Lockout works
Test: Lockout counter resets upon successful auth
Test: Keys are unlocked properly for both implicit and explicit modes

TODO: Figure out multi-modal BiometricService / <Biometric>Service
      synchronization. Likely we keep the bundle in BiometricService
      and send random numbers (identifier) to <Biometric>Service. When
      each <Biometric>Service is ready, it should return the number. Once
      BiometricService receives all identifiers, it can then notify
      all <Biometric>Service to start authenticating.

Change-Id: I2b6fa57ed3c3cbccc7b0be30279f80fa46a8e917
2018-11-27 16:26:19 -08:00
Arthur Ishiguro
edf1e0fc13 Expose Context Hub Service PendingIntent APIs
Exposes APIs related to new PendingIntent-based APIs of
ContextHubManager, allowing the creation of persistent
ContextHubClients.

Bug: 117612105
Test: Compile only
Change-Id: Iaddbc4685285ffa8186b867def21fbbff370756c
2018-11-27 13:11:00 -08:00
TreeHugger Robot
4c9e89671b Merge "Reorders arguments in Context Hub Service methods" 2018-11-19 19:12:36 +00:00
Arthur Ishiguro
793d3d1801 Reorders arguments in Context Hub Service methods
No functional change, just reordering things in internal methods to be
consistent with the API definition. Also fixes stale javadoc.

Bug: 117612105
Test: Compile only
Change-Id: I455d3d5c8f1d5077dbacfa96ad1c71da27559b8e
2018-11-19 09:31:14 -08:00
Arthur Ishiguro
1c37adbb8e Updates ContextHubIntentEvent documentation
Updates the javadocs to the recent changes in the API.

Bug: 117612105
Test: None
Change-Id: I50c673353ef3c636d1cf17aad65b00ba44267472
2018-11-16 14:43:15 -08:00
TreeHugger Robot
9bab49758a Merge "Implements equals methods in Context Hub classes" 2018-11-16 22:08:41 +00:00
Arthur Ishiguro
1eef69f9cc Implements equals methods in Context Hub classes
Bug: 117612105
Test: Compile, sanity check
Change-Id: Icea345dc194c72eabc1c27b23fa6235544eeaca4
2018-11-16 10:31:11 -08:00
TreeHugger Robot
2938bf7f77 Merge changes I6a6cffde,I5789305a,I2c2e15be,Ic1ef7c77,Ic62aa869
* changes:
  Avoid automatically closing of persistent ContextHubClients
  Implements updated PendingIntent APIs
  Refactors ContextHubClientManager/Broker classes
  Only send messages to CHRE if client is registered
  Updates PendingIntent-based service APIs
2018-11-16 18:19:30 +00:00
Arthur Ishiguro
842ca2d8b5 Avoid automatically closing of persistent ContextHubClients
Previously, we automatically closed the connection when the
resource was GC'd (process died), but for PendingIntent clients
we need to preserve the client endpoint.

Bug: 117612105
Test: Compile only
Change-Id: I6a6cffdeb980073b4ae5ad51c0d91df422e86fc4
2018-11-16 08:21:31 -08:00
Arthur Ishiguro
82ed3afede Implements updated PendingIntent APIs
Bug: 117612105
Test: Compile and run, verify API works as intended
Change-Id: I5789305a50739494f0c069faa8236b49bccae7b5
2018-11-16 08:21:31 -08:00
Arthur Ishiguro
1bb34a8640 Updates PendingIntent-based service APIs
Modifies the APIs such that ContextHubClient can be generated by
either the ContextHubClientCallback or the PendingIntent (exclusive or),
for simplicity. ContextHubClients can be regenerated through the
createClient() API, while maintaining the original host endpoint ID.

Also removes the API implementation based on the original design.

Bug: 117612105
Test: Compile only
Change-Id: Ic62aa8695eee3d68722163934de76e77c1f0bc0c
2018-11-16 08:21:28 -08:00
TreeHugger Robot
c1d607e90d Merge "Add ColorDisplayManager" 2018-11-15 00:40:26 +00:00
Kevin Chyn
067085a140 Add protected method to authenticate using BP for a specific user
This is analogous to one of the FingerprintManager internal APIs. A
signature permission is required if a user wants to authenticate
using a different userId

Bug: 119296586

Test: BiometricPromptDemo still works for primary and work profile

Change-Id: I16383a588833ccf673d62ed1fc580c412beb4929
2018-11-14 12:53:36 -08:00
Shuzhen Wang
a8d36036f2 Camera: Enhance support for monochrome camera
- Add new Color Filter Array enum.
- Clarify doc for Bayer pattern related metadata.
- Add DngCreator support for monochrome camera raw.

Test: Camera CTS
Test: Capture a monochrome DNG image and inspect with LightRoom
Bug: 70216652
Change-Id: I329f224e3763dd5c777815a3cbb9dd7bd198c038
2018-11-12 16:31:39 -08:00
Michael Dooley
4d75ccd328 Merge "Converting sound trigger v2.2 getModelState to be asynchronous" 2018-11-12 19:27:39 +00:00
Chilun
8753ad366b Implement new API of external display settings (1/2)
- Using DisplaySettings class for storing the display settings.
- Define flags in WindowManager.
- Have direct IWindowManager APIs to set and change display settings at
  runtime.
- Mark TODO to original usage of the flags.
- Add test case of DisplaySettings.
- Expose some APIs for CTS usage.

Bug: 114338689
Test: atest DisplayWindowSettingsTests
Test: atest CtsApacheHttpLegacy27ApiSignatureTestCases
Change-Id: I64ed14866d45cd5817fc3c895b6110c79c37b0ad
2018-11-10 16:49:56 +08:00
mike dooley
b2ab04aefd Converting sound trigger v2.2 getModelState to be asynchronous
Test: built android with checkbuild flag

Change-Id: I4c6f2388c93b6e577113fc7f2cd19242628ee50f
Bug-Id: 70206501
2018-11-09 08:36:15 +01:00
Kevin Chyn
a85b4a2d29 Merge "Return correct error when HW there is no biometric hardware" 2018-11-09 04:42:35 +00:00
TreeHugger Robot
74514bcbcc Merge "Reject PendingIntents owned by another client" 2018-11-08 03:15:58 +00:00
Kweku Adams
22b63148b1 Merge "Clarifying some battery saver policy variables." 2018-11-07 23:25:24 +00:00
Kweku Adams
7e5c7018d3 Clarifying some battery saver policy variables.
The flags for the network firewall, screen brightness adjustment, and
data saver are essentially to decide whether to turn on these features
or not, so having them be *_disabled is confusing for someone to read.
These flags differ from others such as animation_disabled or
vibration_disabled, which are actually turning off features instead of
enabling them. I'm updating the internal variable names and adding
documentation to make the behavior clearer. I haven't changed the flag
names themselves since that could make things a little more difficult if
someone wants to set flags later on.

Bug: 117126975
Test: atest com.android.server.power.BatterySaverPolicyTest
Change-Id: If3fa220f9f62117eac39b54bf771a9cc17bcc911
2018-11-07 15:21:51 -08:00
Shuzhen Wang
89d277a982 Merge "Camera: Add support for recommended stream configurations" 2018-11-07 22:54:02 +00:00
Arthur Ishiguro
72c676e343 Reject PendingIntents owned by another client
Removes ambiguity when regenerating a ContextHubClient.

Bug: 117612105
Test: Compile only
Change-Id: Ie105366d8b46b69c332859d9b096f6e6c05ca271
2018-11-07 13:40:41 -08:00
Marcin Oczeretko
ebeb8b8afd Fix javadocs in CameraDevice
Test: n/a
Change-Id: Ib48760c377f9f12ece99c555ef1556d1063a2686
2018-11-07 14:48:31 +00:00
Shuzhen Wang
68e8199c64 Merge "Camera: Unhide and update Y8 format spec" 2018-11-07 05:54:39 +00:00
Kevin Chyn
e739daf2e8 Return correct error when HW there is no biometric hardware
Devices that have no biometric hardware should still get the
BIOMETRIC_ERROR_HW_NOT_PRESENT error. Currently they get the
BIOMETRIC_ERROR_HW_UNAVAILABLE error which is slightly wrong.

Fixes: 119109074

Test: Builds
Change-Id: I32134a35fd2844bc6a4a64ded9695ae596496ef2
2018-11-06 20:08:42 -08:00
Christine Franks
ea7d71b3aa Add ColorDisplayManager
Add ColorDisplayManager class, and shift some functionality from
ColorDisplayController

Bug: 111215474
Test: atest FrameworksServicesTest:ColorDisplayServiceTest
Change-Id: Ic38a12e1e0b0619fdad42a89b7ac3e878c8128b2
2018-11-06 21:31:15 +00:00
Kevin Chyn
8d45688b6d Merge "Add placeholders for IrisManager/Service" 2018-11-06 06:29:22 +00:00
Arthur Ishiguro
3685d31475 Merge changes I9f2d4e1b,Iad9ada1f,Ic8d269b4
* changes:
  Implements PendingIntent based createClient API
  Adds bindClient method to service AIDL
  Close unregistered clients with no PendingIntent
2018-11-06 03:34:31 +00:00
Kevin Chyn
51676d293a Add placeholders for IrisManager/Service
With the system services in place, we can add SELinux policies

Bug: 116530289

Test: Builds
Change-Id: I0fd0dfbbbf258eb4a0ef9019247baaf323578959
2018-11-05 18:57:15 -08:00
TreeHugger Robot
16e9f5993d Merge "Removes ContextHubBroadcastReceiver" 2018-11-06 01:35:40 +00:00
Arthur Ishiguro
6cc24a5df3 Implements PendingIntent based createClient API
Bug: 117612105
Test: Compile and flash, verify API user can regenerate a
      ContextHubClient
Change-Id: I9f2d4e1b4389e32b0828d494d74151ec56fa9d57
2018-11-02 11:29:23 -07:00
Arthur Ishiguro
d3464c7c93 Adds bindClient method to service AIDL
Will be used to recreate client with a PendingIntent.

Bug: 117612105
Test: Compile only
Change-Id: Iad9ada1fe113275790336663112f276327d4f558
2018-11-02 11:29:21 -07:00
Arthur Ishiguro
41f4e64280 Removes ContextHubBroadcastReceiver
Dynamically registered BroadcastReceivers are only valid through
the lifecycle of a process, so clients should use static
BroadcastReceivers.

Bug: 117612105
Test: None
Change-Id: Id1a13b0f54aa138685bf8cb57ffe9f176d55e6e0
2018-11-02 10:28:24 -07:00
TreeHugger Robot
a17b785a64 Merge "Performs null checks in NanoApp class" 2018-11-02 03:43:02 +00:00
Kenny Root
8b0a22dbad Merge changes from topic "usb-adb-separation"
* changes:
  Update USB tests for ADB split
  Move AdbDebuggingManager to AdbService
  AdbService: move source of truth for enabled
  Add empty AdbHandler
  Add systemReady call for AdbService
  Add function to query ADB state
  Register USB as an ADB transport type
  Add ADB transport skeleton
  Add empty AdbManagerInternal for system server
  Add empty AdbService to SystemServer
  Move ADB debugging manager to core
  Rename to AdbDebuggingManager
  Move UsbDebuggingManager to new package
2018-11-02 00:43:05 +00:00
Arthur Ishiguro
926c73479b Performs null checks in NanoApp class
Bug: 37274672
Test: Compile only
Change-Id: I5a82edd2f7a99a05c26c72b09872e964dbffd935
2018-11-01 13:14:17 -07:00
Arthur Ishiguro
a95fe31562 Adds ContextHubIntentEvent class
Helper class to parse Intent events.

Bug: 117612105
Test: Compile and flash, verify Intent events can be parsed
      using the class
Change-Id: I1267a1ce0cbbfd56ff9abb059ccc0117f060b7ff
2018-11-01 10:09:45 -07:00
Emilian Peev
2776ca3f4e Camera: Add support for recommended stream configurations
A camera device must be able to suggest power and performance
efficient stream configurations depending on the client
use case.
The new configurations should only be a strict
subset of the available exhaustive list.
Clients must be able to query the additional information using
familiar API which will not require extensive changes on their
side.

Bug: 64029608
Test: Camera CTS
Change-Id: Ib00394669d40e389426f5ba2f4c06061feaea340
2018-11-01 14:14:43 +00:00
TreeHugger Robot
2406e8ffc2 Merge changes Ib84292ca,I3411cb15,I60dfac31
* changes:
  Sends PendingIntent events
  Implements register/unregisterIntent methods
  Modifies concurrency handling in ContextHubClientBroker
2018-10-31 16:42:49 +00:00
Kenny Root
a5964c08bc Move AdbDebuggingManager to AdbService
Also remove the "Usb" from the AIDL function since it's not really
related to USB.

Test: make
Bug: 63820489
Change-Id: Ibf23964665a115a5bc835820dcff98aaf7ba610f
2018-10-31 16:11:02 +09:00
Arthur Ishiguro
daeed3cb19 Modifies concurrency handling in ContextHubClientBroker
With PendingIntent, there will be multiple states in the class, so it
will be simpler to mark methods synchronized on the object.

Bug: 117612105
Test: Compile only
Change-Id: I60dfac3113508b9e251e33fd3c1c8f60378017f4
2018-10-29 09:28:32 -07:00
Shuzhen Wang
ec5e8d25f0 Camera: Unhide and update Y8 format spec
- Unhide Y8 format as part of MONOCHROME camera support.
- Specify required stream combination for Y8 format.

Test: Camera CTS test
Bug: 70216652
Change-Id: Iab28b7ee3f2d5ec534a517079f14e0ed648ae556
2018-10-29 07:44:13 -07:00
Kevin Chyn
1a3550c1e2 Merge "Update BiometricManager constants" 2018-10-27 06:49:02 +00:00