Commit Graph

12199 Commits

Author SHA1 Message Date
Roshan Pius
848513ebe6 Add a new BatteryStatsManager class
Wifi/telephony mainline modules uses IBatteryStats which is an AIDL &
hence cannot be made a @SystemApi. Create a new manager class to wrap
around this AIDL to expose @System Api.

Bug: 138806762
Test: Device boots up & connects to wifi networks.
Change-Id: Ib8816c3df17ccc562b9664e7bea1ef01ab61f697
2019-10-26 14:43:59 -07:00
TreeHugger Robot
2d7c2d4ca3 Merge "On demand label loading and async alphabetical sorting." 2019-10-25 03:40:36 +00:00
Zhen Zhang
55d66aa097 On demand label loading and async alphabetical sorting.
Refactor the loading of target labels. Make them on demand and
asynchronously. Also, use AsyncTask to update and sort alphabetical
list.

Bug: 142659056
Test: Passed all unit tests in ChooserActivityTest. Passed most
ResolverActvitiy unit tests after modification in another CL under same
topic, except setMaxHeight and setShowAtTopToTrue.
Change-Id: I9d0e2343d7ae549990b898fab7ab97f79ad57366
2019-10-24 15:23:31 -07:00
Christopher Tate
b909c4d55a Move UsageStatsManagerInternal to services.jar
UsageStatsManagerInternal is also no longer an API surface for
registration of app idle state change listeners.  AppStandbyInternal has
become a proper LocalService and interested clients can just use that
directly.

Bug: 140833849
Test: boot & run normally
Test: verify system package backup
Change-Id: Ie63f438f129cd8f41169778a3045d131ca7322fb
2019-10-24 18:28:52 +00:00
TreeHugger Robot
69a5323a46 Merge "Add userId to the package name API." 2019-10-22 19:57:55 +00:00
TreeHugger Robot
66bad8bce5 Merge "Trace duration on Sysconfig.readAllPermissions()." 2019-10-22 18:28:41 +00:00
atrost
53bca9377d Add userId to the package name API.
The service would query package manager with the provided userId, and
will return true if the package is not visible.

Bug: 142942524
Bug: 143129258
Test: m, treehugger
Change-Id: I92ea650b49743c388bff9943a7ec620e3d61a5d6
2019-10-22 18:57:08 +01:00
TreeHugger Robot
e93875e1d3 Merge "Fix bug: when input size smaller than k, should return after sort." 2019-10-22 16:48:43 +00:00
Felipe Leme
3eb78099f2 Trace duration on Sysconfig.readAllPermissions().
On automotive's reference implementation it can take up to 500ms, although
during this CL tests it took just 56ms:

10-22 16:14:53.241 30451 30525 D SystemConfig: readAllPermissions took to
complete: 56ms

Bug: 143112379
Test: adb logcat SystemConfig *:s

Change-Id: I21462482cd8d6d595220af716bbe6547c7637e49
2019-10-22 16:28:25 +00:00
TreeHugger Robot
4d77a3e195 Merge changes from topics "lockscreen-pin", "locksettings-aidl"
* changes:
  Introduce Lockscreen PIN credential as first-class citizen
  Introduce LockscreenCredential to LockSettingsService
2019-10-22 09:28:39 +00:00
Zhen Zhang
e16ca90da1 Fix bug: when input size smaller than k, should return after sort.
Bug: 143076068
Test: Manually test with the change fixed reported bug.
Change-Id: I026abca19c7961318fd8968f7a4a4aed41420851
2019-10-22 07:42:22 +00:00
Ilya Matyukhin
f4ded6d022 Merge changes from topic "biometric-service-migration"
* changes:
  Remove strings from low level onError(...) calls
  Prepare BiometricService for migration to a module
2019-10-21 21:22:43 +00:00
Rubin Xu
5e891bcc04 Introduce Lockscreen PIN credential as first-class citizen
* Add CREDENTIAL_TYPE_PIN as the fourth credential type.
* Rename existing CREDENTIAL_TYPE_PASSWORD
  to CREDENTIAL_TYPE_PASSWORD_OR_PIN which is still referenced
  by password data persisted on disk.
* No longer store quality for new credentials (PASSWORD_TYPE_KEY).
  Credential type stored in synthetic password blob is now the single
  source of truth on what credential (None/Pin/Pattern/Password) the
  device currently has.
* Adapt lockscreen FRP to work on a similar fashion (no more quality
  being passed around and stored)
* Adapt RecoverableKeystore to use the new PIN credential type.
* Fix existing unit tests
* Add new unit tests for lockscreen FRP.

