Commit Graph

88 Commits

Author SHA1 Message Date
Jamie Garside
aafdda54a1 Update the bouncer to be able to move to either side of a wide screen.
This reverts commit 0f53fd20d5.

The previous version of this didn't account for padding in onMeasure
(I'd taken this out when copying from FrameLayout, as I didn't think we
used padding), which is applied based on window insets. Tests also added
to check this case.

Forwards we go again :)

Bug: 170858298
Test: Included. Manually tested on phone, with feature enabled too; PIN/Pattern/Password all render correctly.
Change-Id: I7b1f35a185214ffdd2187f1c059f77535197a215
2021-02-26 12:53:24 +00:00
Jamie Garside
0f53fd20d5 Revert "Update the bouncer to be able to move to either side of a wide screen."
This reverts commit 868e770b82.

Reason for revert: Breaks password entry - b/180993584

Change-Id: I9a1771b795c90b1cfe6c2457d390ac53235c6c94
2021-02-23 19:24:29 +00:00
Jamie Garside
868e770b82 Update the bouncer to be able to move to either side of a wide screen.
I'd like to test other things (like tap makes the IME move), but to do
that means replacing the mock with a proper fake. That can come later,
but this at least tests that the flagging works correctly.

The changes between this and
commit cae34b8e22 is the bouncer height is
now measured using wrap_content, so the placement can be controlled
properly by the outer View (as the position of the bouncer changes
depending on the size of the screen).

This reverts commit cae34b8e22.

Test: Included
Bug: 170858298
Change-Id: I18428a6df9abf0e8e37c1c179be6843e4eee793c
2021-02-22 15:35:56 +00:00
Daniel Chapin
cae34b8e22 Revert "Update the bouncer to be able to move to either side of a wide screen."
This reverts commit 6c5bfcb40f.

Reason for revert: Bug: 179493042

Test: Manually verified
Change-Id: Iebcaa9e92a2f83419c07936aa5aa3c81970da34a
2021-02-08 11:36:04 +00:00
Jamie Garside
a1a537ad77 Fix test failure in MixedDeviceOwnerTest#testSecondaryLockscreen.
We assumed that the KeyguardSecurityContainer could only have one child;
that assumption was incorrect. Updated code to (1) explicitly search for
KeyguardSecurityViewFlipper when it is required, and (2) measure
multiple children in onMeasure.

Test: Verified with atest
CtsDevicePolicyManagerTestCases: com.android.cts.devicepolicy.MixedDeviceOwnerTest#testSecondaryLockscreen
Bug: 179313275
Change-Id: Iaec57d70c33149e0a2a6867efd9c9ba09d9d6946
2021-02-04 11:02:36 +00:00
Jamie Garside
6c5bfcb40f Update the bouncer to be able to move to either side of a wide screen.
This is currently enabled by settings
persist.sysui.keyguard.one_handed_keyguard_enabled to true. If enabled,
this will cause "one-handed able" security modes to be measured with
half of the width of the SecurityViewContainer. Tapping either side of
the screen will then move the keyguard by changing the margins.

There's some flaws here, but it's a start. There's a frame of the
bouncer being on the wrong side of the screen if the keyguard is on the
right, and it doesn't respond to opening/closing the device properly yet.

Bug: b/170858298
Change-Id: Ib997b9b3cb4ca7a069c805c7a8f3a79434eebd4c
Test: Incoming :)
2021-02-03 12:29:00 +00:00
Yuncheol Heo
b373cd0103 Fix NPE in InteractionJankMonitor.
- KeyguardSecurityViewFlipper.getSecurityView() can return null.

Bug: 178711695
Test: atest CarDevicePolicyManagerTest
Change-Id: I7b1759437f00a901195c6c2a9028b7ca5f1c0b07
2021-02-01 13:18:57 -08:00
Ahan Wu
d515f02c80 Add jank instrumentation logic in keyguard
Add instrument logic in keyguard for jank.

