Commit Graph

5576 Commits

Author SHA1 Message Date
Tej Singh
008ecd3de0 Merge "DiskStats Westworld Migration" 2018-08-27 18:58:06 +00:00
Dianne Hackborn
8c76d91bd2 Throttle requests to ActivityManager.getProcessMemoryInfo().
This is very expensive and needs to run in the system process, we
don't want apps abusing it.

Also don't allow apps to get information about anything but their
own process, unless they have the appropriate privileged permissions.

Bug: 112537519
Test: manual
Change-Id: I01997d6f888341e8eb2afe6a69545dd5be013744
2018-08-26 18:19:07 -07:00
Zhi An Ng
82e3988254 Merge "Revert "Throttle requests to ActivityManager.getProcessMemoryInfo()."" 2018-08-25 00:23:47 +00:00
Bill Napier
d7d338f359 Revert "Throttle requests to ActivityManager.getProcessMemoryInfo()."
This reverts commit 1f3b0302fd.

Reason for revert: broke SDK builds.  See ab/4976218

Change-Id: Id532e20eed8e13735a09cca5affc92005b685744
2018-08-24 21:13:13 +00:00
Sudheer Shanka
ae6d1c9a28 Merge "Create sandboxes for newly installed apps." 2018-08-24 21:06:29 +00:00
Dianne Hackborn
1f3b0302fd Throttle requests to ActivityManager.getProcessMemoryInfo().
This is very expensive and needs to run in the system process, we
don't want apps abusing it.

Also don't allow apps to get information about anything but their
own process, unless they have the appropriate privileged permissions.

Bug: 112537519
Test: manual
Change-Id: I103a11f8d5b49fd4536795ea52c05de297698cb5
2018-08-24 11:27:50 -07:00
Sudheer Shanka
6d7e402a50 Merge "Allow some apps to get full access to external storage." 2018-08-24 04:00:25 +00:00
Anton Hansson
a101ff0571 Merge "Support /product-services partition" 2018-08-22 13:58:00 +00:00
Sudheer Shanka
98cb3f09fa Allow some apps to get full access to external storage.
Apps with WRITE_MEDIA_STORAGE permission will get
full access to external storage.

Bug: 111890351
Test: manual

Change-Id: Icbfe1f68c0bfca77bdc557e9903ded45994f5945
2018-08-21 19:25:08 -07:00
Tej Singh
f154cf0189 DiskStats Westworld Migration
Migrates the existing information collected by diskstats to westworld.
Creates 4 pulled atoms, 2 of which read from a cached file produced by
DiskStatsLoggingService. Most of the logic is taken from
DiskStatsService.java.

Test: Manually verified information is the same as dumpsys. Will look
into cts as well.

Change-Id: I9818ac787de46514bc09ab3887cbfaec6cff273c
2018-08-21 10:35:39 -07:00
TreeHugger Robot
4a6821e9c4 Merge "Update documentation that RSS can be obtained as the third value in the array" 2018-08-20 21:32:25 +00:00
Rafal Slawik
4d078966ef Update documentation that RSS can be obtained as the third value in the array
Test: Code compiles, only Javadoc and parameter name change
Change-Id: I15cc7bb66ff9377c3994fcf684219edfbbb4596b
2018-08-20 19:49:49 +01:00
TreeHugger Robot
9b3803f4bb Merge "Keep track of the last sleep reason" 2018-08-20 18:30:52 +00:00
Dario Freni
2bef1768a8 Support /product-services partition
This CL is largely an adaptation of Change-Id
I16175933cebd9ec665d190cc5d564b5414a91827 . I also used the same way for
testing the change.

This CL will support the followings.
- installing a RRO package for framework from /product-services/overlay
- installing apps from /product-services/app
- installing priv-apps from /product-services/priv-app
- installing permissions from
  /product-services/etc/[default-permissions|permissions|sysconfig]

Bug: 80741439
Test: `mm` under frameworks/base/tests/[libs|privapp]-permissions
  adb sync && adb reboot
  adb shell cmd package list libraries
    => confirmed com.android.test.libs.product_services library
  adb shell cmd package dump \
    com.android.framework.permission.privapp.tests.product_services
    => confirmed that the package is a priv-app

  And I moved vendor/overlay/framework-res__auto_generated_rro.apk
  into system/product-services/overlay/ on taimen, and I confirmed that the
  RRO was installed properly.

