Commit Graph

17441 Commits

Author SHA1 Message Date
Julia Reynolds
34621b08e3 Merge "Increase test coverage for NotificationChannel" into rvc-dev 2020-03-11 17:14:42 +00:00
Philip P. Moltmann
093ba7e506 Merge "Allow to exempt apps from restrictions to RECORD_AUDIO" into rvc-dev 2020-03-11 16:11:16 +00:00
Winson Chung
cfdd34adab Merge "Always notify SystemUI when launching activity to existing task" into rvc-dev 2020-03-11 02:28:09 +00:00
Philip P. Moltmann
5892a8f7b0 Rename AppOpsCollector -> OnOpNotedCallback
and annotate time values used by this area of code correctly.

Fixes: 150699068
Test: Only renames
Change-Id: Ibd5b08900d6855603e7ce59048587d391a5c5410
2020-03-10 11:50:00 -07:00
Philip P. Moltmann
ad787aa128 Allow to exempt apps from restrictions to RECORD_AUDIO
- Extend the concept if "isPrivilidged" to a generic "RestrictionBypass"
  class so that we can add more variants of bypassing.
- Add a new way of bypassing by using a new permission.
- Always except resolvable UIDs (root, shell, media_uid, audioserver,
  cameraserver, system server) from restrictions.

Fixes: 141210120
Test: atest -m CtsAppOpsTestCases FrameworksMockingServicesTests:AppOpsServiceTest FrameworksMockingServicesTests:AppOpsUpgradeTest
Change-Id: I3ca555e9370aa0003400429ee7ab12e95c62a042
2020-03-10 10:06:02 -07:00
Eran Messeri
95d44d2c0e Update documentation for settings, affiliation API
Update the documentation for settings-related and affiliation-related
methods:
* The methods for setting a global and secure settings are documented
  to be mostly deprecated, because there are methods for the settings
  that are honoured and some other settings no longer apply.
* The methods for setting affiliation or binding to a service on another
  user can no longer work between a device owner and profile owner
  since this combination is no longer a valid one.

Bug: 147795815
Test: manual, m update-docs
Change-Id: I316148cb1d90fbe94999f9d1c242f08554869e97
2020-03-10 11:52:11 +00:00
Charles Chen
2a77f43bee Merge "Generate WindowInsets with new insets API" into rvc-dev 2020-03-10 08:46:30 +00:00
Winson Chung
e789ff64c8 Always notify SystemUI when launching activity to existing task
- SysUI can determine what to do based on the type of activity launched
  (ie. expand PIP/Bubbles to fullscreen)

Bug: 148977481
Test: atest TaskStackChangedListenerTest
Test: Launch app in split primary, ensure launching app again triggers
      recents
Test: Launch app in PIP, ensure launching app again triggers it to go
      fullscreen
Test: Launch app in bubble, ensure launching app again triggers bubble
      to expand
Change-Id: I754a71a72dd0e660930b19acbf9fe6ccbb453152
2020-03-10 03:46:48 +00:00
Eugene Susla
623468289f Merge "Replace auto-revoke whitelist permission flags with appop" into rvc-dev 2020-03-10 02:53:51 +00:00
Julia Reynolds
8cfe3433f9 Increase test coverage for NotificationChannel
Test: cts
Bug: 149361682
Change-Id: I548e42800cf89a225ef1030c53cbbce6ae9a0116
2020-03-10 01:11:39 +00:00
TreeHugger Robot
1a023125c9 Merge "Add permissions data validation in AppOpsService" into rvc-dev 2020-03-07 00:50:14 +00:00
Julia Reynolds
fd9f8349b8 Fix handling of work profiles in notification history
Test: atest
Fixes: 150336474
Change-Id: I9ebe8986b8b66fd3b79a4be7aa203a8e1f1ad8bb
2020-03-06 12:45:21 -05:00
David Cheung
2ead966e7b Add permissions data validation in AppOpsService
Added functionality to collect noteOp noteProxyOp startOp operations for permissions data validation, this functionality is for
developers and can be enabled by modifying the flag. This data will be utilized to ensure permissions are
requested only when necessary.

Bug: 150890258