Bug: 169221091
Bug: 169220724
Test: Manually
Change-Id: I18e36bd7ae10693ce974c1bb54b384a29d890ef7
2021-01-15 16:09:07 +08:00
Matt Pietal
3bbc280d70 Keyguard: Fix missing IME, and apply better animations
Password bouncer: animate the text field alpha and y positioning along
with the IME reveal. Also fix the ordering of focus events to ensure
the soft keyboard appears.

Fixes: 174020436
Fixes: 175243820
Test: SystemUITests
Change-Id: I62898870f57da1cd5b3da6bc4a2cfb23fe95097f
2021-01-05 08:51:31 -05:00
Dave Mankoff
9a80cc2ec8 Revert^2 "9/N Clean Up Keyguard Class Structure"
b00c929394

Change-Id: I42d17262a789d2eb106a924b442a9d3debcc35e4
2020-09-24 11:04:52 -04:00
Dave Mankoff
9408c9089a Revert^2 "5/N Add KeyguardSecurityViewFlipperController."
612c5d78c4

Change-Id: Ic51f3c2dd7d49832927393df9831d956bfa45763
2020-09-24 11:04:51 -04:00
Dave Mankoff
cf2591fa36 Revert^2 "4/N Setup Controller fo KeyguardSecurityContainer."
0d6a9012a7

Change-Id: I881bbcdc63fcbafa8966064cccb7ce1edc710062
2020-09-24 11:04:51 -04:00
Dave Mankoff
0d6a9012a7 Revert "4/N Setup Controller fo KeyguardSecurityContainer."
Revert submission 12585643-b166448040-keyguard-message-area

Reason for revert: http://b/169081305 & http://b/169020145
Reverted Changes:
I6fa05012c:4/N Setup Controller fo KeyguardSecurityContainer....
Iecf265744:5/N Add KeyguardSecurityViewFlipperController.
I90ab99b2f:6/N Add Controller for KeyguardPatternView
I4b74eddd1:7/N controllers for remaining Keyguard Password Vi...
I805286374:8/N Remove View Injection from KeyguardMessageArea...
I362755980:9/N Clean Up Keyguard Class Structure

Change-Id: I7683b2234b601032ee606fbaabd474c5e2f6e989
Fixes: 169081305
Fixes: 169020145
2020-09-22 13:26:48 +00:00
Dave Mankoff
612c5d78c4 Revert "5/N Add KeyguardSecurityViewFlipperController."
Revert submission 12585643-b166448040-keyguard-message-area

Reason for revert: http://b/169081305 & http://b/169020145
Reverted Changes:
I6fa05012c:4/N Setup Controller fo KeyguardSecurityContainer....
Iecf265744:5/N Add KeyguardSecurityViewFlipperController.
I90ab99b2f:6/N Add Controller for KeyguardPatternView
I4b74eddd1:7/N controllers for remaining Keyguard Password Vi...
I805286374:8/N Remove View Injection from KeyguardMessageArea...
I362755980:9/N Clean Up Keyguard Class Structure

Change-Id: I5cbe04c0cfb1c081fbf2e9958cb22dca3e4d80ad
Fixes: 169081305
Fixes: 169020145
2020-09-22 13:26:39 +00:00
Dave Mankoff
b00c929394 Revert "9/N Clean Up Keyguard Class Structure"
Revert submission 12585643-b166448040-keyguard-message-area

Reason for revert: http://b/169081305 & http://b/169020145
Reverted Changes:
I6fa05012c:4/N Setup Controller fo KeyguardSecurityContainer....
Iecf265744:5/N Add KeyguardSecurityViewFlipperController.
I90ab99b2f:6/N Add Controller for KeyguardPatternView
I4b74eddd1:7/N controllers for remaining Keyguard Password Vi...
I805286374:8/N Remove View Injection from KeyguardMessageArea...
I362755980:9/N Clean Up Keyguard Class Structure

