Commit Graph

12384 Commits

Author SHA1 Message Date
Makoto Onuki
4c7073b017 Bidner shell command API proposal
Bug: 142751512
Test: "adb shell cmd jobschduler help"
Test: "adb shell cmd activity help"

Change-Id: I9174040cae72172e82d260d0ceb9ca5a69b72940
2019-11-05 09:13:07 -08:00
Felipe Leme
42a1773abe Merge "Improved UserSystemPackageInstaller.dump()" 2019-11-05 15:18:53 +00:00
Paul Mclean
be78503554 Merge "Adding USB Recording warning message to UsbResolverActivity." 2019-11-04 21:06:41 +00:00
Aran Ink
2b041061e3 Merge "Track and destroy inline URI grants separately from Notification URIs." 2019-11-04 20:31:06 +00:00
Paul McLean
07425c8c00 Adding USB Recording warning message to UsbResolverActivity.
Bug:136080195
Test: install UsbAccess and UsbPersistentPermissionsTestApp
(both want to handle USB connection events). Notice the
new warning message for the app(s) that haven't been
granted record permission.

Change-Id: I651ae5e6314a2d59ed4537aa7d7785e27e3b1a52
2019-11-04 12:25:07 -07:00
Miranda Kephart
82bfe7d6f7 Merge "Add corner flow for screenshots" 2019-11-04 19:06:45 +00:00
Aran Ink
979c9766df Track and destroy inline URI grants separately from Notification URIs.
Bug: 142492493
Bug: 137398133

Test: Unit tests pass. Manual testing with an app configured to receive images via RemoteInput can access and display image URIs after the notification has been canceled, but before the notification entry has been removed from the shade.

Change-Id: If64ae7eff7293df3317a1f629977aaaccd866b32
2019-11-04 12:56:41 -05:00
TreeHugger Robot
90edec903a Merge "Do not enforce partition restrictions on component-override" 2019-11-04 17:31:43 +00:00
Miranda Kephart
ea2e67a5a0 Add corner flow for screenshots
Instead of showing a notification, the screenshot animates into the
bottom left corner of the phone. Tapping on it leads to the same
intent as tapping "Edit" on the notification would. The screenshot
disappears after 8 seconds.

Bug: 137153302
Test: adds feature behind flag, tested that behavior remains the same
if flag is false

Change-Id: I4f48ba7de36f298bd6a66439ea6885fc92a8cb9c
2019-11-04 12:13:19 -05: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
Ryan Mitchell
61a3032198 Do not enforce partition restrictions on component-override
Previously, any static RRO could change the manifest value of any
resource in any package. The initial component-override change
restricted this to only partitions with the ALLOW_APP_CONFIGS flag
are allowed to configure component enabled state.

This change allows any partition to use component-override.

Bug: 135048762
Test: adb shell pm query-services \
      com.android.bluetooth/.sap.SapService

Change-Id: I035b2233bceb4ed7b091295e5aaa99b61dad851e
2019-10-30 08:52:43 -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
Felipe Leme
1fbe9b59bf Improved UserSystemPackageInstaller.dump()
Also logs which sysconfig file is read, which helps debugging the multiple
layers (OEM, Vendor, system, etc...)

Bug: 134605778
Test: adb shell dumpsys user | tail -5

Change-Id: I4b312d6573818144864f7b6bb403c59e722978ad
2019-10-23 02:29:36 +00: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