Commit Graph

4787 Commits

Author SHA1 Message Date
Jeff Sharkey
a73e165c2e Hack.
Test: none
Bug: 69331247
Change-Id: I65807b7e8994746a80e06a8530d9aeb967ea04ca
2017-11-16 16:04:38 +00:00
TreeHugger Robot
c0c6ee6b6f Merge changes from topic "f2fs_gc"
* changes:
  Run gc + fstrim for idle maintenance
  Add 'idle-maint' command for use from shell
  Add entry points to invoke idle maintenance from vold
2017-11-15 18:47:27 +00:00
Koji Fukui
a834309bd5 Merge "Remove AutofillManagerClient after AutofillManager is finalized" am: dd5384a4fe am: 8d36beec24
am: bb4a13b097

Change-Id: I5f3eea81f662d0396b7fd384b2e91c2087f41c0f
2017-11-15 02:56:16 +00:00
Koji Fukui
8d36beec24 Merge "Remove AutofillManagerClient after AutofillManager is finalized"
am: dd5384a4fe

Change-Id: If0b092c5e18005fb4b8c1fd8405f4d666c98de5a
2017-11-15 02:35:18 +00:00
Treehugger Robot
dd5384a4fe Merge "Remove AutofillManagerClient after AutofillManager is finalized" 2017-11-15 02:23:27 +00:00
Jin Qian
a85b9919f5 Add entry points to invoke idle maintenance from vold
Test: adb shell sm idle-maint [run|abort]
Bug: 67776637
Change-Id: Ibc686a318f6f79a4f8303f56451bc1d573d829e8
2017-11-14 15:02:34 -08:00
Xin Li
220871a697 Merge commit '98e12851336b7db16e583f9afac63ecc97465980' from
oc-mr1-dev-plus-aosp-without-vendor into stage-aosp-master.

Change-Id: Ia7b8da4a00d215160e4a4fa40f6044208d1297b7
Merged-In: I19846d2a3ee27aecbae2367a74ee49082eea154d
2017-11-14 12:31:11 -08:00
TreeHugger Robot
341775bfef Merge "Adds client API for interacting with statsd." 2017-11-14 20:25:09 +00:00
Jeff Sharkey
59eee8d98a Merge "Better, consistent definition of AID_SHARED_GID." am: 7e875df695 am: 42064a3aa2
am: 7018dbc8ab

Change-Id: I02f17bc42dced22c332bb3eb9e195a64ee0b5776
2017-11-14 17:32:59 +00:00
Jeff Sharkey
7018dbc8ab Merge "Better, consistent definition of AID_SHARED_GID." am: 7e875df695
am: 42064a3aa2

Change-Id: I85979f6f70bbef34d6041495310b442cb0405d2d
2017-11-14 17:19:57 +00:00
Jeff Sharkey
7e875df695 Merge "Better, consistent definition of AID_SHARED_GID." 2017-11-14 16:49:30 +00:00
David Chen
adaf8b344e Adds client API for interacting with statsd.
This API will primarily be used by GmsCore to send updated configs.
Also, sending a config will implicitly notify the StatsD that this
client wants to know when it should request data for this config.

We send a broadcast so that all interested subscribers can know if
data needs to be pulled.

Test: Manually tested that sending broadcast works via new adb
command added in StatsService.

Change-Id: I23cdd1df706036e14b32c3d01af30c3d4af819fa
2017-11-13 19:37:12 -08:00
Fyodor Kupolov
2a64dbce69 Merge "Additional System APIs for restricted profiles" 2017-11-14 01:34:17 +00:00
Jeff Sharkey
cbc5867ede Merge "Allow blocking calls when protected against ANRs." 2017-11-10 06:01:40 +00:00
Kurt Nelson
7cd3fa6fa2 Merge "Show Extensible StrictMode APIs" 2017-11-10 03:48:08 +00:00
Kurt Nelson
0e612808fc Show Extensible StrictMode APIs
Bug: 63535923
Test: none
Change-Id: I07382eae70292c6a78fff9eced26dd1916bc783c
2017-11-09 18:18:11 -08:00
Fyodor Kupolov
ca1775623e Additional System APIs for restricted profiles
- isRestrictedProfile - whether the caller is running
  as restricted profile.