Test: Manually tested on crosshatch to ensure files are
written/formatted properly with the necessary data and does not
interfere with normal behavior

Design Document: https://docs.google.com/document/d/1RRs3cPgCzF5S1TkTD11MBKJedUp2DAUEGtCQXtrk0XQ/edit?usp=sharing

Change-Id: Ia7fba6ec5e47b7ddd13ca964ae5f6c1afa1cc186
2020-03-05 23:04:05 +00:00
Muhammad Qureshi
596a1f6f4e Merge "Use FrameworkStatsLog instead of StatsLogInternal" into rvc-dev 2020-03-05 21:41:04 +00:00
Jing Ji
7712b3a92a Merge "Update the categories of app kill reaons" into rvc-dev 2020-03-05 21:16:12 +00:00
TreeHugger Robot
8caff7dc81 Merge "DO NOT MERGE: Remove AppSearch from Android R." into rvc-dev 2020-03-05 21:09:00 +00:00
Muhammad Qureshi
317061ae9d Use FrameworkStatsLog instead of StatsLogInternal
StatsLogInternal will be removed in R as part of statsd becoming a
Mainline mdoule.

Bug: 150630484
Test: m
Change-Id: I67481e85f98f6d84ae1dde28e2eabff485eebb36
2020-03-05 10:21:15 -08:00
Songchun Fan
130b6bec30 Merge "remove proxy binder service IIncrementalManager" into rvc-dev 2020-03-05 16:38:06 +00:00
Galia Peycheva
fc1430a39e Merge "Make ActivityInfo.preferMinimalPostProcessing a flag" into rvc-dev 2020-03-05 15:45:06 +00:00
Charles Chen
b8070fb66e Generate WindowInsets with new insets API
In previous CL[1], WindowMetrics#WindowInsets is provided
with legacy insets, which are stable insets and system
window insets. With the new insets mode enabled, we
should provide insets with new insets API.

[1]: f65e022caa

Bug: 150095967
Test: atest WindowMetricsTests
Change-Id: I251313b4b8c033dbad8b54e58cd166e2e1665d37
2020-03-05 15:25:19 +08:00
Songchun Fan
7f051b5251 remove proxy binder service IIncrementalManager
This is no longer needed because native Incremental Service directly
uses IDataLoaderManager.

BUG: 150406132
Test: atest service.incremental_test
Test: atest PackageManagerShellCommandIncrementalTest
Change-Id: Idbde2988883becbf3eb707d42c0558774a6073e8
2020-03-04 19:50:44 -08:00
Eugene Susla
5fc2d767ce Replace auto-revoke whitelist permission flags with appop
Bug: 146513245
Test: presubmit
Change-Id: I6f901b7e5dfe64840e7c3c0ee444730ac6eb4cfc
2020-03-04 18:46:22 -08:00
Tyler Gunn
017df7f013 Merge "Update car mode API docs." into rvc-dev 2020-03-04 01:43:52 +00:00
Tyler Gunn
22ef765d96 Update car mode API docs.
1. Clarify the distinction between the prioritized and non-prioritized
intents.
2. Make the priority ordering and choice of them more clear.

Test: make -j offline; preview updated docs for formatting.
Fixes: 150685399
Change-Id: I493bca75db44f25eedb07964e3dc8c8ab38827c2
2020-03-03 15:06:02 -08:00
Galia Peycheva
bdd66e30f8 Make ActivityInfo.preferMinimalPostProcessing a flag
Bug: 149420259

Test: atest CtsWindowManagerDeviceTestCases:MinimalPostProcessingTest

Change-Id: I250669158a532316bebed8fa8c17e009b9293ecb
2020-03-03 16:59:26 +01:00
Ryan Mitchell
b390818c60 Merge "Allow activities/services to have app loaders" into rvc-dev 2020-03-03 00:40:40 +00:00
Lee Shombert
675a58b2ce Merge "Fix a leak in HasSystemFeatureCache." into rvc-dev 2020-03-02 21:52:38 +00:00
Ryan Mitchell
0cbfd2b12c Allow activities/services to have app loaders
When a service or activity attaches to a base context, add the
loaders from the application context to the base context. Activity
and service contexts are created before creating the Application
context, so in order to add the app loaders before the component
onCreate method is called, we must add the app loaders to the
component after the app has been initialized.

