Commit Graph

5503 Commits

Author SHA1 Message Date
TreeHugger Robot
ce77407144 Merge "StrictMode to catch storage while locked." 2018-06-30 22:04:26 +00:00
Jeff Sharkey
c609116a1b Get android.os tests running against real APIs.
Combination of moving to existing public API, tagging things as
@TestApi, and bringing utility methods into tests.

Bug: 13282254
Test: atest cts/tests/tests/os/
Change-Id: Ifd24c0d048d200e8595e194890cc1dc53ddc2b3e
2018-06-29 17:15:44 -06:00
Jeff Sharkey
dd02e33417 StrictMode to catch storage while locked.
When an app starts becoming Direct Boot aware, it can be difficult
to track down all the places they're reading data from credential
protected storage.

When a user is locked, credential protected storage is unavailable,
and files stored in these locations appear to not exist, which can
result in subtle app bugs if they assume default behaviors or
empty states. Instead, apps should store data needed while a user
is locked under device protected storage areas.

Bug: 110413274
Test: atest cts/tests/tests/os/src/android/os/cts/StrictModeTest.java
Change-Id: Ia390318efa6fefda8f10ac684d0206e67aa1d3dc
2018-06-29 11:41:00 -06:00
Jeff Sharkey
3ac2a43455 Give StrictMode more bits to work with.
We're almost out of bits, and we don't really need to smash both
thread and VM policy into the same 32-bit value, so use the lower
16-bits for each policy type and the upper 16-bits for penalty.

ActivityManager is only consulting the penalty bits, so we can
remove getViolationBit() and switch CTS over to doing instanceof
checks.

Bug: 110413274
Test: atest cts/tests/tests/os/src/android/os/cts/StrictModeTest.java
Change-Id: I760e6a28f56da66dc75b7df9daf2167ff5bdff50
2018-06-26 14:12:14 -06:00
Jeff Sharkey
c59a5e7e0b StrictMode to catch implicit Direct Boot matching.
When an app starts becoming Direct Boot aware, it can be difficult
to track down all the places they're implicitly relying on
PackageManager filtering behavior.

For example, if the current Launcher isn't Direct Boot aware, we
hide it until the user is unlocked, which could confuse other Direct
Boot aware apps into thinking it had been uninstalled, which could
cause data loss.

This change helps apps track down places where they're implicitly
relying on the automatic filtering; they should instead carefully
choose a combination of MATCH_DIRECT_BOOT flags to decide on the
explicit matching behavior they want.

To implement this, we partially migrate the updateFlags() methods
out into ApplicationPackageManager, since the checking needs to
happen on the client side to correctly report StrictMode
violations.  We don't currently mutate the flags, but we retain
the naming to keep that door open in the future.

