Commit Graph

4614 Commits

Author SHA1 Message Date
TreeHugger Robot
f3149fd352 Merge "Pass dumpsys priority to IServiceManager" 2017-09-26 19:01:10 +00:00
Hans Boehm
6f0d970b2e Merge "Naming fix and add comments" am: 3c03d5bd2b am: 24b9851605 am: 4a901144fe
am: c9532e8ac6

Change-Id: Ibe7d825b3b491cd9e5fb1ef07adaa9f71719e0dd
2017-09-26 13:03:11 +00:00
Hans Boehm
c9532e8ac6 Merge "Naming fix and add comments" am: 3c03d5bd2b am: 24b9851605
am: 4a901144fe

Change-Id: I1e2446f67e0505d30edb230f2dde70855c9fe00c
2017-09-26 12:42:41 +00:00
Hans Boehm
24b9851605 Merge "Naming fix and add comments"
am: 3c03d5bd2b

Change-Id: Ib35c874f56f87757904553ceeffb4d363eff196e
2017-09-26 11:12:19 +00:00
Sudheer Shanka
f39df68b71 Merge "Add shutdown reason as extra when triggering ACTION_REQUEST_SHUTDOWN." 2017-09-25 20:42:52 +00:00
Sudheer Shanka
292637f51a Add shutdown reason as extra when triggering ACTION_REQUEST_SHUTDOWN.
When BatteryService triggers ACTION_REQUEST_SHUTDOWN intent, add the reason
for shutdown as extra to indicate low battery or critical battery
thermal state.

Bug: 63736262
Test: 1/ adb shell cmd battery unplug && adb shell cmd battery set level 0
      2/ Power on the device
      3/ Verify sys.boot.reason == shutdown,battery
Test: 1/ adb shell cmd battery set temp 700
      2/ Power on the device
      3/ Verify sys.boot.reason == shutdown,thermal,battery

Change-Id: If20a36ef53f8bcbfae4114df08f741ec1dcd7df9
2017-09-25 11:20:37 -07:00
Vishnu Nair
0576819519 Pass dumpsys priority to IServiceManager
Modify IServiceManager to accept supported dumpsys priority as a bitmask
with NORMAL being the default priority. Change listServices to return
a list of services filtered by the priority or all services when the
priority is set to ALL.

BUG:27429130

Test: manual verification

Change-Id: If367ace2f37f918043f1b330568d8560676d9b78
2017-09-25 10:25:26 -07:00
TreeHugger Robot
8672d81355 Merge "Fixing method asymmetry in Parcel" 2017-09-23 04:18:46 +00:00
Hans Boehm
eb6d62cd33 Naming fix and add comments
Also fix up imports to make repohooks happy and some whitespace issues.

A very small step towards making this code more understandable.

Bug: 65760710

Test: Builds.
Change-Id: I0396c06bb303e0b06ad0cbbbff4fdc1ac527ac6c
2017-09-22 15:49:48 -07:00
Kurt Nelson
9a94faca7a Merge "Make StrictMode constants visible for testing" 2017-09-22 19:35:18 +00:00
Sunny Goyal
0e60f22d2d Fixing method asymmetry in Parcel
Test: manually
Change-Id: I2a8321023b40cc74b7026eb0fb32a9cc5f5543a9
2017-09-21 21:41:14 -07:00
Kurt Nelson
cf8c4faa09 Make StrictMode constants visible for testing
All detector bits should be the same visibility.
Extract some error messages into constants.

Bug: 65966451
Test: CTS builds
Change-Id: Ib8ed80042c8d490d18ddd0054db8870e09c2b19d
2017-09-21 12:49:45 -07:00
Jeff Sharkey
930e352d94 Merge "Only construct real Throwable objects." 2017-09-21 15:39:08 +00:00
Jeff Sharkey
020ed6aed6 Only construct real Throwable objects.
Without this test, someone could trick us into constructing other
shady classes.

Test: builds, boots
Bug: 65281159
Change-Id: If678d0681708d1b0dcf056aa1133830ad3dbce31
2017-09-20 16:14:52 -06:00
Bookatz
b487b5533e statsd & statscompanion communication more robust
If statsd or statsdcompanion crashes, or if one loads
before the other, the other will be able to accomodate.

When statsd loads, it will attempt to tell statscompanion that it's
alive, and then get on to its business, while assuming that
statscompanion is not alive. Only when statscompanion tells statsd
that it is alive, statsd will then start to use it.

