2599 Commits

Author SHA1 Message Date
Yi Jin
4bab3a191a Fix permissions problems of incidentd.
Test: manual
Change-Id: I4ee0d1f2349ee1a25a422cabf1b5b87c612710d2
2018-01-17 19:16:49 -08:00
TreeHugger Robot
3b9567187e Merge "Update the AID -> UID mapping." 2018-01-17 20:53:35 +00:00
Yao Chen
29f79b5623 Update the AID -> UID mapping.
Test: statsd_test
Change-Id: I43c004b765b0cc221ec2e02c9979890e5d55d570
2018-01-17 11:00:20 -08:00
TreeHugger Robot
004e782ee5 Merge "Add a statsd proto static lib for cts and others." 2018-01-17 01:31:29 +00:00
Yangster-mac
87718e283a Gauge metric e2e test
Test: new test passed
Change-Id: I6a8bceb43fbb6e7b82f47951e71b5620779f2ceb
2018-01-15 20:41:08 -08:00
yro
079cea9a7e Create /data/misc/stats-data/ and /data/misc/stats-service/ in statsd.rc
rather than during the runtime of statsd

The purpose of this change is to prevent causing selinux violation by
trying to mkdir to /data/misc/ directory when statsd doesn't have
permission to do so.

Bug: 71537285
Test: manually tested to make sure that there's no sepolicy violation

Change-Id: I9c4ccecc416f41923c9b24dd44a388d135fecc07
2018-01-12 13:51:48 -08:00
TreeHugger Robot
964be9ab42 Merge "pull absolute value for cpu time per frequency." 2018-01-12 00:54:34 +00:00
TreeHugger Robot
1ee8514101 Merge "Log attribution to statsd for pushed atoms." 2018-01-11 21:57:40 +00:00
Yao Chen
0f2171041e make statsd run in its own uid
+ Assign permission android.permission.STATSCOMPANION to statsd
+ Fixes in StatsCompanionService to allow statsd to get uid mapping

Test: manual
Change-Id: I3e6ca79eefed7f93a4588578c156321c4c278fd3
2018-01-11 11:58:10 -08:00
TreeHugger Robot
fdb4c48cb2 Merge "Update statsd's user/group from root to system to avoid selinux policy violation" 2018-01-11 18:33:30 +00:00
Yangster-mac
afad8c6b43 Log attribution to statsd for pushed atoms.
Will avoid allocating temp objects in a following CL after the new StatsLog API is in.

Test: all statsd unit test passed.
Change-Id: Id5f6a908d9d42732d83d9985b1b34b29230a7f20
2018-01-11 09:33:13 -08:00
Chenjie Yu
1ee9b7413c pull absolute value for cpu time per frequency.
Test: cts test
Change-Id: I519616905ed8ec6afdaa7e1a0743e279009aa0e5
2018-01-11 09:27:28 -08:00
yro
b19dc2467b Update statsd's user/group from root to system to avoid selinux policy
violation

Bug: 71537285
Bug: 69853944
Test: manual verification to check there's no sepolicy violation

Change-Id: I639cf5c9f4ac6c434c3122c4f42fdf8bdac721f6
2018-01-10 22:26:30 -08:00
TreeHugger Robot
6b00b9a0de Merge "More adjustments to the loadtest app." 2018-01-11 05:44:52 +00:00
Yao Chen
459dee6c51 Add a statsd proto static lib for cts and others.
Test: build
Change-Id: I0119320cba093dc0f758a890ffb9e595b39324ec
2018-01-10 16:47:05 -08:00
TreeHugger Robot
7a2c9d9859 Merge "make incidentd run in its own uid under log group for reading logs." 2018-01-11 00:18:09 +00:00
Yi Jin
30789db28c make incidentd run in its own uid under log group for reading logs.
Test: manual
Change-Id: I7106614c0bed1e862fbc80e42a87b43efc063145
2018-01-10 13:20:14 -08:00
TreeHugger Robot
5d74343545 Merge "Map isolated uid to host uid when processing log event in statsD." 2018-01-10 18:50:55 +00:00
Stefan Lafon
47c186ca32 More adjustments to the loadtest app.
- Add ability to set the replication factor by intent.
- Add shell script to automate the loadtesting.

Test: Loadtest app works.