Change-Id: I7a6a30bf8e8db9f2738594d187bb9148f138b8da
(cherry picked from commit a4af41736894bd3bf5bdc2a279acbeed2a24dd3d)
2018-08-17 16:34:03 +00:00
Luke Huang
7a8cd2aa0b Merge "Clatd-related commands porting" am: 3b9ae0ae48 am: 198936ce60
am: eaa77a20e8

Change-Id: I8ee68435161734fb7abfd63b3085dae6535b6a0b
2018-08-15 04:50:37 -07:00
Luke Huang
eaa77a20e8 Merge "Clatd-related commands porting" am: 3b9ae0ae48
am: 198936ce60

Change-Id: I6c094b45dd4535b9bfc3438d8f376a3c0b320d48
2018-08-15 00:56:39 -07:00
Luke Huang
3b9ae0ae48 Merge "Clatd-related commands porting" 2018-08-15 03:38:50 +00:00
Steven Moreland
b8e33ec740 Merge "Clarify NativeHandle.java dup documentation." am: 5afc5894ad am: 93483d3671
am: e4086dfff6

Change-Id: Ib68770ddb7ed4750e648c258409efedc0b62ad7d
2018-08-14 15:03:47 -07:00
Steven Moreland
e4086dfff6 Merge "Clarify NativeHandle.java dup documentation." am: 5afc5894ad
am: 93483d3671

Change-Id: Ia34d72de62be27ebda2427f0d5a6e1b7edf25a6e
2018-08-14 14:54:07 -07:00
Jeff Sharkey
9b191c2415 Merge "Methods to translate sandbox paths." 2018-08-14 21:39:15 +00:00
Jeff Sharkey
eb0fb4efba Merge "Start defining strongly-typed storage permissions." 2018-08-14 21:38:10 +00:00
Sudheer Shanka
8ff30b1317 Create sandboxes for newly installed apps.
Bug: 111890351
Test: manual
Change-Id: I8b47e8a9fd1122b2d55c16189f05f5a32a22d16b
2018-08-14 11:21:44 -07:00
Steven Moreland
bc600d3282 Merge "Implementing support for HIDL native handles in Java" am: 1e1d8d2485 am: 6580802918
am: 4a6566440f

Change-Id: I649a10172d93beae9063ec2170e60aa4967ba0be
2018-08-14 10:16:06 -07:00
Steven Moreland
4a6566440f Merge "Implementing support for HIDL native handles in Java" am: 1e1d8d2485
am: 6580802918

Change-Id: I93fb4f36c56215a5a8018248d58c8dc17766fc19
2018-08-14 10:05:21 -07:00
Jeff Sharkey
5790af08f8 Methods to translate sandbox paths.
System components (like MediaProvider) will live in a mount namespace
that has a view of the "real" shared storage device, and normal apps
will have "sandboxed" views of the shared storage device.  (Parallel
changes are implementing these namespaces in vold and installd.)

The system components mentioned above will need to translate between
the two namespaces, so this change introduces methods that perform
that translation, along with a nice batch of tests to verify.

Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/StorageManagerServiceTest.java
Bug: 111893193, 111892833, 111268862
Change-Id: Iae91a44ce09eb33d6cd9b90f6c7b4f88c8cd12f0
2018-08-14 10:56:43 -06:00
Jeff Sharkey
4aacd8b668 Start defining strongly-typed storage permissions.
We now have separate permissions that correspond to the various
MediaStore tables:

-- READ/WRITE_MEDIA_AUDIO
-- READ/WRITE_MEDIA_VIDEO
-- READ/WRITE_MEDIA_IMAGES

From a product point-of-view, Images and Videos will being treated as
a single permission group of "Visual" media in Q.  We're also defining
two other special permissions:

-- ACCESS_MEDIA_LOCATION: indicating that the app can see any
geographic location related metadata associated with media, such
as being stored in the EXIF data.  We're willing to grant this under
the unbrella of the larger "Visual" runtime permission group, but we
still want apps to request it for full disclosure of their intent.