When statscompanion loads, it will attempt to tell statsd that it's
alive and then do nothing (since it has nothing to do). When statsd
tells statscompanion that statsd is alive, statscompanion will respond,
telling statsd that it is alive and, if that binder call returns, will
get to work.

This way, if statsd loads first, it can work unobstructed until
statscompanion informs statsd that it is alive, at which point they
shake hands and work. Conversely, if statscompanion loads first, it will
do nothing until statsd contacts it, at which point they will shake
hands and work.

Test: manual
Change-Id: I969ad47fb8060e27814d05ad37433a02711cfa6a
2017-09-20 14:13:44 -07:00
Bookatz
1b0b114abc StatsCompanionService sends messages to statsd
StatsCompanionService can now inform statsd that an alarm (for anomaly
alerting and for polling) has fired, so that statsd can act accordingly.

Test: manual created an alarm from statsd.main and checked logcat that
statsd received the broadcast that it fired
Change-Id: I1d33dfbee0d3e213c91dd6973d2622ecacc890c8
2017-09-20 07:51:53 -07:00
Adam Bookatz
43b272e20c Merge changes I82fe220e,Iff324c73,I3bd73acd
* changes:
  indexed priority queue for AnomalyMonitor
  StatsCompanionService connection to Statsd
  Set up StatsCompanionService.java
2017-09-20 14:01:49 +00:00
Kurt Nelson
5fe738da3b Merge "Improve StrictMode CTS Testing" 2017-09-18 21:40:33 +00:00
Jeff Sharkey
76ffccc044 Merge "Move long-running calls to async with listeners." 2017-09-15 22:46:00 +00:00
Jeff Sharkey
b302c54f11 Move long-running calls to async with listeners.
Now that we're using Binder, we can have callers provide explicit
listeners for every request instead of trying to squeeze them all
into unsolicited socket events.

Move benchmarking to be async to avoid blocking other commands for
up to several minutes.  Remove post-trim benchmarking flag, since
benchmarking now requires a separate callback.  Will bring back in
a future CL.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AdoptableHostTest
Test: adb shell sm fstrim
Bug: 62201209, 13758960
Change-Id: I26f76c66734ac2fd0f64713b8ab9828430499019
2017-09-15 14:19:46 -06:00
Adam Bookatz
c69e138213 Merge changes I54d54f24,I0c384eb3 into oc-mr1-dev am: e332629667
am: 065f4b7ea7

Change-Id: I27a13ed75f663e1d1478667cf02aa8f754201326
2017-09-15 07:09:27 +00:00
Andreas Gampe
14e3e529f8 Merge "resolve merge conflicts of eb8a4ef5d3 to oc-mr1-dev-plus-aosp" into oc-mr1-dev-plus-aosp
am: b840785100

Change-Id: I5547c135edda0ba51869c7131d83dd221aa7d740
2017-09-14 22:46:53 +00:00
Jeff Sharkey
90e7d66c52 Merge "Move unsolicited vold events to Binder." 2017-09-14 20:57:36 +00:00
Kurt Nelson
d25bd9f4f3 resolve merge conflicts of 1933e5c645 to master
Test: I solemnly swear I tested this conflict resolution.
Change-Id: Iabfe52a42f4a5ced3dba225cb137b844f9050a0a
2017-09-14 11:36:34 -07:00
Adam Bookatz
065f4b7ea7 Merge changes I54d54f24,I0c384eb3 into oc-mr1-dev
am: e332629667

Change-Id: Ib522e060c7a77b0e0ae0ecf3c9d84c331890d3e9
2017-09-14 18:33:47 +00:00
Adam Bookatz
e332629667 Merge changes I54d54f24,I0c384eb3 into oc-mr1-dev
* changes:
  Disable screen-off RPM timing in BatteryStats
  Added resource power manager stats to batterystats
2017-09-14 18:22:34 +00:00
TreeHugger Robot
b840785100 Merge "resolve merge conflicts of eb8a4ef5d3 to oc-mr1-dev-plus-aosp" into oc-mr1-dev-plus-aosp 2017-09-14 09:59:39 +00:00
Andreas Gampe
8f4eab2fcc resolve merge conflicts of eb8a4ef5d3 to oc-mr1-dev-plus-aosp
Test: I solemnly swear I tested this conflict resolution.
Change-Id: Ia29e31d704982985264b40a78578a4c93d11bf3a
2017-09-13 19:20:34 -07:00
Kurt Nelson
1933e5c645 Fix javadoc typo
am: 27616138bc

