Commit Graph

12225 Commits

Author SHA1 Message Date
Tiger Huang
0dbd5376ea Window Manager Flag Migration (5/n)
Completely remove the system UI visibility from the SystemUI side.

Bug: 118118435
Test: atest InsetsSourceProviderTest InsetsStateControllerTest
            InsetsPolicyTest WindowStateTests CommandQueueTest
            RegisterStatusBarResultTest InsetsFlagsTest
            LightBarControllerTest RegisterStatusBarResultTest
Test: build on specific target
Change-Id: Ibc866c5fbb35582dad8fd1a90376ce47dc501377
2019-11-06 01:07:31 +08:00
Mike Ma
9688474172 Downgrade error level when proc file is empty
Use Slog.w instead of Slog.wtf for a few empty cases when reading
proc files.

There have been quite a few issues around reporting error at Slog
.wtf level in the past. Although Slog.wtf should not crash itself,
it has indirectly caused a few crashes due to improper handling of
wtf errors e.g. arose from incorrectly mocking BatteryStatsImpl.

Test: Manual
Change-Id: Idce018c928a1bb0f3d4c139382d090be009c291d
2019-11-01 02:26:09 -07:00
Hui Yu
a86a36b184 Merge "Add process capability as a new dimension." 2019-10-31 23:11:21 +00:00
Kweku Adams
f8ab0aa52b Merge "Move heap dump sharing to SHELL." 2019-10-31 19:23:30 +00:00
Andrei-Valentin Onea
dd663ea38e Merge "Add apis for listing all compat changes" am: 2c3b1a1010 am: 4b8947bd56
am: 97ad6f5c48

Change-Id: I6478b10141e6a051e7e1d04b3108f0266f74a173
2019-10-31 06:59:18 -07:00
Andrei-Valentin Onea
97ad6f5c48 Merge "Add apis for listing all compat changes" am: 2c3b1a1010
am: 4b8947bd56

Change-Id: I924c55f20755d33c6a748326bf07083592fd77e6
2019-10-31 06:52:54 -07:00
Andrei Onea
18041f787d Add apis for listing all compat changes
These apis are required for adding UI in the Developer options for
modifying compatibility change overrides.

Bug: 138280620
Test: atest CompatConfigTest
Change-Id: If55aa68f9bdd6bed0765324e972de3683bacb553
2019-10-31 11:54:13 +00:00
Hui Yu
2696932100 Add process capability as a new dimension.
Add new attribute capability to ProcessRecord, it represents what this
process is allowed to do. Capability is a separate dimension for
process state (ProcState).

In OomAdjuster.java, capabilities can be passed from client to service.

Add PROCESS_CAPABILITY_FOREGROUND_LOCATION to represent the capability
that can access location while-in-use.

For permission such as foreground location access, AppOpsService
checks for FOREGROUND_LOCATION capability, also checks if the process
is in one of the foreground process states, if both conditions meet,
the locaton operation is allowed.

Remove PROCESS_STATE_FOREGROUND_SERVICE_LOCATION.

Bug: 136274596
Test: atest CtsAppTestCases:ActivityManagerProcessStateTest
atest CtsAppTestCases:ActivityManagerApi29Test
atest frameworks/base/services/tests/mockingservicestests/src/com/android/server/appop/AppOpsServiceTest.java
Change-Id: Ie1c8e670fb0789208b753eb49b7e2fce6a2f211f
2019-10-30 18:23:24 -07:00
TreeHugger Robot
2bbe7de417 Merge "Remove StartInputFlags.FIRST_WINDOW_FOCUS_GAIN" 2019-10-29 23:51:56 +00:00
Kweku Adams
6d4bd8e8db Move heap dump sharing to SHELL.
The system shouldn't be granting read URI permissions as itself. This
means that heap dumps aren't successfully shared. Moving the heap dump
sharing mechanism to SHELL, which already has the permission to dump
heaps so that dumps can be shared properly.

The Shell changes are submitted separately.

