Commit Graph

6842 Commits

Author SHA1 Message Date
Steven Moreland
15acebb039 Merge changes from topic "wait-for-aidl" into stage-aosp-master am: d6b5bdf07d am: 4955049ace am: 11912440c5
am: fac32905f9

Change-Id: I52ad863baa35828408b61a7f2ec1d7fb4f67c121
2019-08-30 12:08:45 -07:00
TreeHugger Robot
8e6a69c3a2 Merge "Allow apps to collect which appops were noted" 2019-08-30 18:53:22 +00:00
Steven Moreland
fac32905f9 Merge changes from topic "wait-for-aidl" into stage-aosp-master am: d6b5bdf07d am: 4955049ace
am: 11912440c5

Change-Id: I9997004285d1299742c50b222edf9301be09fc98
2019-08-30 11:48:29 -07:00
Steven Moreland
11912440c5 Merge changes from topic "wait-for-aidl" into stage-aosp-master am: d6b5bdf07d
am: 4955049ace

Change-Id: If720ddc218387369966a28f1c21c6f94ed75a74a
2019-08-30 11:31:23 -07:00
Steven Moreland
4955049ace Merge changes from topic "wait-for-aidl" into stage-aosp-master
am: d6b5bdf07d

Change-Id: Icf56545cd7f046d59841921a35f715e5b5812357
2019-08-30 11:18:26 -07:00
Steven Moreland
d6b5bdf07d Merge changes from topic "wait-for-aidl" into stage-aosp-master
* changes:
  PowerManagerService: use waitForService.
  ServiceManagerProxy: add APIs.
2019-08-30 17:54:37 +00:00
Aurimas Liutikas
488d37b2d0 Merge "Add missing nullability annotations." into stage-aosp-master am: 85c0a5a2be am: ed5beec21b
am: de0ebb082e

Change-Id: I60c55b6706e8d43121e8b2c7a35efff38668f66b
2019-08-30 08:54:38 -07:00
Aurimas Liutikas
de0ebb082e Merge "Add missing nullability annotations." into stage-aosp-master am: 85c0a5a2be
am: ed5beec21b

Change-Id: I202951d51820be47b9195734601830553215bdd7
2019-08-30 08:43:01 -07:00
Aurimas Liutikas
ed5beec21b Merge "Add missing nullability annotations." into stage-aosp-master
am: 85c0a5a2be

Change-Id: Ic9ea2b9840fbb678bbb6ab77038415581feba918
2019-08-30 08:35:52 -07:00
Philip P. Moltmann
2b08aafc14 Allow apps to collect which appops were noted
If private user data is send to an app the data provider should note an
app-op. This change adds a new API AppOpsManager#setNotedAppOpsCollector
that allows an app to get notified every time such an private data access
happens.

This will allow apps to monitor their own private data usage. Esp. with
big, old apps, distributed teams or 3rd party libraries it might not always
be clear what subsystems access private data.

There are three different situations how private data can be accessed and
an app op is noted:

1. Private data access inside a two-way binder call.
E.g. LocationManager#getLastKnownLocation. When we start a two way
binder transaction, we remember the calling uid via
AppOpsManager#collectNotedAppOps. Then when the data providing code
calls AppOpsManager#noteOp->AppOpsManager#markAppOpNoted the noted
app-op is remembered in
AppOpsManager#sAppOpsNotedInThisBinderTransaction. Then when returning
from the binder call, we add the list of noted app-ops to the
reply-parcel via AppOpsManager#prefixParcelWithAppOpsIfNeeded. On the
calling side we check if there were any app-ops noted in
AppOpsManager#readAndLogNotedAppops and then call the collector while
still in the binder code. This allows the collector e.g. collect a stack
trace which can be used to figure out what app code caused the
private data access.

2. Very complex apps might do permissions checks internal to themself.
I.e. an app notes an op for itself. We detect this case in
AppOpsManager#markAppOpNoted and immediately call the collector similar
to case (1).