Change-Id: I5e55f645b757fd60b52cc50a223aa42ca65d0beb
2017-09-14 01:49:08 +00:00
Narayan Kamath
a3d4230b92 Zygote: Fix race condition on package preloads.
Before this change, ZygoteProcess.preloadPackageForAbi returned
as soon as the command was written to the zygote socket and not
after the preload completed. This meant that there was a small
window of time before the server side of the socket polled its FDs
where a second command could be written to the zygote socket. This
would lead to only one of the commands being processed and the
other being dropped. The client side of that socket would then wait
forever for a response and bring down the system once the watchdog
timeout was hit.

Example failure case :
--------------
system_server:send command(preloadPackage)
system_server:send command(fork)
zygote:poll & process command(preloadPackage)  // the fork command is dropped.

Example of normal operation :
------------------
system_server:send command(preloadPackage)
zygote:poll & process command(preloadPackage)
system_server:send command(fork)
zygote:poll & process command(fork)

This change makes preloadPackageForAbi synchronous, which ensures
that each POLLIN event corresponds to precisely one command.

(cherry picked from commit 24a3306c32)

Bug: 62886909
Bug: 13618569
Test: Manual
Contributed-By: yuqianyu@huawei.com

Merged-In: I83faf974c9a70a6ab18323f692c1981784e4c56a
Change-Id: I83faf974c9a70a6ab18323f692c1981784e4c56a
2017-09-13 18:37:05 -07:00
Bookatz
82b34117ee Disable screen-off RPM timing in BatteryStats
RPM = resource power manager.
Fetching the rpm stats (specifically, the subsystem low power stats) is
slow... too slow to reasonably do each time the screen state changes.
Therefore, it is disabled until fetching this information can be done
more quickly. Consequently, the screen-off RPM values will be incorrect
until it is re-enabled; they are therefore not printed.

Bug: 65164435
Bug: 62549421
Test: manual
Change-Id: I54d54f244c69ee372f22ecd99f32570db4aeb222
2017-09-13 22:24:25 +00:00
Jeff Sharkey
113f659b08 Merge "Move all crypto commands over to Binder." 2017-09-13 18:40:55 +00:00
Jeff Sharkey
8058fe691c Move unsolicited vold events to Binder.
Create IVoldListener and move most unsolicited vold events over to
this new interface.  The remaining events will be routed through
method-specific listeners instead of a global one.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.DirectBootHostTest
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AdoptableHostTest
Test: cts-tradefed run commandAndExit cts-dev -m CtsOsTestCases -t android.os.storage.cts.StorageManagerTest
Bug: 13758960
Change-Id: I492dacfaf98eeb66868b2cf7dfa27d84f6710948
2017-09-13 12:23:41 -06:00
Bookatz
50df711a51 Added resource power manager stats to batterystats
Currently Resource Power Management (e.g. VMIN time) is reported in the
batterystats history each time the battery level changes. We need this
information in the batterystats checkin, and need to be able to
differentiate time spent in each power state/voter, total as well as
when the screen is off.
The RPM information is obtained via a JNI call to the appropriate HALs.

Batterystats report version is increased to 26.

Bug: 62549421
Test: manual
Change-Id: I0c384eb3950714d8a0aa1353a4bf965330ebc8c1
2017-09-13 10:54:54 -07:00
Kurt Nelson
27616138bc Fix javadoc typo
Change-Id: Id851e1752eba2f57ce7360619fee3b14417b053f
Docs: Fix typo in public StrictMode javadoc
Bug: 62204662
Test: make ds-docs
2017-09-13 10:41:50 -07:00
Nicolas Geoffray
8dbb5e51c8 resolve merge conflicts of e017dae587 to stage-aosp-master
Test: I solemnly swear I tested this conflict resolution.
Change-Id: I7008986501028ec9bee0505d41aae3ff27872b50
2017-09-13 11:08:36 +01:00
Kurt Nelson
7d5c07a561 Improve StrictMode CTS Testing
* Pass a full object instead of just a string. I will be adding more
detailed assertions making sure cross-binder violations work.
* AOSP format the test class.
* Update to modern junit.
* Lambda-fy.
* Load ViolationLogger in Zygote.

Bug: 62458734
Test: Test improvments.
Change-Id: I2ddc489f845928154269cad449cbdc7b15dabe8e
2017-09-12 17:40:04 -07:00
Jeff Sharkey
43e12114d4 Move all crypto commands over to Binder.
Prefix FDE related commands with "fde" to make it clear which devices
they apply to.  This will also make it easier to remove once FDE
is fully deprecated in a future release.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.DirectBootHostTest
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AdoptableHostTest
Test: cts-tradefed run commandAndExit cts-dev -m CtsOsTestCases -t android.os.storage.cts.StorageManagerTest
Bug: 13758960
Change-Id: I6a9f7a47267d2464257d8066aa37353ec5741974
2017-09-12 16:36:36 -06:00
Bookatz
9472641287 Set up StatsCompanionService.java
Introduces StatsCompanionService.java and sets it up as a system service.