Upgrade path:
* Existing credentials will have CREDENTIAL_TYPE_PASSWORD_OR_PIN, and when
  LSS sees this, it will further consult PASSWORD_TYPE_KEY to distinguish
  between PIN and Pattern. The credential will stay this way until the next
  password change i.e. no automatic credential upgrade.
* Existing FRP credential will have CREDENTIAL_TYPE_PASSWORD_OR_PIN, and
  when LSS sees this, it will further consult the saved quality
  PersistentData.qualityForUi to make that distinction.
* Normal and FRP credential enrolled after this CL will store
  CREDENTIAL_TYPE_PIN to indicate this is a numeric PIN.

Bug: 65239740
Test: atest com.android.server.locksettings
Test: atest com.android.internal.widget.LockscreenCredentialTest
Test: atest com.android.internal.util.LockPatternUtilsTest
Test: atest LockSettingsShellCommandTest
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
Test: atest FrameworksCoreTests:PasswordMetricsTest
Test: atest FrameworksCoreTests:PasswordPolicyTest
Test: atest MixedManagedProfileOwnerTest#testResetPasswordWithToken
Test: atest com.android.cts.devicepolicy.PasswordComplexityTest
Test: atest com.android.cts.devicepolicy.ManagedProfilePasswordTest
Test: flash an old build, enroll password and flash to new build.
      Verify everything still works.
Test: manually set an PIN/Pattern/Password; then change to
      PIN/Pattern/Password; finally remove password
Test: manually create a work profile; try unify and ununify work
      challenge.
Test: manually test lockscreen FRP flow (change password via Settings /
      DPC)

Change-Id: I781cea4c32d567aac4af692697c4569161580102
2019-10-21 15:49:53 +01:00
Anna Trostanetski
8b6739ce5b Merge "Add a unit test for ChangeReporter." am: 7b5773765f am: d8891ccab7 am: ba64fed16b
am: 5542cc7aa2

Change-Id: I9744393bfd4adf8a3a366cbba815aa7bf1095dc2
2019-10-21 05:43:56 -07:00
Anna Trostanetski
5542cc7aa2 Merge "Add a unit test for ChangeReporter." am: 7b5773765f am: d8891ccab7
am: ba64fed16b

Change-Id: Icf7ab12fdcb510b20c9254b4e184540757b5f063
2019-10-21 05:32:07 -07:00
Rubin Xu
bb88320874 Introduce LockscreenCredential to LockSettingsService
Use LockscreenCredential as the representation format for credentials
throughout the LSS system service, until when the raw credential bits
are needed. Most of the changes are just mechanical, except in places
when null was used to represent empty credential, but now it has its
own concrete object.

Test: atest com.android.server.locksettings
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
Test: atest MixedManagedProfileOwnerTest#testResetPasswordWithToken
Test: atest com.android.cts.devicepolicy.PasswordComplexityTest
Test: atest com.android.cts.devicepolicy.ManagedProfilePasswordTest
Bug:65239740
Change-Id: I3997c3c2b6651d11a0e447448ac3a8523a18fa36
2019-10-21 13:27:55 +01:00
Anna Trostanetski
ba64fed16b Merge "Add a unit test for ChangeReporter." am: 7b5773765f
am: d8891ccab7

Change-Id: I1018b49569ca40a7a4290edff55f584508c7b241
2019-10-21 05:26:05 -07:00
Anna Trostanetski
d8891ccab7 Merge "Add a unit test for ChangeReporter."
am: 7b5773765f

Change-Id: I4af55d71ed16a1e4702ed02a5751105f33327cbb
2019-10-21 05:20:09 -07:00
Tiger Huang
fb8eddcf85 Merge "Window Manager Flag Migration (4/n)" 2019-10-21 11:37:53 +00:00
Pavel Grafov
06716bec38 Merge "Fix testResetPasswordWithToken." 2019-10-21 10:39:35 +00:00
Jorim Jaggi
956ca413e3 Window Manager Flag Migration (4/n)
Wire up the appearance and the transient state of system bars between
WMS and System UI. The derived classes of CommandQueue.Callbacks no
longer listen to setSystemUiVisibility, but listen to showTransient,
abortTransient, and onSystemBarAppearanceChanged instead.

Bug: 118118435
Test: atest InsetsSourceProviderTest InsetsStateControllerTest
            InsetsPolicyTest WindowStateTests CommandQueueTest
            RegisterStatusBarResultTest InsetsFlagsTest
            LightBarControllerTest