-- WRITE_OBB: can be held by app stores that need to deliver OBB
files into app-specific sandboxes to keep legacy apps working.

Test: manual
Bug: 111801780, 110228267, 111789719, 111892833
Change-Id: If28247efdd7ac185ad3c6cbceda2e6346c26d032
2018-08-14 09:11:18 -06:00
Joshua Baxter
bb287445fb Merge "docs: fixed typo" into pi-dev am: 3621bf192c
am: 5d51a0d519

Change-Id: Ic8a148326d8f9ed57395987b897bb966ff47cba6
2018-08-13 16:12:47 -07:00
Joshua Baxter
5d51a0d519 Merge "docs: fixed typo" into pi-dev
am: 3621bf192c

Change-Id: I16fff80e6624f18bb0c6dbf2da210a40fec069c3
2018-08-13 15:57:41 -07:00
Joshua Baxter
3621bf192c Merge "docs: fixed typo" into pi-dev 2018-08-13 22:43:17 +00:00
Steven Moreland
12a2c0ae3f Clarify NativeHandle.java dup documentation.
close must also be called.

Bug: 35098567
Test: N/A
Change-Id: I4d03effc82d7f6de7ca785ae4d12868ccc4ceddd
2018-08-13 14:31:20 -07:00
Nirav Atre
9850dd9751 Implementing support for HIDL native handles in Java
This change implements the equivalent of the C++ native_handle_t type in
Java. Similar to the C++ type, the NativeHandle class wraps an arraylist
of FileDescriptor objects, along with a raw data stream (integer array).

Bug: 35098567
Test: Ran m, hidl_test (C++ and Java). Functionality tests are included
in a separate CL.

Change-Id: Ic53f9a49ae17ce5708577a586230126ab0e222c7
2018-08-13 14:31:17 -07:00
Calin Tataru
a380572cf6 Keep track of the last sleep reason
This is needed to implement Doze for Android TV. The DeviceIdleController needs to know whether the screen turned off due to a timeout and adjust its own timeouts accordingly. This is particularly important if the screen off timeout is longer than 30 minutes which is how long the DeviceIdleController normally waits before going from STATE_INACTIVE to STATE_IDLE_PENDING.

Test: make -j
Bug: 111443261
Change-Id: Icd6a7ba43077fed3ac6ac9f77b5a017c42138337
2018-08-13 11:39:28 +00:00
Martijn Coenen
b04b59beab Merge "BinderProxy dump: distinguish between empty descriptor and dead remote." am: 2e9e624c76 am: cbd295ea50 am: 23920a0da9
am: d909c7d1d0

Change-Id: Ia52ee5d128a3269c5ac34478ade5cc768cc43bb5
2018-08-10 01:48:55 -07:00
Martijn Coenen
d909c7d1d0 Merge "BinderProxy dump: distinguish between empty descriptor and dead remote." am: 2e9e624c76 am: cbd295ea50
am: 23920a0da9

Change-Id: I383846f94ac467305710ec45902d601dd0379e96
2018-08-10 01:38:34 -07:00
Martijn Coenen
3796b0d6a6 BinderProxy dump: distinguish between empty descriptor and dead remote.
getInterfaceDescriptor() will return an empty string when the call
to retrieve it into the remote process fails. Proxies to a dead binder
process then show up as having an empty descriptor in the proxy dumps,
and can't be distinguished from live proxies with an empty descriptor.

Instead, if we get an empty string, check if the proxy is still alive,
so we can more accurately dump. This will make it much easier to find
proxy leaks to dead binder nodes.

Bug: 109888955
Test: adb shell dumpsys activity binder-proxies
Change-Id: Ib37ec004f38c99743ffb4a62101c12626b649e5d
2018-08-09 16:19:45 +02:00
Makoto Onuki
7388dd5419 Merge "Add a hidden API for fgetfilecon(3)" am: 9b04b2fd0b am: c5d7fdef72 am: 39ddb130ec
am: 09663b4ada