Change-Id: I7263a3c23049f3ed20144e4e15b6a54ac5fddcc8
2018-01-10 09:27:38 -08:00
Yangster-mac
d40053eb8b Map isolated uid to host uid when processing log event in statsD.
Test: added test case for isolated uid in Attribution e2e test.
Change-Id: I63d16ebee3e611b1ef0c910e5154cf27766cb330
2018-01-09 21:45:46 -08:00
Jerry Zhang
8f66b9eb29 Merge "Add setScreenUnlockedFunctions method to UsbManager" 2018-01-10 01:30:03 +00:00
TreeHugger Robot
d6808dc0c0 Merge "E2e test: attribution matching and slicing by attribution." 2018-01-10 00:22:45 +00:00
Jerry Zhang
30b9adfad1 Add setScreenUnlockedFunctions method to UsbManager
The screen unlocked functions save effort on setting
the usb config during each connection. These
functions persist between connections and between
boots. When the screen is unlocked and these
functions are set, the current functions will
be automatically set to the screen unlocked functions.

Also added svc command for this so it can be
used and tested while the UI is worked on.

Bug: 62876645
Test: svc usb setScreenUnlockedFunctions mtp
Test: Test functions with locking, unlocking, and
disconnecting, with no lockscreen, swipe, and pattern

Change-Id: Ia05e095917166d25398c4d310b02971e3a1bb12a
2018-01-09 15:36:35 -08:00
Bookatz
1bf94382d0 Anomaly detection is per dimension
Anomalies are now detected and declared per dimension. This means that
declareAnomaly now gets access to the key that is responsible for the
anomaly. Moreover, the refractory period is per dimension, not overall.
So a second anomaly for the same metric but a different dimension can
fire within the first dimension's refractory period. Thus, if app A
misbehaves and app B misbehaves shortly thereafter, they will both be
detected.

Eventually this key will be passed to the subscribers, although this cl
doesn't do anything with it.

Test: adb shell data/nativetest64/statsd_test/statsd_test
Change-Id: Id76856dc44fe9ecf91ac81a423e84f97c81d30ab
2018-01-09 11:29:41 -08:00
TreeHugger Robot
26d5b41fdb Merge "Cap the size of ice box in StatsdStats." 2018-01-09 17:03:17 +00:00
Olivier Gaillard
aed7f12d4a Add atoms for app startup time.
These atoms match exactly what we currently send through Tron.

Test: manual
Change-Id: I36809417c8d5c62d60035be696ddf506243ee2a9
2018-01-09 14:33:55 +00:00
TreeHugger Robot
c131a9297b Merge changes Ibe8c8d3c,I4a475d6f
* changes:
  Thread-safety at log processor level.
  Handle null string in jni and c++ stats-log-api interfaces.
2018-01-09 10:03:01 +00:00
TreeHugger Robot
c99dea0a4b Merge "Revert "Enable incidentd, it will just be idle while no one triggers it."" 2018-01-09 03:28:11 +00:00
Yi Jin
44ed76eb9f Revert "Enable incidentd, it will just be idle while no one triggers it."
This reverts commit d612df381e7867780266f0a1161b817e089c3bb6.

Reason for revert: Selinux denials, see b/71591707 for more details.

Change-Id: I864cd74e7ba57d67e2ed8328a7df9c5ff335508c
2018-01-09 01:44:47 +00:00
TreeHugger Robot
9761f47e84 Merge "Some fixes in duration metrics" 2018-01-08 23:42:26 +00:00
Yao Chen
f6723dfcf0 Cap the size of ice box in StatsdStats.
+ only keep the last 20 old config stats.

Test: statsd_test
Change-Id: I5bff68299bb9e4def7f7b54aa1d347133bc7a768
2018-01-08 15:18:00 -08:00
Yangster-mac
b0d0628a29 Thread-safety at log processor level.
Test: statsd unit test passed.

Change-Id: Ibe8c8d3cc8297875b16ee385c077b71c87353147
2018-01-08 14:59:42 -08:00
Yi Jin
fbef27ab4a Merge "Implement a new type of section which reads from logd and dumps proto." 2018-01-08 20:52:54 +00:00
Yao Chen
d59a6589fa Some fixes in duration metrics
+ Don't need to keep the condition key if the condition is not sliced.
+ Whiten the hash before returning.

Test: statsd_test
Change-Id: Ie0bcb14b3adc4a15b79ba3be050431a672a68c28
2018-01-08 11:17:11 -08:00
Yangster-mac
b5bc74122f E2e test: attribution matching and slicing by attribution.
Test: statsd unit tests passed.
Change-Id: I05875b80a9a1ab5f87a478d1f63543f9798254a5
2018-01-06 23:23:19 -08:00
Yi Jin
3c034c987e Implement a new type of section which reads from logd and dumps proto.
And implement a file section which reads from event-log-tags for
decoding binary logs.