Test: build on specific target
Change-Id: Ie35f4b4468bce7ef8c76f091e306610c069fba85
2019-10-19 16:59:06 +08:00
Ilya Matyukhin
0f9da353b5 Remove strings from low level onError(...) calls
In order to get a correctly translated error messages, getString(...)
should be called on the application context, as opposed to the system
context. This is because the system context is unaware of the user's
locale.

Bug: 141025588
Test: Face Unlock works E2E
Test: Works with BiometricPromptDemo
Test: atest BiometricServiceTest
Test: atest AuthControllerTest
Test: atest CommandQueueTest

Change-Id: Ic228bb7ebb0d6a4ebaf96b9f1d2d70ed4e9dd79a
2019-10-18 16:45:52 -07:00
Pavel Grafov
ca7825ba4b Fix testResetPasswordWithToken.
Two issues fixed:
1. Resetting to empty password was rejected. Fixed credential type
   for this case.
2. Credential type was passed instead of quality.

Bug: 138375712
Test: atest MixedManagedProfileOwnerTest#testResetPasswordWithToken
Change-Id: I58e9e28e9ee0942f67ea8eedb5fd63e8e56a5f75
2019-10-18 17:33:24 +01:00
atrost
46333daeb1 Add a unit test for ChangeReporter.
Separate the decision on whether to log to two separate ones - logcat
and statsLog to allow separate policies.
Also add startLogAll and endLogAll in preparation for an adb command
that will enable/disable logging to logcat every time.

Test: atest ChangeReporterTest
Bug: 138374585
Bug: 140910281

Change-Id: Ie49368b838a19845f51a2670035f611d3e4b9a1b
2019-10-18 15:33:41 +01:00
Philip P. Moltmann
c9bb90c0e0 Merge "Add feature context" 2019-10-18 02:26:08 +00:00
Zhen Zhang
f52d443744 Merge "Refactor and override creation of the async sorting task" 2019-10-17 23:17:40 +00:00
Zhen Zhang
d45e024e7d Merge "Create a method for top K targets by using min heap algorithm" 2019-10-17 23:17:40 +00:00
Philip P. Moltmann
59076d8957 Add feature context
Currently only used by app-ops, but can be used by other modules too.

AppOps will collect app-ops based on feature. Only the most basic
parts of app-ops are supporting features yet. The rest will be added
later.

Test: atest CtsAppOpsTestCases
      atest RunSettingsLibRoboTests
      atest com.android.server.wm.ActivityStarterTests
      m -j doc-comment-check-docs
Bug: 136595429
Change-Id: Ia664f4ff1c1c2ceea721d76dc491ec50c237e9ce
2019-10-17 14:15:07 -07:00
Chen Xu
3321171cc7 Merge "non-mainline telephony related AIDL refactor/decoupling" 2019-10-17 18:27:13 +00:00
Ioannis Ilkos
5a5678d244 Merge "Revert "Window Manager Flag Migration (4/n)"" 2019-10-17 09:49:58 +00:00
Ioannis Ilkos
8cca14103c Revert "Window Manager Flag Migration (4/n)"
This reverts commit cb1b848084.

Reason for revert: Droidcop-triggered revert due to b/142849532

Change-Id: If81eba4e979e21202e78839bb1afbc66691098d2
2019-10-17 09:38:00 +00:00
TreeHugger Robot
0be9fec5c1 Merge "Window Manager Flag Migration (4/n)" 2019-10-17 05:46:19 +00:00
Chen Xu
1f6cfa5399 non-mainline telephony related AIDL refactor/decoupling
1. decouple IOnSubscriptionChangedListener AIDL from telephonyMainline
2. other refactor. moving APIs which will not be included in
telephony mainline to frameworks/base/core/java/android/telephony.
Moving internal classes like AIDL which will not be included in
telephony mainline to
framework/base/core/java/com/android/internal/telephony

Bug: 140908357
Test: Build & unit test
Change-Id: I9413ef758cceadd251d03f3b5ea1054cc48ef044
2019-10-16 15:30:24 -07:00
Zhen Zhang
f8fa586669 Refactor and override creation of the async sorting task
Refactor the creation of the async sorting task in ResolverActivity and
override it in ChooserActivity to use greatestOf method to find ranked
targets.

Bug: 142558305
Test: Passed all unit tests in ResolverActivityTest, ChooserActivityTest
and ResolverListControllerTest
Change-Id: I28fcc8a912d9ba5d42d4ad6ea58e13c97d55c6a2
2019-10-16 14:00:38 -07:00
Zhen Zhang
4bd260ae68 Create a method for top K targets by using min heap algorithm
This is a in-place sorting method. After sorting, top K targets will be at the first K indexes. Order for other elements will remain same. The method is meant for getting top K ranked targets for Share-sheet.