Change-Id: Ic62f199a51a15d8384450b8f181f3c5a0b988d7f
Fixes: 169081305
Fixes: 169020145
2020-09-22 13:24:51 +00:00
Tiger Huang
a7c40017ff Merge "Remove the legacy insets mode" 2020-09-19 17:07:56 +00:00
Tiger Huang
6ef3b6e137 Remove the legacy insets mode
This CL also refines the color view logic which checks the system bar
appearance instead of system UI flags.

Bug: 149813814
Test: atest InsetsAnimationControlImplTest InsetsControllerTest
            InsetsStateTest InsetsPolicyTest InsetsStateControllerTest
Change-Id: I26d93b3508c84e436133085bd316ade54d00d76a
2020-09-18 15:13:12 +08:00
Dave Mankoff
4a3d800016 9/N Clean Up Keyguard Class Structure
KeyguardInputView no longer implements KeyguardSecurityView.

This cl seeks to clean up some of the lingering vestiges from this
large chain of refactors.

I have manually tested none, swipe, pattern, pin, and password views
for successfully unlocking, as well as multiple failed attempts
resulting in temporary lock outs.

Fixes: 166448040
Test: atest SystemUITests && manual
Change-Id: I36275598001184e774677cf2dbb16dec8dc7ab5b
2020-09-16 16:27:56 -04:00
Dave Mankoff
2f557d8922 5/N Add KeyguardSecurityViewFlipperController.
Adds a Controller for KeyguardSecurityViewFlipper.

Test: atest SystemUITests && manual
Change-Id: Iecf265744a385efb7a9ab32a29b90c22054a4c84
2020-09-16 16:24:11 -04:00
Dave Mankoff
8f75cf9944 4/N Setup Controller fo KeyguardSecurityContainer.
Move the guts of KeyguardSecurityContainer into
KeyguardSecurityContainerController. This removes a lot of
Dependency#get calls, and is another step towards simplifying our
view inflation process.

CustomViews that previously implemented KeyguardSecurityView now
all extend KeyguardInputView, allowing them to be simultaneously
treated as one while also being recognized as a View (the interface
required a lot of casting back and forth to a View).

LockscreenUtil is made a Singleton in this CL.

Bug: 166448040
Test: atest SystemUITests && manual
Change-Id: I6fa05012c55f5e003ab551d2f8360891a62fa2a7
2020-09-16 16:24:11 -04:00
Dave Mankoff
4f0d816350 Setup KeyguardBouncerComponent.
This removes the factory method from SystemUIFactory that built the
KeyguardBouncer and moves it into its own subcomponent. This is the
first step in removing view injection from the last keygard related
views.

Bug: 166448040
Test: manual
Change-Id: I4a682f324dcee6d506b0f286f8f61682f9777859
2020-08-26 13:53:42 -04:00
Dave Mankoff
ecfbd9b3aa 6/N Move everything into SysUIComponent.
It is far easier to move _everything_ into SysUIComponent, and then
selectively promote things back to GlobalScope and/or WMScope than
it is to try to do it one at a time. With this change, though lots
of files are touched, very little actually changes structurally.

After this change goes in, folks should stop using @Singleton quite
so freely. Most things should live in @SysuiSingleton. @Singleton
is due to quickly be replaced by @GlobalScope.

Bug: 162923491
Test: atest SystemUITests && manual
Change-Id: Idc31d3d83b030581fb1fa869f7fafc4f2d3a8828
2020-08-16 16:08:25 -04:00
Dave Mankoff
4f54821594 4/N Simplify InjectionInflationController.
This class used unnecessarily complex subcomponent and module
initialization.

I am simplifyhing this class in anticipation of moving a great deal
of code from the GlobalRootComponent into the SysUIRootComponent.

Bug: 162923491
Test: manual
Change-Id: I5e8808d43742925af5bdedf1bbcf6193e1527065
2020-08-11 10:06:44 -04:00
Jorim Jaggi
b0c0155a36 Fix disappear animation
Make sure IME animation aligns with overall timing of disappear
animation. Otherwise, there will be jank. For that, we just do
1/4 of the height and fade it out as well.