3. Sometimes private data is accessed outside of a two-way binder call.
E.g. if an app registers a LocationListener an app-op is noted each time
a new location is send to the app. In this case it is not clear to the
framework which app-action triggered this app-op-note. Hence the data
provider has to describe in a AsyncNotedAppOp object when an why the
access happened. These objects are then send to the system server via
IAppOpsService#noteAsyncOp and then the collector in the app. There are
rare cases where a private data access happens before the app is running
(e.g. when a geo-fence is triggered). In this case we cache a small
amount of AsyncNotedAppOps (in AppOpsService#mUnforwardedAsyncNotedOps)
and deliver them when the app is ready for these events (in
AppOpsManager#setNotedAppOpsCollector).

Test: atest CtsAppOpsTestCases (includes new tests covering this
                                functionality)
Bug: 136505050
Change-Id: I96ded4a8d8d9bcb37a4555d9b1281cb57945ffa9
2019-08-30 08:18:50 -07:00
Aurimas Liutikas
34c56bcf4a Merge "Add missing nullability annotations." 2019-08-30 15:14:37 +00:00
Kevin Hufnagle
c279bcff22 Merge "docs: Improved tick/click effect descriptions" into qt-dev am: a7496671da am: 40a40c73d7 am: 13a441d648
am: 9426bb197e

Change-Id: I0836ec3671ae306796a1f3f58b1eefd9b3537cfe
2019-08-29 19:25:03 -07:00
Kevin Hufnagle
9426bb197e Merge "docs: Improved tick/click effect descriptions" into qt-dev am: a7496671da am: 40a40c73d7
am: 13a441d648

Change-Id: I6a6521d4c67013e1f0cc5a10698105a4c55eb145
2019-08-29 19:10:49 -07:00
Kevin Hufnagle
13a441d648 Merge "docs: Improved tick/click effect descriptions" into qt-dev am: a7496671da
am: 40a40c73d7

Change-Id: I4227eebb2a74fbcecdc15dff56d26bdbbbaca027
2019-08-29 19:00:15 -07:00
Kevin Hufnagle
bef7378fd6 Merge "docs: Improved tick/click effect descriptions" into qt-dev am: a7496671da
am: 40a40c73d7

Change-Id: I4b5ca0ab5e278c9d465f6386cfc1c173233597af
2019-08-29 19:00:07 -07:00
Kevin Hufnagle
6bf8f080a1 Merge "docs: Improved tick/click effect descriptions" into qt-dev
am: a7496671da

Change-Id: Id733bdd016dc496ea14762cc48e15e9ae38a1d51
2019-08-29 18:54:25 -07:00
Kevin Hufnagle
40a40c73d7 Merge "docs: Improved tick/click effect descriptions" into qt-dev
am: a7496671da

Change-Id: Id33aa9b90e3a62751a9fa7a4074a44737d7a95e3
2019-08-29 18:52:02 -07:00
Aurimas Liutikas
4d1699da48 Add missing nullability annotations.
To prepare for enabling MissingNullability Metalava check this CL
works on adding missing nullability issues that metalava flags if
we tell it to flag new things since API 29.

This is not a complete CL, mostly addresses public api and
toString/equals for @SystemApi

Exempt-From-Owner-Approval: Large scale nullability clean up
Bug: 124515653
Test: make -j checkapi
Change-Id: I109260842cfc25f06e40694997fcbb4afa02c867
2019-08-29 17:15:44 -07:00
Aurimas Liutikas
00be951a08 Add missing nullability annotations.
To prepare for enabling MissingNullability Metalava check this CL
works on adding missing nullability issues that metalava flags if
we tell it to flag new things since API 29.

This is not a complete CL, mostly addresses public api and
toString/equals for @SystemApi

Exempt-From-Owner-Approval: Large scale nullability clean up
Bug: 124515653
Test: make -j checkapi
Merged-In: I109260842cfc25f06e40694997fcbb4afa02c867
Change-Id: I109260842cfc25f06e40694997fcbb4afa02c867
2019-08-30 00:14:44 +00:00
Steven Moreland
3ffad04add ServiceManagerProxy: add APIs.
This class is hanging around for UnsupportedApiUsage. Adding additional
APIs here which do nothing in order to satisfy the inherited interface.

Bug: 136027762
Test: compile :)
Change-Id: I47b57c6876afd77b47083bf905ade9951ff0b42d
2019-08-29 13:53:47 -07:00
Kevin Hufnagle
86b17d2523 docs: Improved tick/click effect descriptions
Test: make ds-docs -j32

Bug: 139888074
Change-Id: I939aaa4cf81ddab1705611222c12a60823493d38
2019-08-29 19:30:42 +00:00
Zim
42f1e9f731 Add StorageSessionController
The StorageSessionController has a StorageUserConnection to represent
the binding between the StoragemanagerService and the
ExternalStorageService for a user.

A StorageUserConnection can have multiple Sessions each representing a
mount for the user. The StorageUserConnection has an
ActiveConnection representing the active binding to the
ExternalStorageService.

If the ExternalStorageService goes down, the ActiveConnection becomes
'inactive' but the StorageManagerService will be notified to reset the
mount state of the device with the help of vold which will 're-activate'
the ActiveConnection.

This reset will among other things, kill any apps holding an open fd
on the FUSE mount and remount the FUSE mount, getting a new FUSE fd
as a result. The StorageSessionController will once again be notified
of new volume mounts and start sessions for them

Bug: 135341433
Test: adb shell setprop persist.sys.fuse && adb reboot && adb shell ls
/sdcard
Test: adb shell am crash com.android.providers.media && adb shell ls /sdcard
Change-Id: I72841a1d8012b1ca1cc88f29cb75127ea627c093
2019-08-29 00:02:52 +01:00
TreeHugger Robot
84bb274081 Merge "Improved AbstractMasterSystemService to handle supported user types." 2019-08-28 18:50:25 +00:00
Makoto Onuki
72fcdcde4c Merge "Remove IMaintenanceActivityListener (which was unused)" 2019-08-28 16:18:13 +00:00
Luke Huang
e0a0963542 Merge "Support enable/disable dns forwarding of dnsmasq when start tethering" am: 6fecb94292 am: a3ddee80fd am: f03f803aaf am: f9b00a4427
am: d838e6d186

Change-Id: Ie9850a614ab191a709e98795f8e9301db1321108
2019-08-28 06:54:02 -07:00
Luke Huang
d838e6d186 Merge "Support enable/disable dns forwarding of dnsmasq when start tethering" am: 6fecb94292 am: a3ddee80fd am: f03f803aaf
am: f9b00a4427

Change-Id: I85c715b4fe213d83e4d31140b0e39bed426226d0
2019-08-28 06:42:34 -07:00
Luke Huang
f9b00a4427 Merge "Support enable/disable dns forwarding of dnsmasq when start tethering" am: 6fecb94292 am: a3ddee80fd
am: f03f803aaf

Change-Id: I1336a04e1a7b1655354f4d3d4b93897e2db4fdbe
2019-08-28 06:30:42 -07:00
Luke Huang
f03f803aaf Merge "Support enable/disable dns forwarding of dnsmasq when start tethering" am: 6fecb94292
am: a3ddee80fd

Change-Id: If5a280508dcc95df911d1d72671857a8c58bbbd4
2019-08-28 06:18:40 -07:00
Luke Huang
a3ddee80fd Merge "Support enable/disable dns forwarding of dnsmasq when start tethering"
am: 6fecb94292

Change-Id: I8f5c67fa1e045c9fd4a5e7a753df285d1111c1d2
2019-08-28 06:06:44 -07:00
Makoto Onuki
78ebcf5b11 Remove IMaintenanceActivityListener (which was unused)
Bug: 137763703
Test: treehugger
Change-Id: I0a1839eff52b69a8711b44350523b91cecfa3d8d
2019-08-27 12:01:10 -07:00
Lucas Dupin
8968f6a9e9 IPC StrictMode
This CL introduces a way of blocking IPCs on the main thread.
This is enforced by StrictMode, and enabled on tests and eng
builds.

All current blocking IPCs were whitelisted and bugs will be
filed, in order to fix them for R.

Bug: 139360025
Test: adb logcat
Test: atest SystemUITests
Change-Id: I45af2619605ee36b6bae83ef080272c62754b654
2019-08-26 17:45:30 -07:00
Felipe Leme
987655d049 Improved AbstractMasterSystemService to handle supported user types.
Also changed AutofillManagerService and ContentCaptureManagerService to take advantage of these methods.

Test: manual verification
Test: atest CtsAutoFillServiceTestCases CtsContentCaptureServiceTestCases # on phone and Automotive

Bug: 133242016

Change-Id: I3e7f9d65a6ef1e8e6ec886a41b35733e463a6389
2019-08-26 10:51:03 -07:00
Makoto Onuki
3cad27c294 Merge "Move DeviceIdle to the JS apex" 2019-08-26 17:40:10 +00:00
Mike Ma
8a88548504 Merge "Add an API to dump incident report for dumpstate" 2019-08-24 06:16:15 +00:00
Xin Li
a770df1d2e DO NOT MERGE - Merge build QP1A.190711.019 into stage-aosp-master
Bug: 139893257
Change-Id: I94fce9c5c0b35cbb88ee27fa4cd037927964d2cd
2019-08-24 05:22:23 +00:00
Peiyong Lin
ac373cf26e Merge "Add manifest flag to enable prerelease driver." into qt-qpr1-dev am: bc80fff0a4
am: 88f982aeff

Change-Id: I9950a70596fa64f90a9371d5f208aca8a0bf9854
2019-08-23 20:02:31 -07:00
Makoto Onuki
52c24b377b Move DeviceIdle to the JS apex
Test: atest cts/tests/tests/batterysaving/src/android/os/cts/deviceidle/DeviceIdleTest.java
Bug: 137763703
Change-Id: I836350c09f45f95afbf90b562ab1ceed75526498
2019-08-23 16:03:30 -07:00
Peiyong Lin
88f982aeff Merge "Add manifest flag to enable prerelease driver." into qt-qpr1-dev
am: bc80fff0a4

Change-Id: Ice63c7b63ddacac58cb1e2ab51df387cf820783c
2019-08-22 16:17:40 -07:00
Mike Ma
5a57d7989a Add an API to dump incident report for dumpstate
Instead of just relying on the regular iteration through the system
services inside dumpstate, add another API to IIncidentManager
dedicated for dumpstate.

- It is only callable by dumpstate() (check the calling uid)
- It has the same behavior as the current call inside dump()

Advantages:
- More explicit function name, right next to takeIncidentReport will
  make it easier to keep them in sync.
- Nobody else can call it, make security easier.
- If dumpstate calls it explicitly, it can skip the 10 second timeout
- The regular dump() call should provide debugging data about
  incidentd itself, for example timestamps for the most recent N
  incident reports taken and the current state of the work directory,
  allowing us to debug incidentd itself.

Bug: 137493082
Test: Manually trigger a bug report, and verify
      /proto/incident_log.proto in the zip file.

Change-Id: I19139c765b53ede63d3beb3ea3ac40ada1aba42d
2019-08-22 14:43:27 -07:00
Jeff Sharkey
ec19e9b107 Public APIs for ID-specific Uris, misc items.
We have getContentUri() for entire collections of items, but we
only have ID-specific overloads for some of the MediaStore classes;
let's get them all added for consistency.

Remove primary/secondary directory logic, which was replaced by
new RELATIVE_PATH column before Q launched.

Bug: 137890034
Test: atest --test-mapping packages/providers/MediaProvider
Exempt-From-Owner-Approval: trivial API refactoring
Change-Id: Iae4e7fe57adff071c35af459e31223a1fd05fef2
2019-08-22 14:43:24 -06:00
Peiyong Lin
7797b4de46 Add manifest flag to enable prerelease driver.
Add manifest flag to prevent applications from using prerelease driver
accidentally. In this patch we also allow any debuggable device build to load
prerelease driver for all non-system and non-privileged applications.

BUG: 138132808
Test: Verified with prerelease driver.
Change-Id: If0abc89f709c8e34bd83a5c09c3c2047300b5ef2
2019-08-22 10:38:41 -07:00
Luke Huang
b0d52464f1 Support enable/disable dns forwarding of dnsmasq when start tethering
Bug: 128782815
Test: built, flashed, booted
Change-Id: Ic6ee985b42cbe77e8f2208fba62108604fc7bbcf
2019-08-20 20:42:13 +08:00
PO HUNG CHEN
35fa063e89 Merge "Use Ashmem to reduce buffer copies" 2019-08-20 08:18:58 +00:00
Howard Chen
7bb18effb2 Use Ashmem to reduce buffer copies
Use android.os.MemoryFile to allocate Ashmem and use gsid.setAshmem and
gsid.commitGsiChunkFromAshmem to submit data.

Bug: 138976291
Test: adb shell am start-activity \
    -n com.android.dynsystem/com.android.dynsystem.VerificationActivity \
    -a android.os.image.action.START_INSTALL \
    -d file:///storage/emulated/0/Download/system.raw.gz \
    --el KEY_SYSTEM_SIZE $(du -b system.raw|cut -f1) \
    --el KEY_USERDATA_SIZE 8589934592

Change-Id: I6df718a8cc3f4e5835c9d20d0bf5bf8bb0daee22
2019-08-19 17:35:02 +08:00
Xin Li
1702a9da19 DO NOT MERGE - Merge pie-platform-release (PPRL.190801.002) into master
Bug: 139369544
Change-Id: I835905a51836e7218f0be8c25335b9548ae6b2d3
2019-08-13 16:36:37 -07:00
Felipe Leme
e5434c301b Initial implementation of system service optimizations for different type of users.
On R, we want to optimize boot time by not starting system services for some types of users,
like a headless system user (which is the case for Automotive)

As a "guinea pig", it optimizes VoiceInteractionService for headless system user, so the 3rd-party app
service is not bound for user 0 (and hence its process is not launched).

This change improves boot time on Automotive in about 100ms.

Test: atest CtsVoiceInteractionTestCases CtsAssistTestCases # on walleye and Automotive
Test: manual verification on logcat

Bug: 133242016
Fixes: 137878080

Change-Id: Ib0a902855e32691a1d00bfa77ee82c8e2430977c
2019-08-13 10:10:53 -07:00
Jing Ji
a736da8213 Add RSS to dumpsys meminfo
Include the RSS info into the meminfo output of dumpsys and
incident_report.

Bug: 117880513
Test: adb shell dumpsys meminfo
Test: cts-tradefed run cts-dev --module \
      CtsIncidentHostTestCases --test \
      com.android.server.cts.MemInfoIncidentTest
Change-Id: Id1058e279b7ca6925b59a6a523e0f0d14d830761
2019-08-09 22:57:50 +00:00
Makoto Onuki
7c730311ea Merge "Remove build time dependency from BatteryStats to JobParameters" 2019-08-09 20:38:34 +00:00
Jeff Sharkey
7c2a8686c6 Merge changes from topic "callz"
* changes:
  Expand ContentProviderOperation to support call().
  Add nullability annotations for current behavior.
2019-08-09 16:01:23 +00:00
Makoto Onuki
9111d1dcec Remove build time dependency from BatteryStats to JobParameters
In preparation of moving the jobscheduler framework code to its
own jar.

Bug: 138793378
Test: dumpsys batterystats  -c | grep jbc and make sure the line looks correct

Change-Id: I9938c99e37bd44e522e5f8d8e95772e69d5be492
2019-08-08 15:33:37 -07:00