5616 Commits

Author SHA1 Message Date
Jiyong Park
db589dded4 Mark some aidl_interface modules as unstable
With b/152655547, all aidl_interface modules are considered as stable
unless it is explicitly with "unstable: true". This change marks the
aidl_interface that are not used across updatable module bounraries
as unstable, so that the build system does not run the API
dumping/checking on them.

Bug: 152655547
Test: m
Change-Id: I1257c66de6dd42b2d32d47ed74cb2878f79d14fb
2020-04-13 13:00:47 +09:00
Tej Singh
e715d2f0e7 Merge "Statsd test mapping" into rvc-dev 2020-04-11 03:49:17 +00:00
Jeffrey Huang
b010fc5534 Merge changes I3f912418,Idd2465d5 into rvc-dev
* changes:
  Send boot completed to statsd
  Send puller registration signal to statsd
2020-04-10 18:38:00 +00:00
Ryan Mitchell
6cb79cdfb7 Merge changes from topic "invalidate_idmap" into rvc-dev
* changes:
  Fix InstallOverlayTests fail to install overlay
  Test that upgrading target apk invalidates idmap
  Invalidate idmap when target updates
2020-04-10 15:50:15 +00:00
TreeHugger Robot
926a6d7a33 Merge "Whitelist MediaProvider for statsd metrics" into rvc-dev 2020-04-10 06:19:52 +00:00
TreeHugger Robot
89d5f51c7e Merge "Improve MediaProvider WW atoms" into rvc-dev 2020-04-10 06:19:46 +00:00
Tej Singh
5d823b30fa Statsd test mapping
Makes a test mapping for statsd so that unit tests run on presubmit.

Changes to make the tests pass:
1. Require root. This is needed to write to disk, since the tests don't
run as statsd's uid

2. Remove AndroidTest.xml file in favor of the autogenerated one.

3. Remove a check in StatsService.test for getUidFromArgs. The test
checked a failure case where we passed a number bigger than INT32_MAX.
However, on a 32 bit device, strtol will return INT32_MAX when an
overflow happens, since it returns a 32 bit number on a 32 bit device.

4. Refactor a lot of e2e tests to sort dimensions, ensuring that the
dimensions are always in order, instead of relying on implicit ordering
of hashing, which can change.

5. Change a long to an int64 in TestActivationsPersistAcrossSystemServerRestart

Test: statsd_test
Bug: 129613474
Change-Id: I80dfa3bfd50ebe6d2c8c0c3ba201f3ad06b68910
2020-04-09 22:20:59 -07:00
Jeffrey Huang
d8f533060d Send boot completed to statsd
Bug: 153384066
Test: m -j
Change-Id: I3f91241851a93d0869dad210bc278b3a1ba6b762
2020-04-09 17:29:19 -07:00
TreeHugger Robot
d11054d31f Merge "[stats] add metrics for package installer v2" into rvc-dev 2020-04-09 21:22:09 +00:00
Nikita Ioffe
e9ed63aa92 Merge "Introduce static @hide PowerManager.isRebootingUserspaceSupportedImpl()" into rvc-dev 2020-04-09 16:39:54 +00:00
Songchun Fan
c296cf746a [stats] add metrics for package installer v2
// Successful installation:
$ out/host/linux-x86/bin/statsd_testdrive -s 98141FFBA005QD 263
...
event_metrics {
  data {
    elapsed_timestamp_nanos: 147291968369
    atom {
      package_installer_v2_reported {
        is_incremental: true
        package_name: "com.unity.megacity"
        duration_millis: 1379
        return_code: 1
      }
    }
  }
}
...

// Failed installation:
$ out/host/linux-x86/bin/statsd_testdrive -s 98141FFBA005QD 263
...
event_metrics {
  data {
    elapsed_timestamp_nanos: 94418812060
    atom {
      package_installer_v2_reported {
        is_incremental: true
        package_name: ""
        duration_millis: 37
        return_code: -20
      }
    }
  }
}
...

Test: manual
BUG: 152913040
Change-Id: Ibb02122e7007f8e3afd65cbb98236bc37c0d24db
2020-04-09 09:33:34 -07:00
Nikita Ioffe
57300d9057 Introduce static @hide PowerManager.isRebootingUserspaceSupportedImpl()
This method consolidates logic of testing whenever rebooting userspace
is supported in a place that can be used both from
PowerMager.isRebootingUserspaceSupported() API and from
PowerManagerService.reboot() implementation.

Consequently, this makes `adb shell svc power reboot userspace` also
benefit from that check, and fail userspace reboot on devices that don't
support it.

Also tweaked logic of ignoring RemoteException to take into account
userspace reboot.