This service is a helper for statsd. It will be responsible for setting
and cancelling alarms related to polling stats and anomaly detection.

It currently does not have selinux permission, so must be started
manually (or with selinux temporarily disabled).

Test: disable enforcing selinux, then set and cancel alarms and make
sure they work.

Change-Id: I3bd73acdd998ee424696cce40965134c14220d8f
2017-09-12 14:56:54 -07:00
Yi Jin
4518ea94fd Merge changes Icdcbeded,I6753df11
* changes:
  Extract IncidentHeaderProto to a separated file for statsd to consume
  Implement Pii Stripper Part 3
2017-09-12 21:40:31 +00:00
Nicolas Geoffray
81edac4037 Rename debugFlags to runtimeFlags.
Also now pass the flags to the forked process through --runtime-flags instead
of converting to command line arguments and converting back to an integer.

bug: 30972906
bug: 63920015

Test: builds

Change-Id: I7f10c43dd916ca2d3b9b5141f17261eb7b64f49a
2017-09-12 15:54:23 +01:00
Jeff Sharkey
41cd681ff8 Move even more vold commands over to Binder.
This moves fstrim, obb and appfuse commands over to the new Binder
interface.  This change also separates creating/destroying and
mounting/unmounting of OBB volumes, which means they finally flow
nicely into the modern VolumeInfo/VolumeBase design.

Test: cts-tradefed run commandAndExit cts-dev -m CtsOsTestCases -t android.os.storage.cts.StorageManagerTest
Bug: 13758960
Change-Id: I4de45889828a9ab9858cc7c4f094a90eaff10f96
2017-09-11 18:44:34 -06:00
Jeff Sharkey
ee6523014e Merge "Move "volume" commands over to Binder." 2017-09-08 21:55:51 +00:00
Kurt Nelson
3de4796716 Don't store class in InstanceCountViolation
As InstanceCountViolation is a Throwable, it can be serialized. The
Class is only used for toString, so we just store the class name
instead.

Test: compiles
Change-Id: If3acf151e7b1fa90fbb2d3aab90a102dc0b030e8
2017-09-07 23:54:49 -07:00
Jeff Sharkey
ace874b15b Move "volume" commands over to Binder.
Keep the old socket-based commands intact for awhile so we can
rapidly disable this change using the ENABLE_BINDER feature flag.

Define constants in AIDL to keep Java and C++ in sync.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.ExternalStorageHostTest
Test: cts-tradefed run commandAndExit cts-dev --abi armeabi-v7a -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AdoptableHostTest
Bug: 13758960
Change-Id: Ie0d917c921b0b826e6bdf55a5d678b247ef352a6
2017-09-07 15:33:17 -06:00
Yi Jin
0f0471623e Implement Pii Stripper Part 3
The incident request args sets privacy spec. Strip action is optimized
to run once for each type of spec and ready for flush multiple times.
Incident command is updated to take -p option to specify privacy spec.

Bug: 64687253
Test: unit tests written, manually run incident command to test as well
Change-Id: I6753df117f76dc1a5f4d2152baa3fbbf56b490e4
2017-09-07 10:53:51 -07:00
TreeHugger Robot
10c41c2727 Merge "New Autofill API: SaveRequest.getDatasetIds()" 2017-09-07 17:31:23 +00:00
Kurt Nelson
2c883f3382 Remove redundant vmpolicy variable
This completes a TODO.

Test: still builds
Change-Id: I6298f5b8899a4e9c3a2b3f110de1a924404b9fa4
2017-09-05 16:28:26 -07:00
Felipe Leme
9852897bf6 New Autofill API: SaveRequest.getDatasetIds()
Test: modified some existing CTS tests to use it
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Fixes: 64843801

Change-Id: I95fe7766f19e5a9eea9d7138636a15cc832c704c
2017-09-01 14:01:10 -07:00
Kurt Nelson
46974a2a46 AOSP format StrictMode
This class predates having a format presubmit and is a mix of formats.

Test: formatting only
Change-Id: I0978ab51e9429131852b05f23c957bb0988bdbcd
2017-08-31 18:06:39 -07:00