Commit Graph

5560 Commits

Author SHA1 Message Date
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
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
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
Philip P. Moltmann
6c644e620d Always review permissions before <M app is started the first time
This splits the
- review permissions
- individually control permissions
- consent to manage wireleess (wifi + bluetooth)
properties.

Almost all code cares only for the first and it is now always true.
Hence a lot of code can be simplified.

Bug: 110431654
Test: atest PermissionsHostTest
      started pre-M app
Change-Id: I733cd476ccd0bf5eaa59e9a9506db34f57c6baee
2018-07-24 11:45:34 -07:00
Martijn Coenen
1d336da880 resolve merge conflicts of 80894b6063 to stage-aosp-master
BUG: None
Test: I solemnly swear I tested this conflict resolution.
Change-Id: I7c36f66c4bf9129c1b421290f82bdae83be6979e
Merged-In: If9dd6913868a34ea1e3d14fee1860a4ff368e06b
2018-07-24 20:04:57 +02:00
Martijn Coenen
f7e8f096d5 Make BinderProxy @hide public class.
To make some future refactoring easier.

Added some JavaDoc (mostly links to android.os.IBinder)
to make checkstyle happy.

Test: builds
Merged-In: If9dd6913868a34ea1e3d14fee1860a4ff368e06b
Change-Id: If9dd6913868a34ea1e3d14fee1860a4ff368e06b
(cherry picked from commit 03e6d923c5)
2018-07-22 15:04:08 +09:00
Josh Gao
ba5291868f Merge changes from topic "bionic_fdsan_java" am: bb352287c9 am: 1fad55e868 am: f28713990b
am: c671d623c4

Change-Id: I23613868a74b7b1dbd09a3325578c06b391780b5
2018-07-20 22:29:34 -07:00
Josh Gao
1fad55e868 Merge changes from topic "bionic_fdsan_java"
am: bb352287c9

Change-Id: Ib6c5ac9ffc7f9aa88749af1c0d66880a1c98a650
2018-07-20 21:14:33 -07:00
Josh Gao
5ada87388c ParcelFileDescriptor: support bionic's fd ownership tracking.
Also, delete a bunch of deprecated functions that are package-private,
and not called anywhere in the package.

Test: booted walleye
Change-Id: I728e63e7d6f9e1ba42644f93983cfcd6a2d2634c
2018-07-20 16:00:20 -07:00
Yifan Hong
58faaa09da IBatteryPropertiesRegistrar: remove unused functions
* Remove BatteryProperties
* Remove IBatteryPropertiesListener
* Remove IBatteryPropertiesRegistrar.(un)registerListener
  functions

Test: builds
Test: boots
Bug: 68724651
Change-Id: Ic9a9d337e5cb39784db1a2745297ef985dd31653
Merged-In: Ic9a9d337e5cb39784db1a2745297ef985dd31653
(cherry picked from commit dd0e942597)
2018-07-17 15:35:49 -07:00
John Reck
06efa7169a Merge "Expose async & counter publicly" 2018-07-17 16:46:56 +00:00
John Reck
d5a9dc06be Expose async & counter publicly
Also add some go-faster to the JNI

Before:
android.os.TracePerfTest:INSTRUMENTATION_STATUS: enabled_mean=13
INSTRUMENTATION_STATUS: enabled_median=13
INSTRUMENTATION_STATUS: enabled_min=13
INSTRUMENTATION_STATUS: enabled_standardDeviation=0
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: beginEndSection_mean=3849
INSTRUMENTATION_STATUS: beginEndSection_median=3850
INSTRUMENTATION_STATUS: beginEndSection_min=3829
INSTRUMENTATION_STATUS: beginEndSection_standardDeviation=14
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: counter_mean=1836
INSTRUMENTATION_STATUS: counter_median=1837
INSTRUMENTATION_STATUS: counter_min=1832
INSTRUMENTATION_STATUS: counter_standardDeviation=2
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: asyncBeginEnd_mean=4992
INSTRUMENTATION_STATUS: asyncBeginEnd_median=4988
INSTRUMENTATION_STATUS: asyncBeginEnd_min=4964
INSTRUMENTATION_STATUS: asyncBeginEnd_standardDeviation=21
INSTRUMENTATION_STATUS_CODE: -1