Test: adb root
Test: adb shell setprop init.userspace_reboot.is_supported 0
Test: adb shell svc power reboot userspace & verified error message
Test: adb shell setprop init.userspace_reboot.is_supported 1
Test: adb shell svc power reboot userspace & verified no error message
Test: atest PowerManagerTest
Test: atest CtsUserspaceRebootHostSideTestCases
Bug: 152803929
Change-Id: I2d3a8e0ae1320c408a838c5c5fdf4cd977b167b3
2020-04-09 14:07:22 +01:00
Hyunyoung Song
b3a298d4af Merge "Flatten LauncherUIChanged / Migrate Launcher Workspace snapshot data" into rvc-dev 2020-04-09 08:03:36 +00:00
Jeffrey Huang
d7fda53855 Send puller registration signal to statsd
Bug: 153384066
Test: m -j
Change-Id: Idd2465d52e6720d7bce26ecc7998721b9d9790e3
2020-04-08 22:20:41 -07:00
Hyunyoung Song
0ff10a4a4a Flatten LauncherUIChanged / Migrate Launcher Workspace snapshot data
Bug: 137777105
Bug: 144953948

Test: builds

Change-Id: I55b5e952cdd2579cae1ec85b6f90949c8ccd40f8
2020-04-08 22:03:08 -07:00
Ruchir Rastogi
ffa34f05cf Remove kAtomsWithUidField from atoms_info
Instead of using the map from atoms_info, we now receive uid information
in the form of StatsEvent annotations. The isUid annotation is exposed
from both LogEvent and FieldValue.

Test: bit statsd_test:*
Test: atest GtsStatsdHostTestCases
Bug: 150414601
Change-Id: Iebbe4ce5668de1ab91485daa1be9197cde6e8309
2020-04-08 19:09:33 -07:00
Christine Tsai
5205e14500 Merge "statsd unit test and benchmark refactor" into rvc-dev 2020-04-08 23:09:17 +00:00
TreeHugger Robot
7284bf15da Merge "Fix AIBinder_linkToDeath cookies" into rvc-dev 2020-04-08 18:52:00 +00:00
tsaichristine
8dca82ed94 statsd unit test and benchmark refactor
Abstract test utilities into two new functions: writeAttribution and
parseStatsEventToLogEvent

Bug: 149590301
Test: bit statsd_test:*
&& bit statsd_benchmark:*

Change-Id: I5f77646b6d2d828344b8b6de8777a60d98f96d58
2020-04-08 11:48:09 -07:00
Zhen Sun
45ab4ecb34 Merge "Add module for TvSettingsUIInteracted atom" into rvc-dev 2020-04-08 18:12:57 +00:00
Ruchir Rastogi
e20c53e5b1 Fix AIBinder_linkToDeath cookies
StatsPullerManager should be declared on the heap because wp's can only
point to objects on the heap.

Test: bit statsd_test:*
Test: atest GtsStatsdHostTestCases
Test: atest CtsStatsdHostTestCases
Bug: 153237308
Change-Id: I579375f5bd2db9557f108f39916d69f368865478
2020-04-08 10:07:48 -07:00
shafik
96652137ad Whitelist MediaProvider for statsd metrics
Now that MediaProvider is a mainline module, we need to whitelist it in
statsd in order to enable pushing metrics from it.

Test: ./out/host/linux-x86/bin/statsd_testdrive -p \
      com.google.android.providers.media.module 233
Fix: 153160314
Bug: 149669087
Change-Id: I5237663de2b24d467283d2c2b60f7155fb5b5e53
2020-04-08 13:28:13 +01:00
shafik
4382584207 Improve MediaProvider WW atoms
Rename MediaProvider atoms to past tense verbs.

Slightly redefine the atoms for MediaProvider event metrics.
The changes are:
1. Remove timestamps from all atoms (because WW already attaches
timestamps to its events).
2. Log UIDs instead of package names.

Test: build
Bug: 149669087
Change-Id: I6bfb1da7e645f86d1b4a850f68614bc8fe105568
2020-04-08 13:26:46 +01:00
Tej Singh
fa49ff93f9 Merge "Move proto, c++, and test libs to static" into rvc-dev 2020-04-08 00:37:49 +00:00
Zhen Sun
7dbb51a36a Add module for TvSettingsUIInteracted atom
Adopt the autogenerated API on R branch by adding module for my atom.

Metrics council review bug: 151768952
Bug: 150979527
Test: the Android tree still builds normally