Change-Id: I88f58139f5539b2f46256f1f522ad3d05ce47b93
2018-08-08 17:19:13 -07:00
Makoto Onuki
09663b4ada Merge "Add a hidden API for fgetfilecon(3)" am: 9b04b2fd0b am: c5d7fdef72
am: 39ddb130ec

Change-Id: Ib33c1e9f57ce727d6ecb1a5f799c0570c6b32208
2018-08-08 13:05:36 -07:00
Makoto Onuki
9b04b2fd0b Merge "Add a hidden API for fgetfilecon(3)" 2018-08-08 14:51:19 +00:00
TreeHugger Robot
c0819d2066 Merge "Add an optional reason field to vibrator service" 2018-08-07 19:42:58 +00:00
Andrew Solovay
d708a4564f Merge "docs: Adding links to "about version" pages" into pi-dev am: 97229ed3e8
am: 28ff310752

Change-Id: Iaae04ae1fdbd09a6a83716bb1d3acc75ac0ed356
2018-08-07 12:17:49 -07:00
Andrew Solovay
28ff310752 Merge "docs: Adding links to "about version" pages" into pi-dev
am: 97229ed3e8

Change-Id: Ib692819ddf8ef786b5a44c9c8b3e35909f9ebc72
2018-08-07 12:02:00 -07:00
Andrew Solovay
a861ff7a64 docs: Adding links to "about version" pages
For the various Build.VERSION_CODES.<version_name> constants, adding
a link to the appropriate "about this release" page in
/about/versions/ , if there is one.

Staged doc to:
http://go/dac-stage/reference/android/os/Build.VERSION_CODES

Bug: 80546406
Test: make ds-docs
Change-Id: If363445c938d325172da6beeed25e821121c5539
2018-08-06 16:13:10 -07:00
Makoto Onuki
9700015b36 Add a hidden API for fgetfilecon(3)
Test: manual test with the debug code
Bug: 111381531
Change-Id: Ie9d6fe9e737b852cc825990a83bda6eb95cf1160
2018-08-06 14:31:45 -07:00
Luke Huang
69369f3391 Clatd-related commands porting
Test: runtest frameworks-net passes
Test: manual testing of clatd works
Change-Id: Ia7ee6721870f9fc8f1490e758198a01c452ebac6
2018-08-02 15:51:41 +08:00
Sudheer Shanka
b19b3f1a68 Merge "Pass the packageName to zygote when starting a new process." 2018-07-31 01:02:17 +00:00
Sudheer Shanka
154fe3f6a7 Pass the packageName to zygote when starting a new process.
This packageName is passed so that the process initialization
after the zygote fork can mount appropriate package sandbox.

Bug: 111890351
Test: n/a
Change-Id: I99d6c1b53fffd53d7387dc807106efe5e1dc9b07
2018-07-30 14:44:26 -07:00
TreeHugger Robot
99334bf938 Merge "Encourage creating Binder tokens with a descriptor." 2018-07-30 15:31:28 +00:00
Martijn Coenen
d2c86ab546 Encourage creating Binder tokens with a descriptor.
Binder tokens (Binder objects without an attached interface) are used
a lot with Android. These tokens don't have an interface descriptor,
which means that proxies (references) to these tokens are impossible
to identify when looking at a heap dump.

To make that easier, introduce a new constructor for Binder that allows
the caller to specify a descriptor.

Bug: 109888955
Test: builds, boots
Change-Id: I18fd00483abc29edf87f84945323a10fe4f6cd42
2018-07-30 12:15:58 +00:00
Alexey Kuzmin
e1f06b88e8 Add an optional reason field to vibrator service
Test: Run vibration test, see reason written to log and trace.
Bug: 109654229
Change-Id: I13db6968c125e7c2b2483a14faad5b6ea9b4cda6
2018-07-27 20:32:53 +01:00
Olivier Gaillard
289ba40237 Adds an Observer interface to observes binder API calls.
This is the first step to move BinderCallsStats implementation to the
server package in order to have an implementation more specific to the
system server (tracking charger on/off).

Removes the volatile keywords in BinderCallsStats.

Also exposes a clean API to StatsCompanionService instead of
BinderCallsStats directly.

Test: unit test
Change-Id: Ied98c555acc8489420104098561b4608346509b5
2018-07-25 21:20:59 +00:00