Bug: 142558305
Test: Passed all unit tests in ResolverActivityTest, ChooserActivityTest
and ResolverListControllerTest
Change-Id: I1b096bb0d7f7bbc102c2fb588c55ace6a20bfc5d
2019-10-16 20:42:36 +00:00
TreeHugger Robot
a8f5a64cd3 Merge "Preload sfplugin_ccodec.so to speed app startup" 2019-10-16 20:39:19 +00:00
Pavel Grafov
76621cf279 Merge "Password constraints cleanup." 2019-10-16 17:49:12 +00:00
Jorim Jaggi
cb1b848084 Window Manager Flag Migration (4/n)
Wire up the appearance and the transient state of system bars between
WMS and System UI. The derived classes of CommandQueue.Callbacks no
longer listen to setSystemUiVisibility, but listen to showTransient,
abortTransient, and onSystemBarAppearanceChanged instead.

Bug: 118118435
Test: atest InsetsSourceProviderTest InsetsStateControllerTest
            InsetsPolicyTest WindowStateTests CommandQueueTest
            RegisterStatusBarResultTest InsetsFlagsTest
            LightBarControllerTest
Change-Id: I1dcaff47ae57ccee91146fdc042cde5e26fc0b3f
2019-10-17 01:41:34 +08:00
Ray Essick
2fb0fc6fd4 Preload sfplugin_ccodec.so to speed app startup
Bug: 133186424
Test: boot, volume control, monitor for known logcat patterns
Test: CtsMediaTestCases
Change-Id: I05e5b34224163de8fd6046d299a9381424c2c4e1
2019-10-16 10:09:40 -07:00
Pavel Grafov
6f334843a8 Password constraints cleanup.
1. PasswordMetrics now doesn't have 'quality', it is only used inside DPMS.
   This allows easier and unambiguous comparisons.
2. Password complexity code reworked.

Future work: factor validation code into a android.app.PasswordPolicy class
to make PasswordMetrics just represent metrics. It is still used in two ways:
specifying an actual metrics and specifying a minimum metrics for comparison,
this will be addressed later.

Test: atest com.android.cts.devicepolicy.PasswordComplexityTest
Test: atest com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testResetPasswordWithToken
Test: atest FrameworksCoreTests:PasswordMetricsTest
Test: atest FrameworksCoreTests:PasswordPolicyTest
Test: atest com.android.cts.devicepolicy.ManagedProfilePasswordTest
Bug: 138375712
Change-Id: I8ad55f373712ac1dc8343f8cbae23ebb1efe78b9
2019-10-16 16:10:36 +01:00
Aran Ink
ac6e1a3616 Merge "Allow insertion of images from IMEs into notification quick replies." 2019-10-15 16:55:42 +00:00
Aran Ink
fd2bfd34bf Allow insertion of images from IMEs into notification quick replies.
Test: Unit tests pass. Creating a Notification with the Notify app allows access to rich media insertion via gboard, and inserted images show up in the Notify app upon sending.

Bug: 137398133
Change-Id: I65218dfaa083f7c24512430e647d8ca79058dff9
2019-10-14 16:40:30 -04:00
Dianne Hackborn
a063a5ff4e Merge "Add new association time totals to procstats proto." 2019-10-14 19:57:50 +00:00
Roshan Pius
20bce169a5 Merge "Window: Mark SHOW_FOR_ALL_USERS flag as @SystemApi" 2019-10-14 18:03:23 +00:00
TreeHugger Robot
d6fd6f27f5 Merge changes from topic "b/142461756"
* changes:
  Ime target window should control when to hide IME (2/2)
  Ime target window should control when to hide IME (1/2)
2019-10-14 17:04:57 +00:00
Ryan Mitchell
3261dacd65 Merge "Add component-override to sysconfig" 2019-10-14 16:14:28 +00:00
Rubin Xu
289100bb97 Merge "Unify lockscreen changing logic in LockPatternUtils" 2019-10-14 13:47:42 +00:00
Rubin Xu
9af061c608 Merge "Introduce LockscreenCredential" 2019-10-14 13:45:14 +00:00
Ivan Chiang
176b8d09e1 Merge "Allow providers block folders in ACTION_OPEN_DOCUMENT_TREE" 2019-10-14 13:15:30 +00:00
Roshan Pius
a3f89c6882 Window: Mark SHOW_FOR_ALL_USERS flag as @SystemApi
Bug: 142090228
Test: Compiles
Change-Id: I850c7759dc909727f73e40fb6331871a9de25f20
2019-10-12 08:32:44 -07:00