Bug: 156367695
Change-Id: I9b35cf493895b7206bf12208a531e35dbefff1fc
2020-06-15 23:35:55 +02:00
Lucas Dupin
6f0ad152be Smoothly hide the keyboard
Fixes: 155980369
Test: manual
Test: atest KeyguardSecurityContainerTest
Change-Id: I678d9a04fdea6895c24cd4bdb77348cdeb2daced
2020-05-08 16:49:51 -07:00
thiruram
3051873947 Migrates Bouncer dismiss events from Tron to WW.
Test: Manual(lunch coral-userdebug && make -j100)
Bug: 147509048

Change-Id: I27139b28c32281d2cd0ec04c94cf00d8360acbd1
2020-04-29 10:29:07 -07:00
TreeHugger Robot
4601299db7 Merge "Fix issue where keyboard would not be dismissed" into rvc-dev 2020-04-20 19:22:54 +00:00
Lucas Dupin
8d54074d26 Fix issue where keyboard would not be dismissed
When swiping down from the top of the screen to dismiss the bouncer,
the input field should hide the keyboard, otherwise it would get stuck
on the lock screen.

Test: manual
Test: atest KeyguardHostViewTest
Test: atest KeyguardBouncerTest
Fixes: 154245193
Fixes: 152882608
Change-Id: I99ee2cff85df1ab0b6544e9b5b472e105fca7b72
2020-04-20 10:46:46 -07:00
Lucas Dupin
9c443f173a Animate ViewFlipper when keyboard becomes visible
Test: visual
Fixes: 145243318
Change-Id: I87fbb66f5d25ed1bec7ad7f3718e78858d7c6c99
2020-04-16 18:07:47 -07:00
kwaky
4ed2e207c5 Implement AAOS-specific KeyguardViewController and decouple keyguard from statusbar.
Bug: 150162295
Bug: 150164054
Test: Manual. Unit Tests Pending.
Change-Id: I66586e15d114eb6da55254f778511bde4fce3154
2020-04-10 15:22:51 -07:00
Yvonne Jiang
6d34642533 Fix secondary lock screen implementation such that DevicePolicyKeyguardService calls are made on the main (UI) thread.
For implementations of DevicePolicyKeyguardService to provide a SurfacePackage via SurfaceControlViewHost, they must be running on the UI thread.
Additionally, fix dismissal logic to bypass re-checking the secondary lockscreen, and add defensive null checks.

Bug: 136085151
Bug: 151365616
Test: atest AdminSecondaryLockScreenControllerTest
Test: atest KeyguardUpdateMonitorTest
Change-Id: Ibcd7090f50831cddbf952914adf020015750afd8
2020-04-08 05:31:20 -07:00
Lucas Dupin
20f5049835 Revert "Fix bouncer race condition"
This reverts commit 8833d1eb4c.

Reason for revert: b/151050221
Fixes: 151050221
Change-Id: I5ad75dae0471a4e87b46e5fc2f95f38bb010c4c0
2020-03-13 04:42:49 +00:00
Lucas Dupin
8833d1eb4c Fix bouncer race condition
Bouncer would get stuck if authentication method changed after view
inflation.

Bug: 149773776
Bug: 149828540
Test: atest PlatformScenarioTests:android.platform.test.scenario.sysui.lockscreen.LockscreenWithInvalidPIN
Change-Id: I39ee2ec2e2ba9b6cf7dfba6b8141efc8b380b48e
2020-02-28 01:45:35 +00:00
Yvonne Jiang
7f97f732d7 Update secondary lock screen implementation to use the newly updated SurfaceControlViewHost API.
Previously we passed back a SurfaceControl to the keyguard, updated to pass a SurfacePackage instead. The updated SurfaceControlViewHost logic addresses underlying accessibility bugs.

