Commit Graph

14684 Commits

Author SHA1 Message Date
Marcin Oczeretko
d68c208ed7 Merge "Log measurements from LatencyTracker to statsd" 2020-09-01 13:08:47 +00:00
Marcin Oczeretko
d4430329bc Report per-interaction frame statistics to statsd
Also reorganized the FrameTrackerTest a bit

Bug: 162927074
Test: manual - statsd_testdrive to verify statsd logging + run
FrameTrackerTest

Change-Id: Iec1fcafcd6c8373ebdeebbbd829eb94967c2bfb8
2020-08-28 16:08:36 +01:00
TreeHugger Robot
1e19bfb919 Merge "Introducing an interface to store alarms" 2020-08-28 02:33:49 +00:00
Suprabh Shukla
323fccc622 Introducing an interface to store alarms
The alarms inside alarm manager service are stored in a variety of
different lists, the main one being an array list of Batch objects. Over
time due to various policy changes, it has caused a lot of coupling
between the service's business logic and the management of these data
structures.

This change introduces an interface to store alarms (a.k.a. AlarmStore)
and attempts to create a well defined boundary across which the service
interacts with this data structure. The interface presently supports
the following operations:
- add: to add an alarm.
- remove: to remove any alarms described by a predicate.
- removePendingAlarms: to remove any alarms that are due at a given
time.
- getNextDeliveryTime: the next upcoming alarm's delivery time.
- getNextWakeupDeliveryTime: the next upcoming wakeup alarm's delivery
time.
- recalculateAlarmDeliveries: to adjust the alarm deliveries in a way
described by the caller.
All the times are interpreted in the elapsed timebase.

The details of how the alarms are stored and managed, such as their
relative ordering and the complexity of each of the supported operations
is left to the implementations to decide. The expectation is that
this will make it easier to change and optimize these aspects of the
data structure in the future, while also making it simpler to make
changes to the service side policies.

Apart from the above, some formatting was corrected, obsolete or dead
code was removed and a bug where we were missing a rebatch was fixed.

Test: atest FrameworksMockingServicesTests:com.android.server.alarm
atest CtsAlarmManagerTestCases

Bug: 161497385
Change-Id: I8ac475d6c6a827500bf93be982cd40897f6743ae
2020-08-27 17:41:19 -07:00
TreeHugger Robot
ef8ce9db9d Merge "Infrastructure of Always-on tracing" 2020-08-27 19:02:03 +00:00
Marcin Oczeretko
a6bf4dd0d5 Log measurements from LatencyTracker to statsd
Only on userdebug and eng builds for now.

Bug: 131859447
Test: manual - flashed the phone and verified the atoms with statsd_testdrive
Change-Id: I1a97dfe4ad062740f7c30558930de455cac07d9c
2020-08-27 19:14:38 +01:00
Ahan Wu
ba492039e1 Infrastructure of Always-on tracing
The aot infrastructure for instrumenting CUJs.
The usage is like below:
AlwaysOnTraceManager.init(view /* one in the view tree */);
AlwaysOnTraceManager.begin();
...
AlwaysOnTraceManager.end();

Bug: 158756171
Bug: 163514962
Bug: 162483077
Test: Manually
Test: atest FrameworksCoreTests
Change-Id: I570a760d4f3b71e86f19172d8f595e558369ff65
2020-08-28 00:10:42 +08:00
Mark Renouf
d6bcd0e1c8 Merge "Fix area rendered by ScrollCaptureViewSupport" 2020-08-27 14:52:26 +00:00
Mark Renouf
af948d55d7 Fix area rendered by ScrollCaptureViewSupport
When rendering the requested image, the updated scrollDelta was not
being accounted for, resulting in rendering the wrong vertical
position. This would happen if the view scrolled as a result of the
request.

Also adds a call invalidate() on the target view after scrolling to
ensure that DisplayLists are correctly rebuilt when rendered here
since there is no synchronization with the render thread.