- hasRestrictedProfiles - whether the calling user has at least one
  restricted profile associated with it.

Bug: 64122169
Test: UserManagerTest
Change-Id: I178b02a48abc32e126613e0320c4950f455364df
2017-11-09 17:43:01 -08:00
Jeff Sharkey
5918948db7 Allow blocking calls when protected against ANRs.
ContentProviderClient has a nice setDetectNotResponding() method
that detects hanging calls to remote providers, and it can trigger
an ANR to kill the app and release the blocked thread.

We typically don't want to perform blocking calls from the system
server, but we're okay allowing them on CPCs that are using
setDetectNotResponding() to watch for hung clients.

Test: builds, boots
Bug: 69128093
Change-Id: I223aaf1d0cef0f8dee28f800d9e3c101d7449952
2017-11-09 18:32:37 -07:00
Jeff Sharkey
77a34500fe Better, consistent definition of AID_SHARED_GID.
AID_SHARED_GID is a GID shared by a specific app across all users on
the same device.  Bring the UserHandle and multiuser.c implementations
into agreement, and copy/paste the unit tests that verify that both
behave identically.

Since we might now return "-1" when a GID is invalid, have
ActivityManager handle these cases by quickly swapping in the
always-valid getUserGid().

Test: bit FrameworksCoreTests:android.os.UserHandleTest
Bug: 34151068, 64548938
Change-Id: I0463aba923ae5ce1942666359a394ae6cdb7c1f8
2017-11-09 17:42:29 -07:00
Jeff Sharkey
29862ccde0 Merge "Extend JobInfo to support NetworkRequest." 2017-11-10 00:11:58 +00:00
Koji Fukui
ccec6a6ae8 Remove AutofillManagerClient after AutofillManager is finalized
Symptom:
Global reference table overflow happens on system_server.

Root cause:
If a process repeatedly create a context and get AutofillManager
from the context, each BinderProxy of AutofillManagerClient are
registered to AutofillManagerServiceImpl. They aren't removed until
the process is died. BinderProxy consumes global reference and finally
causes crash on system_server.

Solution:
Remove AutofillManagerClient from AutofillManagerServiceImpl after
AutofillManager is finalized.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Bug: 68747744
Change-Id: I8b76c5368b54317b8696cac470cc390b36e910e7
2017-11-09 15:44:12 -08:00
Jakub Pawlowski
c411b3d46b Merge changes from topics "parcel_uuid_and_fd_native", "bluetooth_socket_manager_native" am: b2bde067c2 am: 64a1fbb8cf
am: 874ab0ef21

Change-Id: Ib5b30de21a15ee6220ad4aa143216fb10839d709
2017-11-09 23:34:22 +00:00
Jakub Pawlowski
874ab0ef21 Merge changes from topics "parcel_uuid_and_fd_native", "bluetooth_socket_manager_native" am: b2bde067c2
am: 64a1fbb8cf

Change-Id: I8e480c1ca3c1cdbd61e2b854bf4b42d1e81087ae
2017-11-09 23:04:28 +00:00
Jeff Sharkey
d0fff2eac4 Extend JobInfo to support NetworkRequest.
The current JobInfo.NETWORK_TYPE values offer basic network selection
ability, but more precise requirements continue to come up.  Instead
of creating more NETWORK_TYPE constants, add support for the existing
NetworkRequest object, which is the idiomatic way for an app to
express the type of network they'd like to use.

Move the implementation details of NETWORK_TYPE constants to use this
new NetworkRequest functionality.  Deprecate NETWORK_TYPE_METERED,
since the lack of the NOT_METERED capability doesn't imply that the
connection is metered.  (Apps using this API to get to a cellular
network should use TRANSPORT_CELLULAR instead.)

Add new SystemClock APIs that return java.time.Clock instances for
various Android-specific clocks.  This gives us a clean interface
(with negligible overhead) for swapping in artificial clocks for
testing purposes.

Improve JobStoreTest to validate new NetworkRequest features, and
add one last sanity check to assertTasksEqual() to compare raw
bits-on-wire, to catch people who forget to check new fields.  Watch
for IoThread to go idle to run tests faster.