Bug: 148630842
Test: launch AppResourcesLoaders
Change-Id: I44aa718779c574094590d25fd839f1d9f9134edb
2020-03-02 20:54:13 +00:00
TreeHugger Robot
a132d3b5e2 Merge "Do not rebase Resources with non RM impls" into rvc-dev 2020-03-02 20:22:38 +00:00
Hui Yu
3b2dccfcc3 Merge "Revert "Change isProcStateBackground() cutoff to PROCESS_STATE_BOUND_FOREGROUND_SERVICE"" into rvc-dev 2020-03-02 19:46:25 +00:00
Lee Shombert
1f771846c5 Fix a leak in HasSystemFeatureCache.
Bug: 150037560

Make HasSystemFeatureQuery static so that it does not retain a handle
to ApplicationPackageManager.

Test: Boot with an instrumented image to verify that caching still works
as expected.  Took a heap profile to verify that there were no leaks in
the cache.

Change-Id: I2cd39a6dfab9cc1bf04bb7f55638a572213f04ce
2020-03-02 17:13:40 +00:00
atrost
7bc6bec6a6 Add @RequiresPemission compat framework APIs.
The permission check is already implemented server side.

Test: m
Bug: 150471082
Change-Id: I63d807be84bccb237f69562cdbce22f99a964d1a
2020-03-02 13:20:23 +00:00
Hui Yu
fa7d46b4d6 Revert "Change isProcStateBackground() cutoff to PROCESS_STATE_BOUND_FOREGROUND_SERVICE"
This reverts commit c7956f0d91.

Reason for revert: Network access for ContentProvider will be broken by this  change.

Bug: 149500958
Change-Id: I10337ab5840c517ec7712b0d2312a26cac6a4326
(cherry picked from commit 76ee3424c6)
2020-02-29 16:00:45 +00:00
Peter Wang
879f32b1cc Merge "[API Review] Expose sendOrderedBroadcast" into rvc-dev 2020-02-28 19:05:26 +00:00
Jing Ji
d3aff3aef1 Update the categories of app kill reaons
Prepare for the metrics, added additional subreasons.

Bug: 148087795
Test: atest CtsAppExitTestCases:ActivityManagerAppExitInfoTest
Change-Id: Id4218f9af44c43824a9f530d48bbf8cd88c32a06
Merged-In: Id4218f9af44c43824a9f530d48bbf8cd88c32a06
2020-02-27 21:32:46 -08:00
Daniel Colascione
ac3c969069 Merge "Add context UID to package-name-based permission query" into rvc-dev 2020-02-27 17:52:24 +00:00
Anna Trostanetski
6d1c0c7d90 Merge "Cache binder calls in CompatChanges" into rvc-dev 2020-02-27 14:58:13 +00:00
Daniel Colascione
614105b373 Add context UID to package-name-based permission query
The code for caching permission queries incorrectly used the UID of
the calling process instead of the Context UID when asking
PermissionManagerService whether a package (identified by name) has a
permission. As a result, permission checks produced incorrect results
for certain cross-user scenarios. This CL makes the checking UID part
of the package-name-based permission query.

Test: atest com.android.car.VmsPublisherSubscriberTest
Bug: 150172373
Bug: 150025558
Bug: 150140220
Change-Id: I903a9e79fbbba97ea987120066817eeea9b01d51
2020-02-27 12:29:30 +00:00
Peter Wang
2361687bec [API Review] Expose sendOrderedBroadcast
with appOp as String and options as Bundle

Bug: 139077993
Bug: 146423958
Test: Build
Change-Id: I5325e08d60016741139251813a5df9b42f2efc82
Merged-In: I5325e08d60016741139251813a5df9b42f2efc82
2020-02-26 15:58:33 -08:00
Alexander Dorokhine
0b291791c8 DO NOT MERGE: Remove AppSearch from Android R.
Test: presubmit
Bug: 150249538