Test: atest ScrollViewCaptureHelperTest
Change-Id: I1e6aec8dd4352b4ae610657537581689a04b725b
2020-08-26 15:37:07 -04:00
TreeHugger Robot
c4d592c6a2 Merge "Revoke the uri permission when the file is deleted" 2020-08-26 01:06:18 +00:00
TreeHugger Robot
23b1690987 Merge "Add some protologs for window organizers & shell" 2020-08-25 22:00:02 +00:00
Miranda Kephart
6266f7979e Merge "Add a flag to change the screenshot keychord delay" 2020-08-25 18:19:49 +00:00
Winson Chung
b754f5281b Add some protologs for window organizers & shell
- Refactor out base protolog impl so that shell can have it's own
  implementation which takes a different viewer config (from the resources
  directly instead of a separate file in /system/etc)
- Setup the protolog transform for shell classes
- Add some basic protologs for displayarea/task organizer controller
  & shell task org (for now only text logging)

Bug: 161980327
Test: adb shell wm logging enable-text WM_DEBUG_WINDOW_ORGANIZER
Test: adb shell dumpsys activity service SystemUIService WMShell enable-text-logging WM_SHELL_TASK_ORG
Test: atest ProtoLogImplTest \
            ProtoLogViewerConfigReaderTest \
            WmTests:ProtoLogIntegrationTest \
            LogDataTypeTest \
            protologtool-tests
Change-Id: I4c3fd6aaea04987c26ac56e9baf9fc8ab75a3f34
Signed-off-by: Winson Chung <winsonc@google.com>
2020-08-25 10:07:55 -07:00
Ivan Chiang
9efd606f43 Revoke the uri permission when the file is deleted
When the file is deleted, renamed or moved, revoke all uri
permissions with the file

Bug: 157474195
Test: manual test with DocumentsUI
Test: atest DocumentsTest#testAfterMoveDocumentInStorage_revokeUriPermission
Change-Id: I4ffb183630aadb2d87b0965e8cecf88af15f4534
2020-08-25 14:49:44 +08:00
Diego Vela
08aaab16dd Merge "Convert logs to use protologs." 2020-08-24 21:50:49 +00:00
TreeHugger Robot
5f358680cf Merge "Handle NPE in LocalImageResolver to avoid crashing systemui" into rvc-qpr-dev am: 6bf25fdfc4 am: 8517455df4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12421224

Change-Id: I42f1a691785b5476e3f8957440c80656e8c54e8a
2020-08-24 04:05:56 +00:00
TreeHugger Robot
8517455df4 Merge "Handle NPE in LocalImageResolver to avoid crashing systemui" into rvc-qpr-dev am: 6bf25fdfc4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12421224

Change-Id: Ia1613a1a7e5524112b8221fbc608270d4dd87664
2020-08-24 03:55:46 +00:00
Robin Lee
dfd866daf7 Allow devices without SECURE_LOCK to *clear* PINs
Otherwise upgrade devices get stuck and can't possibly recover.

Bug: 165634310
Change-Id: Iff3115ae734cdfdba09939915f00c1ce02fe6272
2020-08-21 20:59:35 +00:00
Diego Vela
f58acf9e39 Convert logs to use protologs.
Migrate add remove debug log from debug config to protolog.
Migrate configuration debug log from debug config to protolog.
Update protolog file

Bug: 153162675
Test: manual
Change-Id: Ie97f77ce3fe165a9be2ff970da7e777962b0db31
2020-08-21 18:51:32 +00:00
Miranda Kephart
6e44e9d5b4 Add a flag to change the screenshot keychord delay
Allows overriding the configured keychord delay (the time it takes,
after both the power button and volume down have been pressed, for
a screenshot to be registered/taken). If not set, reads from the
config file (as before). Can be updated with

adb shell device_config put systemui screenshot_keychord_delay <n>

where <n> is the desired timeout, in ms.

Bug: 165267251
Test: manual -- tried setting multiple values, ensured that deleting
the override reverts to the configured value

Change-Id: I2f86abe0332f8072ab4f53baa55f1999aed3865a
2020-08-21 12:25:12 -04:00
Ahan Wu
1a1c93f964 Handle NPE in LocalImageResolver to avoid crashing systemui
ContentResolver#openInputStream may return null, and may lead to
systemui keeps crashing, handle null to avoid this case.