Test: bit FrameworksServicesTests:com.android.server.job.
Bug: 67040695
Change-Id: I189e7602132a0ec26d2f0cc6dadc188664961a47
2017-11-09 13:23:31 -07:00
Kurt Nelson
e6e0ebf187 Extensible StrictMode
go/extensible-strictmode for design doc.

Bug: 63535923
Change-Id: Ic5c48fc06d2167dc99b86e264e114a9af49f12a1
Test: cts-tradefed run commandAndExit cts-dev -m CtsOsTestCases -t
android.os.cts.StrictModeTest
2017-11-09 12:13:49 -08:00
Jakub Pawlowski
db62b26ba0 Make ParcelUuid and ParcelFileDescriptor accesible to native Binder (2/2)
Bug: 68359837
Test: compile
Change-Id: I3cec0b5b20dde33be09a5bbc451cd79273c67961
2017-11-09 19:40:03 +00:00
Christine Franks
fde6ea8d29 Merge "Add DISALLOW_CONFIG_LOCALE user restriction" 2017-11-09 16:02:46 +00:00
TreeHugger Robot
1e3212ebda Merge "Battery saver preliminary changes for P." 2017-11-09 02:06:59 +00:00
Makoto Onuki
aae89531c0 Battery saver preliminary changes for P.
- Flags for force app standby for jobs and alarms, and sensors.
- Don't disable GPS when the screen is off.

Bug: 68769804
Test: manual
Change-Id: I13661498dbc25051f2be0423cb50a55e4e592dc4
2017-11-08 14:34:49 -08:00
TreeHugger Robot
42e0ab0651 Merge "Create a new user restriction to disallow user switching" 2017-11-08 20:16:22 +00:00
TreeHugger Robot
5cc7ea1ff8 Merge "Added new update engine error codes from /android/system/update_engine/common/error_code.h" 2017-11-08 09:03:07 +00:00
scypher
f5a53658b2 Added new update engine error codes from
/android/system/update_engine/common/error_code.h

Test: Exposed new constant and manually added the change to
api/system-current.txt due to b/68874686

Bug: 68380039
Change-Id: I01a8befe07d37dfa74d3544b80bde2c2cc48acdb
2017-11-07 11:25:04 -08:00
Jeff Sharkey
508cce3f4a Merge "Abort long-running benchmarks, report progress." 2017-11-07 19:23:25 +00:00
Jeff Sharkey
7e19f53f75 Abort long-running benchmarks, report progress.
A typical storage device finishes the benchmark in under 10 seconds,
but some extremely slow devices can take minutes, resulting in a
confusing UX that looks like we've frozen.  Even worse, we keep
churning through all that I/O even though we know the device will
blow past our user-warning threshold.

So periodically check if we've timed out, and also use that to report
progress up into the Settings UI.

Test: manual
Bug: 62201209, 65639764, 67055204
Change-Id: Id28e63a7ea1476d83184abab5aea737a1d193f3a
2017-11-07 09:51:53 -07:00
John Reck
0f6fae9efa Merge "Remove unneeded JNI method" 2017-11-07 16:29:08 +00:00
Jeff Sharkey
3c027e49f4 Merge "Consistent handleApplicationStrictModeViolation." 2017-11-07 06:34:03 +00:00
Benjamin Franz
ff66fa9ef2 Create a new user restriction to disallow user switching
For multi-user session implementation, we want to block the user from
going back to user 0. Therefore, we block the user switcher in the
secondary user, as well as swtiching via user section in Settings app.

Bug: 64382189
Test: Manually verify user switcher is not displayed in QuickSettings
Test: Manulaly verify not able to remove or switcher user in user
      section in Setting app
Change-Id: I84bc9e67e3fe7fccb75edf0fc49b775b902f5290
2017-11-07 11:33:18 +08:00
John Reck
d7bd919075 Remove unneeded JNI method
Test: ran PFD CTS tests
Change-Id: I9a40319595c757835f7e19a50dc0311077c9e627
2017-11-06 16:02:49 -08:00
Jeff Sharkey
da4e50f8ba Consistent handleApplicationStrictModeViolation.
Factor out the logic that calls into ActivityManager, since we have
some evidence of violations being triggering before AM has been
published.