Bug: 136085151
Test: atest AdminSecondaryLockScreenControllerTest
Test: atest FrameworksServicesTests:DevicePolicyManagerTest
Change-Id: I4881d5766f118b99f497ee306cd71d3c5a65a2f3
2020-02-04 15:44:13 -08:00
Jorim Jaggi
026ed75dbd Adjust SysUI for new insets
- Layout of notif shade is no longer custom, so need to handle
insetsIgnoringVisibility on client.
- Do not special case Keyguard anymore. Just treat it as regular
control target.
- No more special sauce to hide navigation bar on Keyguard.
- Treat it as BEHAVIOR_SHOW_TRANSIENT_BARS_ON_SWIPE but don't
actually do that in DisplayPolicy

Test: InsetsPolicyTest
Test: Lockscreen with PIN
Bug: 118118435
Change-Id: I1edce4fdb792fd97a181165a03957ba5d6d3e551
2020-01-30 18:23:25 +01:00
Yvonne Jiang
b7024a251c Adding API for displaying a DO/PO controlled secondary lock screen post initial system lock screen.
The new DPM API allows DP/POs to set whether the keyguard needs to show a secondary lockscreen after the primary locking mechanism is dismissed. If enabled, the keyguard will check for a service handling ACTION_BIND_SECONDARY_LOCKSCREEN_SERVICE and request the secondary lockscreen content from it.

Bug: 136085151
Test: atest FrameworksServicesTests:DevicePolicyManagerTest
Test: atest KeyguardUpdateMonitorTest
Test: atest AdminSecondaryLockScreenControllerTest
Change-Id: If82921b4fc2d78c0522a20ef91b48f9a93dd8b61
2020-01-21 15:52:57 -08:00
Muhammad Qureshi
9bced7d7de Add sysui module for logging SystemUI atoms.
As part of statsd becoming a Mainline module in R, autogenerated
StatsLog.write() calls are going away and replaced by *StatsLog.java
that is autogenerated for each module.
This CL adds autogenerated SysUiStatsLog to SystemUI and replaces usages
of StatsLog with SysUiStatsLog.
Since the write calls in SysUiStatsLog are public, StatsLogCompat is no
longer needed.

Bug: 145952197
Test: m
Test: fastboot flashall
Test: adb shell cmd stats print-logs && adb logcat "*:S statsd:*"
Change-Id: I192ff29d21cedbe715bb02ffa05921b4912af371
2020-01-17 10:41:05 -08:00
Rubin Xu
20aa6cd497 Force a garbage collection after lockscreen verification
This is to attempt erasing any lockscreen password remnants from memory,
which is a NIAP certification requirement.

Bug: 142861621
Test: reboot device, enter lockscreen password, then use pmdump to dump
process memory for SystemUi, verify password does not exist in the dump.

Change-Id: Ifbec81a64e4c592b566f5653bd93fd7326693ec7
2019-11-14 11:45:02 +00:00
TreeHugger Robot
3328bd6872 Merge "Make is less likely to ignore PIN tap events" 2019-10-04 21:22:17 +00:00
Lucas Dupin
93c5ed8167 Make is less likely to ignore PIN tap events
The PIN area can be dragged vertically to retry face auth,
the touch slope was already scaled up to avoid accidental
drags but some users still reported that taps were being
ignored. This CL increases the touch slope size.

Fixes: 140030986
Bug: 141873371
Test: manual
Change-Id: I8db78942797f2c44caf9c9bdc0ec693e6c6a65f9
2019-10-04 12:01:49 -07:00
Dave Mankoff
f44b13ad17 Remove view inflation when getting the running KeyguardBouncer.needsFullscreenBouncer.
The view is just proxying to an underyling object. Query the object directly.
Bug: 140059518
Test: atest SystemUITests.

Change-Id: I797f7c6a3d8734795d8a34a3709eaeed2e571dfa
2019-10-03 18:06:55 -04:00
Lucas Dupin
c8f16e803e Single source of truth for auth state
Merging UnlockMethodCache and KeyguardMonitor into KeyguardStateController,
making it injectable and introducing KeyguardStateController#isUnlocked
in order to make it easier to keep track of the lock screen state.