Bug: 163412636
Test: manually
Change-Id: Ie149b75d4445b37afac82c8351a32cb17442936d
2020-08-21 14:18:08 +08:00
Hall Liu
99f3dc8aee Merge "Expose onEmergencyNumberListChanged, semantics change" 2020-08-20 19:29:58 +00:00
Sudheer Shanka
16749d5430 Merge "Add BstatsCpuTimesValidationTest to TEST_MAPPING." 2020-08-20 18:32:00 +00:00
Kevin Chyn
106cfaacad Merge "Return handle to gatekeeper password instead of actual password" 2020-08-19 22:33:02 +00:00
Hall Liu
cebecc648b Expose onEmergencyNumberListChanged, semantics change
Expose the onEmergencyNumberListChanged method, which seems to have been
left hidden inadvertently when introduced.

Add a new version of onOutgoingEmergencyCall that supplies a
subscription ID and deprecate the old one. Along with this, send
emergency call events from any subscription to all listeners regardless
of which subscription the listener specified.

Test: atest CtsTelecomTestCases:OutgoingCallTest
Bug: 162647577
bug: 165660452
Change-Id: Ia0e10bfb3376ff82d03a6dbc4bf71c22b0ace366
2020-08-19 14:43:26 -07:00
Eran Messeri
346cee22ff Merge "DPMS refactoring: Get Profile / Device owner" 2020-08-19 10:01:11 +00:00
Vishnu Nair
5084fa3e83 Merge "Enable compositor shadows" 2020-08-18 23:50:19 +00:00
Eran Messeri
9ac405b39e DPMS refactoring: Get Profile / Device owner
Get the Profile Owner or Device Owner directly, rather than using the
ComponentName provided by the caller to look it up.

For DevicePolicyManager methods that are only callable by DO or PO,
there is no need to use the ComponentName to distinguish between
different potential admins, as there could be only one.

Bug: 163028934
Test: atest FrameworksServicesTests:DevicePolicyManagerTest
Test: atest com.android.cts.devicepolicy.MixedDeviceOwnerTest
Change-Id: I5fc3345101c8f61c12a9bbdbd224e95e719a0795
2020-08-18 22:50:31 +01:00
Kevin Chyn
be2f80392c Return handle to gatekeeper password instead of actual password
This allows 1) LockSettingsService to ensure the password isn't
valid forever. 2) Password to stay in system_server

Also, adds ILockSettings#removeGatekeeperPasswordHandle
so that callers can clean up after themselves.

Bug: 161765592

Run the following on face/fingerprint devices
Test: Remove credential
      adb shell am start -a android.app.action.SET_NEW_PASSWORD
      Set up credential + fingerprint
Test: Remove credential,
      adb shell am start -a android.settings.FINGERPRINT_SETTINGS
      This tests the ChooseLock* logic in FingerprintSettings
Test: Set up credential,
      adb shell am start -a android.settings.FINGERPRINT_SETTINGS
      This tests the ConfirmLock* logic in FingerprintSettings
Test: Remove device credential, enroll fingerprint/face. Succeeds.
      This tests the ChooseLock* returning SP path from
      BiometricEnrollIntro
Test: With credential and fingerprint/face enrolled, go to
      fingerprint/face settings and enroll. This tests the
      ConfirmLock* path in Fingerprint/FaceSettings
Test: Remove device credential, enroll credential-only, enroll
      fingerprint/face separately. Succeeds. This tests the
      ConfirmLock* returning SP path in BiometricEnrollIntro
Test: In SUW, set up credential, then biometric. This tests
      the ChooseLock* path in SUW
Test: In SUW, set up credential, go back, then set up biometric.
      This tests the ConfirmLock* path in SUW

Change-Id: I76534acc7af1e0f2e4d8af369fee31d1e19ddba9
2020-08-18 13:49:34 -07:00
Sudheer Shanka
f6bb547885 Add BstatsCpuTimesValidationTest to TEST_MAPPING.
Bug: 163674258
Test: atest --test-mapping core/java/com/android/internal/os:postsubmit
Change-Id: I64c58567c87e7a16b166f04e29e6b7b83c1aad22
2020-08-17 19:33:02 -07:00
Vishnu Nair
545fc92c8c Enable compositor shadows
Composition strategy has been fixed in R. This enables the
change in master.