Test: manual
Bug: 110413274
Change-Id: Iff6feba19da81ea1b4eeb3af821c3bdfbd9bf17c
2018-06-26 13:20:37 -06:00
TreeHugger Robot
849c351337 Merge "Make setPrivacy not a hidden api" 2018-06-22 23:49:02 +00:00
Yi Jin
5afde76fbe Make setPrivacy not a hidden api
Bug: 110710413
Test: N/A
Change-Id: Iae8dda7f2295e3080c042398516838d84bd5d5be
2018-06-22 21:07:41 +00:00
Jeff Sharkey
494500d83a Introduce RedactingFileDescriptor.
Files on disk can sometimes contain content that should be redacted
based on the permissions of the remote caller.  (For example, EXIF
data containing location information shouldn't be visible to apps
that haven't been granted the location permission.)

This class provides an easy way to "redact" ranges within an
underlying file, without the overhead of making a duplicate copy
of the file, or the limitations of returning a non-seekable FD.

Bug: 110228267
Test: atest android.os.RedactingFileDescriptorTest
Change-Id: I0b3b9f642573f6165e152e7568cdaf55f0af7134
2018-06-20 14:17:51 -06:00
Ryo Hashimoto
b9a8c6b587 Merge "Use ParcelFileDescriptor's C++ implementation in libbinder" am: 20e243d627 am: 9e2177b492
am: 5b6ba779fe

Change-Id: I6ebe13fa8e5f74549fa180acffac8b7f6bee00c5
2018-06-11 02:42:03 -07:00
Ryo Hashimoto
9e2177b492 Merge "Use ParcelFileDescriptor's C++ implementation in libbinder"
am: 20e243d627

Change-Id: I0bc6158d1c37ee8a02450dee55ca6732d878fde3
2018-06-11 01:25:46 -07:00
Treehugger Robot
20e243d627 Merge "Use ParcelFileDescriptor's C++ implementation in libbinder" 2018-06-11 07:27:41 +00:00
Jerry Zhang
c2861c5698 Merge "Check for null path in getInternalPathForUser"
am: 0559afdbcc

Change-Id: I0669f429a389655e04f26ab4cd19fbf69f3dbef1
2018-06-08 16:55:43 -07:00
Fan Zhang
c69c8b6008 Add a setting to control multi-user feature on/off.
Bug: 72319180
Test: n/a
Change-Id: I0fd00e9c278de8ece530cacd43aaeae854002f14
2018-06-08 14:48:54 -07:00
Treehugger Robot
0559afdbcc Merge "Check for null path in getInternalPathForUser" 2018-06-08 20:16:14 +00:00
Jerry Zhang
30f63cf1f9 Check for null path in getInternalPathForUser
In some situations, path could be null resulting
in a crash.

Test: no crash
Bug: 109730998
Change-Id: I2ce0410162d1327905d690331f461f9187e20906
(cherry picked from commit 6f6154bf04)
2018-06-08 11:26:33 -07:00
TreeHugger Robot
1aadbc2d09 Merge "Add new background location APIs." 2018-06-07 19:32:36 +00:00
Neil Fuller
7dbefdcb92 resolve merge conflicts of 26119befba to pi-dev-plus-aosp
BUG: None
Test: I solemnly swear I tested this conflict resolution.
Change-Id: Iea64af5a88c9bf399fb26468e931be3c73061bac
2018-06-07 20:02:59 +01:00
Dianne Hackborn
afba81619d Add new background location APIs.
Work on issue #109754053: Implement tri-state location in platform

- New background location permission
- New (temporary?) API level for compatibility with old apps

None of this is exposed yet as a public API, that will be
done in the future.

Bug: 109754053
Test: atest FrameworksServicesTests:AppOpsServiceTest
Test: atest CtsPermissionTestCases:AppOpsTest
Change-Id: I986dc871b9e8ed3bf592d2546eadaefb4fefe099
2018-06-07 11:04:22 -07:00
Jeff Sharkey
160330d514 Merge "Check for null path in getInternalPathForUser" 2018-06-06 21:14:29 +00:00
Jerry Zhang
6f6154bf04 Check for null path in getInternalPathForUser
In some situations, path could be null resulting
in a crash.

Test: no crash
Bug: 109730998
Change-Id: I2ce0410162d1327905d690331f461f9187e20906
2018-06-06 11:05:40 -07:00
Neil Fuller
d2f29d7a6f Remove CommonClock / CommonTimeManagementService
The service and associated code is unused.

Bug: 80462439
Test: build / boot
Merged-In: Ibdfab1b7d2951a0c45e07bd47850af037990841b
Change-Id: Ibdfab1b7d2951a0c45e07bd47850af037990841b
2018-06-06 17:03:55 +01:00
Neil Fuller
7bb9fcbc45 Merge "Remove CommonClock / CommonTimeManagementService" 2018-06-06 15:59:44 +00:00
Martijn Coenen
8cec8334a8 Merge "Serialize calls into BinderProxy." into pi-dev am: 051b63d4b3
am: e374ec2355

Change-Id: I28c17f46798f95eb1072b9cd9c14560de07fd9aa
2018-06-05 22:51:58 -07:00
Martijn Coenen
e374ec2355 Merge "Serialize calls into BinderProxy." into pi-dev
am: 051b63d4b3

Change-Id: I9d725b05bc4b00eec7c6421e1a3313d6730ad042
2018-06-05 22:44:06 -07:00
Martijn Coenen
dfa390e080 Serialize calls into BinderProxy.
The BinderProxy class is not thread-safe, hence all calls into it
must be serialized. This was achieved by holding the gProxyLock in
JNI code. However, a recent change added calls into BinderProxy
from ActivityManagerService without holding that lock, causing
ConcurrentModificationExceptions.

Instead of dumping debug info from AMS, make the call directly
from JNI, so we can make sure gProxyLock is held correctly.

Also, only dump on debug builds.

Bug: 71353150
Bug: 109701487
Test: sailfish builds, boots, info gets dumped with lowered limits.
Change-Id: I446a71ce4115b9936a01a170401ef98ba3818c0b
2018-06-05 11:18:48 +02:00
TreeHugger Robot
232e558006 Merge "Annotate Parcel param/return reference types." 2018-06-04 19:33:59 +00:00
Neil Fuller
ea8a738581 Remove CommonClock / CommonTimeManagementService
The service and associated code is unused.

Bug: 80462439
Test: build / boot
Change-Id: Ibdfab1b7d2951a0c45e07bd47850af037990841b
2018-06-04 19:26:29 +01:00
Jake Wharton
b1f474c066 Annotate Parcel param/return reference types.
Bug: 78245676
Test: atest ParcelNullabilityTest
Change-Id: I7bb844164d4b417445ff2d6f2f99c8a88d7f7f48
2018-06-04 12:47:45 -04:00
Olivier Gaillard
22e64ec611 Merge "Collect a few more binder stats when detailed tracking is enabled." 2018-06-04 10:07:47 +00:00
Olivier Gaillard
58b56e3720 Collect a few more binder stats when detailed tracking is enabled.
Test: unit tested

Change-Id: Ibdbbd2b9b60dbc6fa375d60c76f04d42392d6bd3
2018-06-01 21:25:53 +01:00
Aurimas Liutikas
62786b4431 Merge "Fix broken links in @see tags in framework docs." 2018-06-01 17:16:09 +00:00
Aurimas Liutikas
7f6953369a Fix broken links in @see tags in framework docs.
doclava was accidentally suppressing all these broken links
in @see tags. This CL fixes issues so we can start enfocing
checks for broken @see links.

Test: make docs
Exempt-From-Owner-Approval: Fixing @see javadoc link issues that are currently completely broken
Change-Id: I767e9fb9842494e5eccef2a7bdeee3877c488b5d
2018-06-01 17:15:55 +00:00
TreeHugger Robot
3795062f23 Merge "Protect usage data with OP_GET_USAGE_STATS." 2018-05-31 19:21:14 +00:00
Michael Wright
3d3438ff3e Merge "Allow for any default vibration intensity level." into pi-dev am: fb840c9170
am: 4af6ded846

Change-Id: I436509b14ffc1a100293e36dedbddeceb53c362b
2018-05-30 02:48:14 -07:00
Michael Wright
4af6ded846 Merge "Allow for any default vibration intensity level." into pi-dev
am: fb840c9170

Change-Id: Ia1df028a9a0011f47ef2de6ec50e64c227c4b418
2018-05-30 02:38:47 -07:00
Ryo Hashimoto
20529959e8 Use ParcelFileDescriptor's C++ implementation in libbinder
Bug: 80377815
Test: build
Change-Id: I5bfce159fc5c06df29aff9d93ed7d771b7c33d72
2018-05-30 17:57:34 +09:00
Michael Wright
0dbb516a43 Allow for any default vibration intensity level.
Because we can't always create the range of effects we'd like, we may
need different default intensity levels for different devices. This
works fine for prebaked effects, but for application defined amplitudes
we need to provide a scaling function. In addition, this scaling
function should leave amplitude values untouched in the default state so
that application developers produce the effects they expect.

Bug: 80275800
Test: manual
Merged-In: Ibb552ddfa60891853ebcb1a5567ed6745bb5defe
Change-Id: Ibb552ddfa60891853ebcb1a5567ed6745bb5defe
2018-05-30 00:21:38 +01:00
Martijn Coenen
c35a1e8ecb Merge "Dump proxy debug info when exceeding proxy limit." into pi-dev am: 879d09f946
am: a634f425d9

Change-Id: I2fd8ddc6166f00d03a5cefc2d39e477f59a490f0
2018-05-26 02:30:20 -07:00
Martijn Coenen
a634f425d9 Merge "Dump proxy debug info when exceeding proxy limit." into pi-dev
am: 879d09f946

Change-Id: I02d14f682c6476b703d160dab911a3afc14af627
2018-05-26 02:19:18 -07:00
Martijn Coenen
eebac6d6b5 Dump proxy debug info when exceeding proxy limit.
If a process gets killed because it sends too many proxies,
dump proxy debug info so we can see what types of interfaces
it sends.

Bug: 71353150
Test: builds, output generated
Change-Id: I3a7787cb3fa73b0b4ad223b18cd79f44e22b9ef5
2018-05-25 20:13:24 +02:00
Andreas Gampe
97def7a097 Merge "Framework: Add API to get zygote PID" am: 1109e2333f am: 07578c786a
am: 4f11d5381e

Change-Id: I827a7df417597f17f78276052c5b17e064ebec7d
2018-05-24 17:47:57 -07:00
Andreas Gampe
4f11d5381e Merge "Framework: Add API to get zygote PID" am: 1109e2333f
am: 07578c786a

Change-Id: Ibee53631caad0d6ce2108970598f5226d20a849d
2018-05-24 13:49:41 -07:00
Treehugger Robot
1109e2333f Merge "Framework: Add API to get zygote PID" 2018-05-24 18:28:59 +00:00
Jeff Sharkey
c36c3b9469 Protect usage data with OP_GET_USAGE_STATS.
APIs that return package usage data (such as DropBoxManager) must
ensure that callers hold both the PACKAGE_USAGE_STATS permission
and the OP_GET_USAGE_STATS app-op.

Bug: 78355661
Test: Search output directory for binaries that have READ_LOGS but not
USAGE_STATS and find none.

Change-Id: I85e3bad680bb510439d73c7db5cc50cdcb7bbb42
2018-05-23 14:17:32 -07:00
Jovana Knezevic
3a5698adac Merge "Adding hidden APIs for assigning Admin flag to users." into pi-dev am: b662f94c37
am: f6eed4ba8c

Change-Id: I60f253dbd924411dcbde9714e1780d689560d5f4
2018-05-23 13:45:48 -07:00
Michael Wright
bd02d45b52 Merge "Uncanonicalize URIs before comparing them." into pi-dev
am: 467a831aa6

Change-Id: Ibe0197543af68f937baa4dae768bbc64d34370e4
2018-05-23 13:14:58 -07:00
Kweku Adams
c5cd7204b7 Merge "Bumping BatteryStats report version." into pi-dev am: 42b29eb462
am: cb69a53ce5

Change-Id: I510b2d20d733184bf52c997d4b6f3134e34f71a4
2018-05-23 13:02:25 -07:00
Jovana Knezevic
f6eed4ba8c Merge "Adding hidden APIs for assigning Admin flag to users." into pi-dev
am: b662f94c37

Change-Id: I4c3d9e5e95cfafbc2f51e9379b516fa402836fe3
2018-05-23 12:21:20 -07:00
Kweku Adams
cb69a53ce5 Merge "Bumping BatteryStats report version." into pi-dev
am: 42b29eb462

Change-Id: I7d512c4b4373019e594dc0422d750b3dddaf3f68
2018-05-23 11:28:50 -07:00
Michael Wright
467a831aa6 Merge "Uncanonicalize URIs before comparing them." into pi-dev 2018-05-23 12:39:34 +00:00