Bug: 70936599
Test: atest incidentd_test && atest incident_helper_test and flush on
device and test log sections and event_log_tag_map
Change-Id: Ib3d35e317f355de69f01ded012482486e9a43da6
2018-01-06 20:33:14 -08:00
TreeHugger Robot
a7afd1311a Merge "Fix a few things with the loadtest app." 2018-01-06 04:37:59 +00:00
Stefan Lafon
c6f2fa2700 Fix a few things with the loadtest app.
Test: Loadtest app is running fine.

Change-Id: I834f6c618f5a6b0b17ecd5592e2ab2209ce7b94a
2018-01-05 17:02:56 -08:00
Chenjie Yu
b038b70956 pullers now cache data to throttle frequent pull requests.
all pullers have a default 1s cool down before next pull.
We can adjust these later.
Also add puller stats in StatsdStats

Test: unit test
Change-Id: I71894a24c41e059d841591312dbb852f54387b7d
2018-01-05 15:49:59 -08:00
TreeHugger Robot
4735b97d84 Merge "Updates atoms.proto for statsd." 2018-01-05 18:44:54 +00:00
TreeHugger Robot
a068cd68c0 Merge "Binding on-demand #8: Miscellaneous usages" 2018-01-05 18:21:53 +00:00
Bernardo Rufino
fa51853ae5 Binding on-demand #8: Miscellaneous usages
Migrate usages of the transport binder to binding on-demand:
* getDestinationString()
* isAppEligibleForBackup()
* dump()

For getDestinationString() we'll be introducing an invisible bug for
people that haven't updated GMSCore to include the usage of
updateTransportAttributes() API introduced in earlier CL. The bug is
that that text won't change, it'll remain constant. It's invisible
because currently only place that uses that method is Settings in some
circumstances that depend on the transport, and those circunstances
don't happen with our transports. Check http://ag/1831025.

For isAppEligibleForBackup(), a new filterAppsEligibleForBackup() is
created and there we bind on-demand.

Change-Id: Idc9e31f0e8eda8531e204c05a84fafdaf0247d08
Ref: http://go/br-binding-on-demand
Bug: 17140907
Test: adb shell dumpsys backup, observe destination of transports
Test: adb shell bmgr backupnow --all, observe only eligible apps got backed-up
Test: Force-loaded settings screen and observed destination string
Test: m -j RunFrameworksServicesRoboTests
2018-01-05 16:33:33 +00:00
Howard Ro
7266e82cf8 Merge "Use the configs from disk after reboot and separate out ConfigManager startup for unit test to avoid reading configs for tests" 2018-01-05 06:44:38 +00:00
Yangster-mac
a070b6a40c Bug fix: gauge metric producer does not need the atom id parameter.
Test: statsd unit test passed
Change-Id: Ifd1e2f7a05a03886eb227ac1ae0e30b884e49f0c
2018-01-05 04:34:49 +00:00
Jeff Sharkey
c9cbc3e5fc Merge "FBE devices now fully support adoptable storage." 2018-01-05 03:53:56 +00:00
Jeff Sharkey
8eb783b21e FBE devices now fully support adoptable storage.
We've finished all the underlying work to support adoptable storage
on FBE devices, so remove the code that was disabling it by default.

Introduce feature flag to make it easier to detect devices that
support adoptable storage.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AdoptableHostTest
Bug: 29923055, 25861755, 33252673, 37289651
Change-Id: I3630d690c9e66c7e41e316a4263ea2eb1e752ad3
2018-01-04 18:50:14 -07:00
Yangster-mac
d19bcae42d Move Field proto out of stats_log.proto to keep it clean.
Test: statsd unit test passed.

Change-Id: I31ffea40cf1b82c16bf37c706969bfb159639c7b
2018-01-04 16:39:52 -08:00
yro
469cd80840 Use the configs from disk after reboot and separate out ConfigManager
startup for unit test to avoid reading configs for tests

Bug: 70667694
Test: manual testing conducted, statsd, statsd_test
Change-Id: I49cb82d2b1d7c178b7a4c30c089d8d93e7902faa
2018-01-04 15:00:48 -08:00
TreeHugger Robot
efc331b287 Merge "Use TimeUnit enum to specify the bucket size." 2018-01-04 22:53:29 +00:00
Yangster-mac
b814481ad1 Use TimeUnit enum to specify the bucket size.
Test: all statsd unit test passed

Change-Id: I4f6b80ba2f8c984b06e46e6de6df3e546e99a968
2018-01-04 13:01:14 -08:00