Fixes: 165076424

Change-Id: I710ee561da66c84d018ce93882d8594080e87280
2020-08-17 23:48:27 +00:00
Julia Reynolds
d3dc8e79cf Merge "Remove app ops indicators from notifications" into rvc-qpr-dev am: 2659836775
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12361488

Change-Id: I70c1dd2665b51c442484577f0077ad4bebc0577d
2020-08-14 17:43:43 +00:00
Julia Reynolds
2778b62f1d Remove app ops indicators from notifications
Test: atest
Bug: 163076432
Change-Id: I5b7514f765811ffd3b0aca63d0108591755974ab
Merged-In: I5b7514f765811ffd3b0aca63d0108591755974ab
2020-08-14 15:02:02 +00:00
Julia Reynolds
f9239b3afc Merge "Remove app ops indicators from notifications" 2020-08-14 13:17:42 +00:00
Alex Johnston
ae5e71786e Merge "Add precondition checks" 2020-08-13 22:21:27 +00:00
Alex Johnston
af1c3cb440 Add precondition checks
* Add precondition checks to check the call authorization
  and the calling user.
* Add CallerIdentity object and helper method to create
  and return a CallerIdentity object.
* Add isDeviceOwner check which takes in a CallingIdentity
* Update setLocationEnabled to use new precondition check

Bug: 162825394
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
      atest com.android.cts.devicepolicy.DeviceOwnerTest#testSetLocationEnabled
Change-Id: I6054620aab661f302ebe0cb8c13bf906aad3cb68
2020-08-13 17:30:10 +01:00
Julia Reynolds
3a72daad2b Remove app ops indicators from notifications
Test: atest
Bug: 163076432
Change-Id: I5b7514f765811ffd3b0aca63d0108591755974ab
2020-08-13 11:33:43 -04:00
TreeHugger Robot
c593e6adf8 Merge "Migrate PiP logs to UiEvent" into rvc-qpr-dev am: 178e18a7fc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12132203

Change-Id: Ib6cc61278a9a1611f911a7ce246893746c6e1b54
2020-08-11 18:56:00 +00:00
Miranda Kephart
016ef828b4 Merge "Make screenshot process unbind correctly" into rvc-qpr-dev am: 8a912c716b am: bebfed8bbf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12087986

Change-Id: I0f706c1aa3855d47286076aac4850912a3a664a7
2020-08-11 18:54:58 +00:00
TreeHugger Robot
178e18a7fc Merge "Migrate PiP logs to UiEvent" into rvc-qpr-dev 2020-08-11 18:49:47 +00:00
Miranda Kephart
bebfed8bbf Merge "Make screenshot process unbind correctly" into rvc-qpr-dev am: 8a912c716b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12087986

Change-Id: I63421e3e9672afb61842b75e9cc7a476cc3fb532
2020-08-11 18:20:46 +00:00
Miranda Kephart
8a912c716b Merge "Make screenshot process unbind correctly" into rvc-qpr-dev 2020-08-11 18:00:13 +00:00
Miranda Kephart
6bb575bab1 Make screenshot process unbind correctly
There's a bug in ScreenshotHelper that causes the process not to
unbind properly. Now that the screenshot connection is kept track
of by the class, we don't need to compare its value at the
beginning and end of the started service before closing the
connection.

This also fixes an issue where screenshots didn't work right,
immediately after switching users (since the process is now
closed correctly, a new one can begin for the secondary user).

Bug: 158303623
Bug: 160355802
Fix: 158303623
Fix: 160355802
Test: manual; tested single screenshots and multiple in succession;
made sure that after switching users screenshots could be taken
immediately.