Bug: 126885951
Bug: 135150619
Test: collect a heap dump and confirm it's successfully shared with an app
Test: do manual test on a secondary user & confirm it's not available to
other user
Change-Id: I6d2230bb2d9ca42a105b3fedee9d075de35e3dd3
2019-10-29 15:17:05 -07:00
arangelov
b0802dc1fc Separate adapter logic from ChooserActivity and ResolverActivity
Test: atest com.android.internal.app.ChooserActivityTest
Test: atest com.android.internal.app.ResolverActivityTest
Bug: 142537267
Bug: 142538125
Change-Id: Ia4a61e3dc7cbac5c31e0d5b126e033a043c81d90
2019-10-29 14:48:59 +00:00
lumark
847a7d97e9 Remove StartInputFlags.FIRST_WINDOW_FOCUS_GAIN
Since this flag does not do any check during start input,
Remove this flag and the related parameter for IMM#onPostWindowFocus
to keep the logic simpler (included removing
ViewRootImpl#mHasHadWindowFocus).

This is refector CL and does not impact any behavior change.

Bug: 141738570
Test: Refector CL, make sure all existing test passed.
Change-Id: I9119f4846cbbd2b15246dea9a3b1fc5845dce951
2019-10-29 21:40:45 +08:00
Xin Li
b2198fa670 Merge "Merge Coral/Flame into AOSP master" 2019-10-27 04:44:29 +00:00
Roshan Pius
748c9c61a9 Merge "Add a new BatteryStatsManager class" 2019-10-27 00:09:50 +00:00
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
Mathieu Chartier
e4bc16c489 Merge "Avoid preloading classes for boot image profiling" am: cfee28589b am: 84f358f9bf am: ac60bbb740
am: fca111db2f

Change-Id: Ic28857abef951581a7627e3805ccd3db49c03391
2019-10-25 13:27:34 -07:00
Mathieu Chartier
fca111db2f Merge "Avoid preloading classes for boot image profiling" am: cfee28589b am: 84f358f9bf
am: ac60bbb740

Change-Id: I48fa3fbc8b9f2859a084bf36d06117a1ea8970cf
2019-10-25 13:20:46 -07:00
Mathieu Chartier
ac60bbb740 Merge "Avoid preloading classes for boot image profiling" am: cfee28589b
am: 84f358f9bf

Change-Id: Iea9cf99e07272a4e5a6ae132825591d3508a5c04
2019-10-25 13:08:35 -07:00
Mathieu Chartier
84f358f9bf Merge "Avoid preloading classes for boot image profiling"
am: cfee28589b

Change-Id: I9c7be76f96546d50a6e049aeab60ca71ee215500
2019-10-25 12:58:29 -07:00
Mathieu Chartier
cfee28589b Merge "Avoid preloading classes for boot image profiling" 2019-10-25 19:35:00 +00: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
Mathieu Chartier
d3c72db3bb Avoid preloading classes for boot image profiling
Since the clinits may execute methods, we should avoid preloading
classes to avoid executing methods that may not be required. These
samples could cause inaccuracy in the boot image profile.

Test: manual: adb logcat | grep preloadClasses
Bug: 139883463

Change-Id: I5b4568a477724606105196cba010109f80eecec1
2019-10-24 08:04:31 -07:00
Matt Pietal
a17cb6e167 Merge "Resolver: Modernize layout" into qt-qpr1-dev
am: 15b780d108

Change-Id: I5aea7ba6f4f950d7857cc99d38a44ad329fb9088
2019-10-24 06:18:51 -07:00
Anna Trostanetski
96d504dc03 Merge "Add userId to the package name API." am: dcc401b7b7 am: 443d3d0f11
am: ba20c10d2c

Change-Id: I6584c26c2c9df0a778d6d34fd122d096781cca38
2019-10-24 06:12:32 -07:00
Anna Trostanetski
ba20c10d2c Merge "Add userId to the package name API." am: dcc401b7b7
am: 443d3d0f11

Change-Id: I034b22fff0c4510d604cee8c5a353994b3c097e3
2019-10-24 06:00:51 -07:00
Anna Trostanetski
443d3d0f11 Merge "Add userId to the package name API."
am: dcc401b7b7

Change-Id: Ib1b52a3f1082ce6f6d6087080e3e1bc5677f5026
2019-10-24 05:53:50 -07:00
atrost
5076854633 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.

Test: locally, b/143129258
Change-Id: Iab8ddaa76358d5fad63e10d7c4c3f92e2a0f51a2
Merged-In: I92ea650b49743c388bff9943a7ec620e3d61a5d6
2019-10-22 21:10:53 +01: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