Commit Graph

17429 Commits

Author SHA1 Message Date
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
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
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
Galia Peycheva
641e2e6361 Create DreamManager System Server TestApi
Bug: 141771803
Bug: 133216167

Test: atest DreamManagerServiceTests
Test: make checkbuild

Merged-In: I937061138bc8ccaf4475674f00331c3fe1c5a495
Change-Id: I937061138bc8ccaf4475674f00331c3fe1c5a495
(cherry picked from commit 4467c53c11)
2020-02-25 12:32:02 +00:00
Galia Peycheva
a72d7e53e6 Merge changes Id71b4cbc,I8dff0a12,Ife3d1390 into rvc-dev
* changes:
  Add startDreamActivity request verification
  Make DreamService use an Activity
  Clean up dreamland
2020-02-25 10:11:21 +00:00
Galia Peycheva
6861e91b84 Make DreamService use an Activity
Currently, the DreamService uses a floating Window to display the
content of the dream on the screen. This introduces difficulties in the
interactions with the Assistant application, which is an activity.
By design, if the Assistant is invoked while the device is dreaming, the
Assistant should be shown on top. However, since floating windows are
always drawn on top of all activities, the Assistant can't be shown on
top of the Dream.

Here, we migrate the implementation of the DreamService to use an
Activity (DreamActivity). Since the screensaver application is not part
of the framework, we can't declare the activity in their AndroidManifest.xml.
Therefore, we start the dream activity with a dedicated method in
ActivityTaskManagerService.

Bug: 133216167
Test: 1. m && ./vendor/google/tools/flashall
      2. Go to Settings > Device Preferences > Screensaver > Start now
      3. Verify dream appears
      4. Click any key to wake up the dream
      5. Verify that dream disappears

Merged-In: I8dff0a124cd1b41fb925a73528305431b49ee06d
Change-Id: I8dff0a124cd1b41fb925a73528305431b49ee06d
(cherry picked from commit 148478a85e)
2020-02-25 07:56:28 +00:00
TreeHugger Robot
0cbb2687ed Merge "Move PiP animation to SysUI package" into rvc-dev 2020-02-25 03:10:24 +00:00
Makoto Onuki
2d80ca09fc Squash same ApplicationInfo's in Parcel
ApplicationInfo now automatically tries to "squash" the same instances in a
Parcel.

NOTE: This CL still does *not* optimize the package manager APIs that return a
list. e.g. PM.queryContentProviders() still return duplicate AppInfo's.
We can optimize them by making ParcelableListSlice call "allowSquashing",
but that *could* have negative side effects, so I'm not doing it in this CL.
I think we can do that for S.

Bug: 148588589
Test: atest CtsContentTestCases # except for two preexsiting failures:
- android.content.pm.cts.PackageManagerTest#testGetIcon
- android.content.pm.cts.PackageManagerTest#testGetPreferredActivities

Test: Use the debugger and make sure bindApplication() is not receiving
duplicate AppInfo's in the provider list.

Change-Id: I3ba2c047a469169340c0f75c36bdfd394bc5d627
(cherry picked from commit 7d09275d70)
2020-02-24 22:22:13 +00:00
Hongwei Wang
85cf41fcc3 Move PiP animation to SysUI package
The bounds animation is cleaned up within window manager and it's now
the SysUI component listening on callbacks from TaskOrganizer for
entering to and exiting from PiP mode.

Additionally, the expand and move of the PiP window is now part of SysUI
as well.

Known issues:
- Black background when in transition from PiP to fullscreen. The
wallpaper gets into hidden state too early
- App gets into PiP mode too early when entering PiP, need to defer the
configuration change sent to app in this case

Bug: 146594635
Bug: 148198539
Bug: 138144750
Bug: 149569903
Test: atest PinnedStackTests
Test: atest PipAnimationControllerTest
Test: atest RecentsAnimationTest
Test: atest RecentTasksTest
Test: atest com.android.server.wm.ActivityStarterTests
Merged-In: Id0c8ce03fa26952daf5e3687b18b2eb2375b7d20
Change-Id: Id0c8ce03fa26952daf5e3687b18b2eb2375b7d20
2020-02-24 21:16:20 +00:00
Peter Kalauskas
84f02a81e8 Disable reduced scale if reduced scale config is 0
Change reduced scale implementation to toggle on/off based on
config_lowResTaskSnapshotScale=0 instead of ro.config.low_ram=true

Also, only use _reduced.jpg if reduced scale is enabled.  Previously,
for task snapshots, [0-9]+_reduced.jpg would be used if reduced scale
was disabled, and [0-9]+.jpg would never be used. This patch swaps that
behavior to make the underlying system more intuitive.  Now, if reduced
snapshots are disabled, store the task snapshot in [0-9]+.jpg and never
use [0-9]+_reduced.jpg.

Also, store low-res snapshots at config_lowResTaskSnapshotScale.
Prevously, low-res snapshots were stored at lowResScale * highResScale

Test: TaskSnapshotCacheTest
Test: TaskSnapshotControllerTest
Test: TaskSnapshotPersisterLoaderTest
Test: TaskSnapshotSurfaceTest
Bug: 148099851
Bug: 142063079
Change-Id: I5a0d58766347d875eaec138820323063aa1c2988
2020-02-24 21:02:03 +00:00
Peter Kalauskas
fe0a413a60 Store original task width and height instead of scale
Store the original task snapshot size instead of the scale from which
the bitmap was saved. This simplifies the logic around restoring and
saving from the proto, as both the reduced scale and full scale
snapshots make use and share the same state.

Also remove scale from TaskSnapshot, and remove and reducedScale from
TaskSnapshot.Builder.

Test: TaskSnapshotCacheTest
Test: TaskSnapshotControllerTest
Test: TaskSnapshotPersisterLoaderTest
Test: TaskSnapshotSurfaceTest
Bug: 148491788
Bug: 148617404
Bug: 142063079
Change-Id: I1dccaba87c3d8b95bf4156f41f9fd5d40019f675
2020-02-24 21:01:03 +00:00
Samuel Fufa
191149a4d0 Clear registered prediction callbacks on destroy
destroy() removes callbacks from AppPredictionManagerService but not
from mRegisteredCallbacks.

Bug: 149388856
Test: manual
Change-Id: Id08d6b20362486bd1640310c64da35e0382d9b5e
2020-02-24 19:06:21 +00:00
Julia Reynolds
229684b01a Address api feedback
Test: make
Fixes: 150008110
Change-Id: I5163cd49b11444e856cd9bd8ae2fd634da5f6a39
2020-02-23 20:44:26 -05:00
TreeHugger Robot
d566d02ff3 Merge "Rename full and reduced scale configs" 2020-02-21 23:28:35 +00:00
Evan Severson
2aa3230ca0 Merge "Add method to give a permission revoke a reason" 2020-02-21 23:16:09 +00:00