Change-Id: Idf25c6a60bdde8ab970c4af68884de798159ef3f
2020-08-11 09:32:29 -04:00
Hongwei Wang
c9be08b5aa Merge "Move ProtoLog to shared place" 2020-08-11 01:48:28 +00:00
Suprabh Shukla
9e07b814cb Merge "Switching StatLogger to uptime" 2020-08-10 20:14:59 +00:00
Dmitri Plotnikov
326e3ca1fc Merge "Add binder call stats tracking for individual UID" 2020-08-10 17:21:48 +00:00
Kevin Chyn
19293693e8 Merge changes from topics "async-challenge", "lss-sp"
* changes:
  Remove GenerateChallengeBlocking from FingerprintManager
  Change GenerateChallengeCallback from abstract class to interface
  3/n: Remove challenge from verifyCredential
  2/n: Remove unnecessary RequestThrottledException for verify paths
  1/n: Allow LockSettingsService to return Gatekeeper Password
2020-08-08 00:05:53 +00:00
Kevin Chyn
cdf4b2868a 3/n: Remove challenge from verifyCredential
Decouples the remainder of challenges from LockSettingsService.
Clients that require Gatekeeper HATs that wrap challenges should
request the Gatekeeper Password, then request LockSettingsService
to verify(GatekeeperPassword, Challenge). If the challenge is
biometric-related, it must be generated after LockSettingsService
completes verifyCredential, since LockSettingsService internally
does generateChallenge/resetLockout/revokeChallenge.

Bug: 161765592
Test: CtsVerifier biometric portion
Test: Reset fingerprint/face lockout
Test: atest com.android.server.locksettings

Change-Id: Icb384194ce5007b264068e697113d55cbf94945b
2020-08-07 12:17:29 -07:00
Kevin Chyn
6e6a735e65 2/n: Remove unnecessary RequestThrottledException for verify paths
verifyCredential and verifyTiedProfileChallenge return a
VerifyCredentialResponse object instead of a byte[] now. Thus,
any/all information regarding the authentication attempt is
received by callers. We no longer need to use exceptions as a
method of returning an alternate non-byte[] result.

The RequestThrottledException cannot be completely removed yet
because checkCredential returns a boolean and has no way of
returning a timeout yet. See b/161956762

Bug: 161765592

Test: Accept/Reject/Lockout the following
      1) Owner profile
      2) Managed profile with separate challenge
      3) Managed profile with unified challenge
Change-Id: Ia61c71bdde42dec34d8f2eac86d7ea964b1485c2
2020-08-07 12:17:29 -07:00
Kevin Chyn
e7694cc54c 1/n: Allow LockSettingsService to return Gatekeeper Password
For certain scenarios, it's ideal if a single prompt for the user's
credential could generate multiple Gatekeeper HATs, each containing
a distinct challenge. To do so, we expose the gatekeeper password
to the caller, which can then be sent to LockSettingsService to
mint a Gatekeeper HAT with a challenge specified by the caller.

Functionally, this is split into two pieces:
1) ILockSettings#verifyCredential* has a new flags parameter,
   which if contains VERIFY_FLAG_RETURN_GK_PW, returns the gatekeeper
   password
2) ILockSettings introduces a new method, verifyGatekeeperPassword,
   which takes the Gatekeeper Password and challenge, from which
   Gatekeeper creates a HardwareAuthToken. This is different than
   the rest of spBasedDoverifyCredential and __only__ requests
   Gatekeeper to create the HardwareAuthToken. It does not proceed
   to do other things such as unlocking keystore keys, unlocking
   managed profiles, etc.

Slightly cleaned up VerifyCredentialResponse: moved to builder pattern,
cleaned up serialization/deserialization

Returning a VerifyCredentialResponse object (instead of a byte[])
also makes it easier to debug failure cases (e.g. credential was
verified but HAT was null, vs originally we have no idea). Similarly,
this allows us to remove RequestThrottledException, which can help
make it easier to reason about code flow (less unexpected nullness)

Test: Clients with VERIFY_FLAG_RETURN_GK_PW have correct "accept,
      reject, timeout" behavior
Test: Current biometric enrollment works and not affected
Test: PIN/Pattern/Password verifyGatekeeperPassword works
      (see ag/12222644)

Bug: 161765592
Change-Id: I6e2a7ea234aac1a278b35cdaff62b1c7e3e9f205
2020-08-07 12:17:29 -07:00