After:
android.os.TracePerfTest:INSTRUMENTATION_STATUS: enabled_mean=13
INSTRUMENTATION_STATUS: enabled_median=13
INSTRUMENTATION_STATUS: enabled_min=13
INSTRUMENTATION_STATUS: enabled_standardDeviation=0
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: beginEndSection_mean=2974
INSTRUMENTATION_STATUS: beginEndSection_median=2971
INSTRUMENTATION_STATUS: beginEndSection_min=2958
INSTRUMENTATION_STATUS: beginEndSection_standardDeviation=15
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: counter_mean=1737
INSTRUMENTATION_STATUS: counter_median=1739
INSTRUMENTATION_STATUS: counter_min=1732
INSTRUMENTATION_STATUS: counter_standardDeviation=3
INSTRUMENTATION_STATUS_CODE: -1
.INSTRUMENTATION_STATUS: asyncBeginEnd_mean=3677
INSTRUMENTATION_STATUS: asyncBeginEnd_median=3679
INSTRUMENTATION_STATUS: asyncBeginEnd_min=3663
INSTRUMENTATION_STATUS: asyncBeginEnd_standardDeviation=11
INSTRUMENTATION_STATUS_CODE: -1

Test: builds, benchmarks, verified tracing still works
Bug: 111503982
Change-Id: I71cb026d034bf9b9f97427d10d5ff9ce3d103561
2018-07-17 14:35:01 +00:00
Martijn Coenen
331d8dc9fe Move proxy debug info dumping back to Java.
This had to be called from native because serialization
was done from native, but now that serialization is in Java
we can move this back to a more logical place.

Also, this allows us to dump the per-UID proxy counts in
this situation again.

Bug: 109888955
Test: sailfish builds, proxy debug info shown on hitting limits
Change-Id: I4e06b3f93e30ed1c7868ec9e018709a7e796e441
2018-07-17 11:16:17 +02:00
Martijn Coenen
ba75cf1101 Dump top binder proxy interface names in dumpsys.
To facilitate real-time debugging.

Bug: 109888955
Test: builds, adb shell dumpsys activity binder-proxies shows output
Change-Id: Iffcbbb824f4050b6fb8f556c8b4d09115e53da18
2018-07-17 11:16:11 +02:00
Martijn Coenen
03e6d923c5 Make BinderProxy @hide public class.
To make some future refactoring easier.

Added some JavaDoc (mostly links to android.os.IBinder)
to make checkstyle happy.

Test: builds
Change-Id: If9dd6913868a34ea1e3d14fee1860a4ff368e06b
2018-07-17 10:02:06 +02:00
John Reck
107e6f2f53 Remove unneeded JNI method
Test: ran PFD CTS tests
Change-Id: I9a40319595c757835f7e19a50dc0311077c9e627
Merged-In: I9a40319595c757835f7e19a50dc0311077c9e627
(cherry picked from commit d7bd919075)
2018-07-16 16:32:38 -07:00
Brett Chabot
968a5322b9 Make ENABLE_COPY_OPTIMIZATIONS non final.
Test: make -j56 Run_robolectric_robolectric_tests
Change-Id: I6ef235fef5a2daf55fab059b4d1b3a9afce09c8d
2018-07-12 10:33:43 -07:00
Jeff Sharkey
5aae0c9df7 Utility methods useful for working with files.
Part of getting DocumentsUI ready for building against public API.

Test: builds
Bug: 110959821
Change-Id: I7cc0acd5ac3bcc89790cb49f34291ae523e44019
2018-07-11 14:41:24 -06:00
Olivier Gaillard
e7325a0189 Merge "Add a getTransactionName method to Binder." am: 079f03f584 am: 06aa142232
am: 0600f8d76f

Change-Id: I9c86300654d3ecd9ea745b7997ed35f605452e9d
2018-07-10 02:08:40 -07:00