Test: atest SystemUiTests
Test: unlock with face, lock again
Test: unlock with password, lock again
Bug: 139363827
Change-Id: I37ac8c7826101852c61382559be9868125c15fac
2019-09-23 14:55:43 -07:00
Hyunyoung Song
8f9d34cb5f [DO NOT MERGE] qt-qpr1-sysui-dev @ build 5814791
Test: presubmit setup on source branch

Bug: 130289146 Create a Gradle build for SystemUI
Bug: 136279712 Daggerize FalsingManager
Bug: 137324767 "Unable to instantiate service com.android.systemui.doze.DozeService" exception breaks launcher tests
Bug: 137563419 Remove Bouncer reveal delay from bypass flow
Bug: 138787339 Allow Services and Activities to be injected into directly.
Bug: 139128921 [AS 3.5 RC2, SDK API 29 rev 2] Overload resolution ambiguity: while removing element from HashMap
Bug: 64712476 Import translations for dev branches


Change-Id: Ib7fd4706c070907fd556c3532957f3b1b046de6d
2019-09-01 00:31:47 -07:00
Dave Mankoff
e229469af3 Fix the looper that KeyguardUpdateMonitor is using.
Bug: 139051615
Test: atest SystemUITests && atest SystemUIGoogleTests
Change-Id: Ic4dd5978001c208504c137cee41f363d7e70b1b5
2019-08-31 12:29:46 -04:00
Lucas Dupin
8968f6a9e9 IPC StrictMode
This CL introduces a way of blocking IPCs on the main thread.
This is enforced by StrictMode, and enabled on tests and eng
builds.

All current blocking IPCs were whitelisted and bugs will be
filed, in order to fix them for R.

Bug: 139360025
Test: adb logcat
Test: atest SystemUITests
Change-Id: I45af2619605ee36b6bae83ef080272c62754b654
2019-08-26 17:45:30 -07:00
Lucas Dupin
ccf6721e41 Stop face auth requests when users are typing
We don't want the bouncer to be dismissed right under the user's finger
when typing.
Let's abort face auth after we start typing.

Test: solve challenge when face auth is running
Test: repeat for pin/pattern/password
Fixes: 136525169
Change-Id: I8f1ccbca4be9c84f5cb108618b84aefe03b74cc4
2019-08-07 12:57:31 -07:00
Lucas Dupin
4c50704670 Isolate DPM and SIM PIN states from UX
User should still be able to swipe up to retry or still see
the bypass lock screen when face auth is disabled or sim
card is locked. Having different UX on those cases is
confusing.

Bug: 138125943
Change-Id: Iece4d28e7a988af846c9e8aa9eb0fff5a1d74249
2019-07-23 13:30:22 -07:00
Jordan Liu
15be64a0ac Fix sim pin on DSDS
Fixes the issue where only one SIM's PIN is checked when unlocking.
This undoes behavior changes introduced in aosp/769050

Test: manually verify with single and dual SIM that SIM PIN functions
correctly with different lockscreen settings
Bug: 135496265
Change-Id: I8db4565c4e5d5bcfb166b5962e878531a84dbafb
2019-07-16 21:52:21 +00:00
Lucas Dupin
aad988345a Do not let device sleep after successful auth
Retrying auth, or succeeding is a strong signal that the user
is present. The device should not sleep, otherwise the keyguard
will be dismissed (as it should) but not automatically locked,
since screen timaeouts don't lock instantly.

Test: Manual
Fixes: 135967964
Change-Id: I9a8bcf0ddb80536719d093aab9e00c76d87ad24b
2019-07-14 13:23:24 +09:00
Lucas Dupin
fc8de93eed Do not let pattern be dragged
Test: drag accross pattern
Test: start dragging from edges
Test: start drawing, drag outside the bounds
Test: repeat on small and large device
Fixes: 132687980
Change-Id: Idab9279dd7cb002cbd43aab0ce1d48f265d39f04
2019-06-13 15:48:49 -07:00