Change-Id: I608d2d8f2afd83a3975d8ffa844bc9310d988817
2020-04-07 16:05:12 -07:00
Chi Zhang
01e1c645e4 Add radio to default pull sources in statsd_testdrive.
Bug: 151642352
Test: m statsd_testdrive and manual test
Change-Id: I3411dba98b2087f401adfe374450f187b719b4b3
2020-04-07 20:57:09 +00:00
Ryan Mitchell
09943af999 Test that upgrading target apk invalidates idmap
This change adds tests that run in presubmit to verify that updating
the target APK invalidates the idmap for overlays targeting the
target.

Bug: 147794117
Bug: 150877400
Test: atest PackagedUpgradedTest
Change-Id: I0268ea99dc7beb4bbc7009a67d9929e2d82862cb
2020-04-07 12:15:03 -07:00
Ryan Mitchell
a90930528d Invalidate idmap when target updates
When the target package update, check if the idmap file must change.
If so, propagate the idmap changes to the targets overlay paths, and
invalidate cached overlay ApkAssets in ResourcesManager.

Bug: 147794117
Bug: 150877400
Test: OverlayRemountedTest
Test: libandroidfw_tests
Change-Id: I6115c30bae3672b188a5ff270720a0eea15b43b5
2020-04-07 12:14:51 -07:00
Tej Singh
1d4b4653cd Move proto, c++, and test libs to static
Link libgtest_prod, libprotobuf-cpp-lite, and libc++ statically.
This reduces the size of the statsd apex from 2.8M to 1.6M.

Initial:
blueline:/apex/com.android.os.statsd # du -h
16K	./lost+found
764K	./bin
1.3M	./lib64
8.0K	./etc
600K	./lib
120K	./javalib
2.8M	.

After linking proto lite and libgtest_prod statically (saves ~500kb):
blueline:/apex/com.android.os.statsd # du -h
16K	./lost+found
800K	./bin
876K	./lib64
8.0K	./etc
600K	./lib
120K	./javalib
2.3M	.

After also linking libc++ statically (saves ~700kb):
blueline:/apex/com.android.os.statsd # du -h
16K	./lost+found
0.9M	./bin
296K	./lib64
8.0K	./etc
204K	./lib
120K	./javalib
1.6M	.

After this change, the only libraries in both /lib and /lib64 are:
libstats_jni.so
libstatspull.so
libstatssocket.so

These are the 3 libraries we actually want to ship.

Test: m
Test: bit statsd_test:*
Test: atest GtsStatsdHostTestCases
Test: manually inspecting the size of the apex, statsd binary, and
libraries
Bug: 153349706
Bug: 153349659
Bug: 153350187

Change-Id: I00796fc1cf33e394422c6dc617a8430a5f5c5bbb
2020-04-06 20:01:49 -07:00
TreeHugger Robot
d5729ebc66 Merge "Remove obsolete/infeasible TODOs" into rvc-dev 2020-04-07 00:12:09 +00:00
Ruchir Rastogi
1d4fdcb6de Remove obsolete/infeasible TODOs
(a) Clean up LogEvent::parseBuffer - having those variables be member
variables really helps with code readability.

(b) Don't hold locks when writing to pipe within ShellSubscriber -
ag/150969574 describes why holding a lock is necessary.

Test: m
Bug: 150312423 (allows this bug to be marked as obsolete)
Change-Id: I4903de1dc87a552932b70e5975a7cde91df05b3b
2020-04-06 14:10:04 -07:00
Stanislav Zholnin
03aa32160d Merge "Add AppOpEnum field to represent op_id in RuntimeAppOpAccess atom." into rvc-dev 2020-04-05 13:35:03 +00:00
Muhammad Qureshi
3f9c330eef Make state_option top-level boolean annotations
- Add AnnotationId enum stats-log-api-gen
- Rename RESET_STATE annotation to TRIGGER_STATE_RESET. Also rename the proto annotation.

Bug: 152412767
Test: stats-log-api-gen-test
Test: m statslog-framework-java-gen
Change-Id: I2c12ea0b9222ef28b8cc11ea36b272e518a96259
2020-04-03 17:00:55 -07:00
Christine Tsai
f3d5e7329b Merge "Clean up unused LogEvent constructors" into rvc-dev 2020-04-03 21:03:57 +00:00
tsaichristine
c7911dd000 Clean up unused LogEvent constructors
After switching to the new socket schema, we can remove certain LogEvent
constructors. AttributionNodeInternal was only used in tests and can be
removed as well.