Test: manual
Bug: 68940916
Change-Id: Ie64b1eea42393089a657a9b5ae0c4585a0c83bfa
2017-11-06 15:23:05 -07:00
Philip P. Moltmann
4c10ba499d Merge "Allow to attach jvmti agents from inside of process" am: faffb072a4 am: 491058e089
am: b567ea9dda

Change-Id: Ie2d729a7c46a558597d626d1ebd5227bf56b1f55
2017-11-06 21:12:50 +00:00
Philip P. Moltmann
b567ea9dda Merge "Allow to attach jvmti agents from inside of process" am: faffb072a4
am: 491058e089

Change-Id: Ib636dd1ebcee0bfbd57e12e632137561bb661d3e
2017-11-06 20:58:48 +00:00
Treehugger Robot
faffb072a4 Merge "Allow to attach jvmti agents from inside of process" 2017-11-06 20:34:34 +00:00
Neil Fuller
622597fbc5 Merge "Remove TzDataInstallReceiver" 2017-11-06 09:30:09 +00:00
Jeff Sharkey
617e1139aa Flip feature flag to enable StrictMode defaults.
Test: cts-tradefed run commandAndExit cts-dev -m CtsOsTestCases -t android.os.cts.StrictModeTest
Bug: 68662870
Change-Id: I61178def217521ad413074ece3482f4e60428506
2017-11-03 17:36:35 -06:00
Jeff Sharkey
8918298045 Narrower StrictMode defaults.
Until now, userdebug and eng builds have tracked StrictMode
violations on all system apps, including prebuilts that we have no
control over, which results in a lot of unactionable noise.

This CL narrows the set of enabled apps to only "bundled" system
apps, which gives us a much higher chance of burning these violations
down to 0 and keeping them there.  We don't have a good proxy for an
app being "bundled", so we detect it based on being in the "android."
or "com.android." package namespace.

Clean up the entire flow of applying StrictMode defaults to make it
much more human-readable.  This resulted in us fixing a bug where
StrictMode was never actually enabled for jank-sensitive threads in
system_server!

Relax I/O checks in a few places where we know we're interacting with
procfs or sysfs.  Add internal "allow" methods that avoid object
allocation by returning raw mask.

Test: cts-tradefed run commandAndExit cts-dev -m CtsOsTestCases -t android.os.cts.StrictModeTest
Bug: 68662870
Change-Id: I536e8934fbcdec14915fcb10995fc9704ea98b29
2017-11-03 17:36:35 -06:00
TreeHugger Robot
d906cc0901 Merge "Revert "SystemServer: spawn hwbinder threads before BatteryService"" 2017-11-03 21:23:48 +00:00
TreeHugger Robot
51c05d23b4 Merge "Fix BatteryManager.getIntProperty returns 0 as invalid value." 2017-11-03 21:11:47 +00:00
TreeHugger Robot
df66dd920f Merge "Structure StrictMode violations as Throwables" 2017-11-03 20:54:13 +00:00
Yifan Hong
b0f1352be1 Fix BatteryManager.getIntProperty returns 0 as invalid value.
Long.MIN_VALUE cast to Integer.MIN_VALUE always returns 0.

Change-Id: Ief7a1fd12a356c83a4ef3f28139c330034507dfa
Fixes: 37090343
Test: BatteryManagerTest
2017-11-03 19:26:06 +00:00
Kurt Nelson
1bb93bf77c Structure StrictMode violations as Throwables
All violations of StrictMode now inherit from one central Violation
class. This unlocks adding penaltyCallback(Violation).
Parsing strings is no longer required to infer what type of violation
something is.
Violation classes have no need to be loaded in Zygote as only developers
opt-in to this feature and will see violations.

Cross-binder thread violation perf test:
before
2872331
2574093
2481208
after
1938227
1742714
2654538

Bug: 64258734
Test: cts-tradefed run cts-dev --module CtsOsTestCases --test
android.os.cts.StrictModeTest
Change-Id: I1971feb03ff77cf297c940cacee62fadb5b8422c
2017-11-03 11:14:30 -07:00