Change-Id: Idb86be6586ae400552f8ceeca5c667fba8e0c43a
2020-02-25 21:15:03 -08:00
Ryan Mitchell
c57064f988 Do not rebase Resources with non RM impls
If a Resources object associated with an Activity has its underlying
ResourcesImpl changed to an impl that did not originate from
ResourcesManager, do attempt to propagate configuration change events
to the Resources object.

Bug: 148196042
Test: manual
Change-Id: I58cc03ae50f082f75e9ed181e0f0401f5890910b
2020-02-25 13:24:45 -08:00
Evan Rosky
73a7fe9479 Clean-up old docked-stack implementation from WM
Bug: 133381284
Test: Existing tests pass. Manually use sysui
Change-Id: I44155d74df1489fa391c60a05d1f8098986cefb7
2020-02-25 21:13:16 +00:00
TreeHugger Robot
10398d29f3 Merge "Atom for when fgs accesses appop" into rvc-dev 2020-02-25 19:59:16 +00:00
Peter Kalauskas
81a320279e Merge changes from topic "new-task-snapshots-rvc-dev" into rvc-dev
* changes:
  Disable reduced scale if reduced scale config is 0
  Store original task width and height instead of scale
2020-02-25 18:29:50 +00:00
Samuel Fufa
086e11fdb6 Merge "Clear registered prediction callbacks on destroy" into rvc-dev 2020-02-25 18:08:32 +00:00
Adam Bookatz
38767932a2 Atom for when fgs accesses appop
statsd logs when an sensitive appop is accessed while a foreground
service is held. These appops include
OP_FINE_LOCATION
OP_COARSE_LOCATION
OP_RECORD_AUDIO
OP_CAMERA

It logs the number of times each of these appops is requested per session
during which the uid holds any foreground service.
Appops requested while the app's process state is TOP are ignored.

Also, the pre-existing ForegroundServiceStateChanged atom has an
additional field that logs whether the fgs is considered 'in-use' in the
context of being allowed while-in-use permissions.

Bug: 149497535
Test: atest UidAtomTests#testForegroundServiceState UidAtomTests#testForegroundServiceAccessAppOp
Test: manually monitor: adb shell cmd stats print-logs && adb logcat -v uid -s statsd | grep "statsd  : {" | egrep '\((60|256)\)'

Change-Id: I991a427dc2ab00399188b10b266ab2d9aa92696d
Merged-In: I991a427dc2ab00399188b10b266ab2d9aa92696d
(cherry picked from commit 0c8637c067)
2020-02-25 17:09:48 +00:00
Makoto Onuki
9577cd78ff Merge "Squash same ApplicationInfo's in Parcel" into rvc-dev 2020-02-25 15:17:14 +00:00
atrost
c1877300d3 Cache binder calls in CompatChanges
Cached call values are kept in ChangeIdStateCache (per-process cache).
Use "cache_key.is_compat_change_enabled" system property to
invalidate the cache (i.e. any value different from the last observed
will trigger an invalidation).
Any process can read that property, but only system server can change it.

Rolling forward the original caching with invalidating the cache upon
package install/update.
Tested fix locally by using the API in SoftRestrictedPermissionPolicy.java,
and running android.permission2.cts.RestrictedStoragePermissionSharedUidTest
which installs some apps with the same uid, which modifies the result of
isChangeEnabled. With the additional cache invalidation the test passes.

ToDo: add CTS test for the caching.

Bug: 140441727
Test: atest PlatformCompatTest
Test: atest CompatConfigTest
Test: atest CompatChangesTest
Test: atest PlatformCompatGating
Change-Id: I0265df1c427b43592e4f4d32fe9cfeb8fbc1bfa9
2020-02-25 13:20:10 +00:00
Makoto Onuki
6d81a5f569 Merge "Revert "Add WTF when a system server wrapper can't be found"" into rvc-dev 2020-02-25 12:53:58 +00:00
Zhuoyao Zhang
3495b81006 Revert "Add WTF when a system server wrapper can't be found"
This reverts commit 2cddb8a891.

Reason for revert: break app compat test b/149923038

Bug: 149923038
Change-Id: Ibace06f704595d40a4439c0bdfea55d11294ba77
2020-02-25 12:53:29 +00:00