Bug: 14959031
Test: bit statsd_test:*
Change-Id: Ib5cb6acc50cc4d37a46a076d41face452a0a87d8
2020-04-03 12:12:24 -07:00
TreeHugger Robot
6f9b5cc365 Merge "[statsd/tools] allow multiple connected devices" into rvc-dev 2020-04-03 18:22:01 +00:00
Christine Tsai
d4abb2f9ff Merge "Remove StateConditionTracker from statsd" into rvc-dev 2020-04-03 18:13:06 +00:00
tsaichristine
3d8e12a5ef Remove StateConditionTracker from statsd
StateConditionTracker was previously used as a way to slice by state
through a specific SimplePredicate definition. It is currently being
replaced by StateTracker, and no metrics use StateConditionTracker at
this time.

Bug: 136566566
Test: bit statsd_test:*
Change-Id: I1a14747907c23482a1b7500c6d7f07cd2f1d4aed
2020-04-03 09:41:52 -07:00
Siarhei Vishniakou
01c36833b9 Merge "Updated documentation for CTS uhid tests" into rvc-dev 2020-04-03 15:58:33 +00:00
Tej Singh
d8049352da Turn on uid sandboxing
Test: bit statsd_test:*
Test: atest GtsStatsdHostTestCases
Test: atest CtsStatsdHostTestCases
Bug: 152543345
Change-Id: Ie1fda2fefe0b03454fb91b2645f56431f04adcc1
2020-04-02 23:31:08 -07:00
Tej Singh
b23d417614 Merge "Link to death for pullers" into rvc-dev 2020-04-03 01:04:57 +00:00
tsaichristine
1449fa4661 Slice by state in DurationMetricProducer
- Added #onStateChanged logic to DurationMetricProducer
- Only SUM aggregation type supports state slicing.
OringDurationTrackers now track durations keyed by different state
values.
- Added unit tests for DurationMetricProducer state changes

Test: bit statsd_test:*
Bug: 145838038
Bug: 136566566
Change-Id: I87dcc21bb904ef0fa76ea196d60dadae00f310fa
Merged-In: I735c7deee96639c32cad4b907e59b354dfd98d77
2020-04-02 14:53:40 -07:00
Ruchir Rastogi
c0a892456b Merge "Store annotation info in LogEvent/FieldValue" into rvc-dev 2020-04-02 15:49:22 +00:00
Muhammad Qureshi
c598ff319c Merge "Log annotations for pulled atoms." into rvc-dev 2020-04-02 13:59:18 +00:00
Stanislav Zholnin
3a2a6e4f1c Add AppOpEnum field to represent op_id in RuntimeAppOpAccess atom.
Deprecate string field for Appop id.

Test: ./out/host/linux-x86/bin/statsd_testdrive 10069
Bug: 143519689
Change-Id: I62b245e09a6c6f2dcf769b0e6942057eb94293fe
2020-04-02 09:31:07 +00:00
Tej Singh
dd25c825df Link to death for pullers
Set linkToDeath for IPullAtomCallbacks and remove them from the puller
map.

Bug: 146439412
Test: bit statsd_test:*
Test: manually killed system server and made sure all binder deaths were
received

Change-Id: Iba440156b9832d6514d8a9515124d29227dd4123
2020-04-01 16:33:50 -07:00
Farid Chahla
853f0d322a Updated documentation for CTS uhid tests
A new field was added where bus can be specified for testing uhid
devices. This commit adds the relevant documention to the README.

Bug: 144949707
Test: none

Change-Id: If5f6673dd0fdd268b702119b6ccd4abdc37f65bd
2020-04-01 20:50:55 +00:00
Jeffrey Huang
898dda3919 Merge changes Icd1b1e57,Ib9c6b9b4 into rvc-dev
* changes:
  Load Metadata from Disk
  Save metadata to Disk
2020-04-01 18:56:26 +00:00
Ruchir Rastogi
13296519fa Store annotation info in LogEvent/FieldValue
Test: bit statsd_test:*
Bug: 151109630
Change-Id: I9e07400baed51d5e0b507d9b11118bd29bf41708
2020-04-01 10:03:34 -07:00
Songchun Fan
44e7c134d4 [statsd/tools] allow multiple connected devices
// Multiple devices connected
Test: adb devices
List of devices attached
02211FQC200065	device
98141FFBA005QD	device
Test: out/host/linux-x86/bin/statsd_testdrive -s 98141FFBA005QD 261
Test: out/host/linux-x86/bin/statsd_localdrive -s 98141FFBA005QD get-data 261

// Single device connected
Test: adb devices
98141FFBA005QD	device
Test: out/host/linux-x86/bin/statsd_testdrive 261
Test: out/host/linux-x86/bin/statsd_localdrive get-data 261

BUG: 152913040
Change-Id: I54009b9151565ddb5512a4f7b3ff8ef67c3a2055
2020-04-01 09:27:52 -07:00