blob: 3db12ed0815f81bff54ae371e820c77ce41937d0 [file] [log] [blame]
Joe Onorato5dcbc6c2017-08-29 15:13:58 -07001/**
yro947fbce2017-11-15 22:50:23 -08002 * Copyright (c) 2017, The Android Open Source Project
Joe Onorato5dcbc6c2017-08-29 15:13:58 -07003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.os;
18
19/**
Bookatz1b0b1142017-09-08 11:58:42 -070020 * Binder interface to communicate with the statistics management service.
Joe Onorato5dcbc6c2017-08-29 15:13:58 -070021 * {@hide}
22 */
Bookatzb487b552017-09-18 11:26:01 -070023interface IStatsManager {
Joe Onorato5dcbc6c2017-08-29 15:13:58 -070024 /**
Bookatz1b0b1142017-09-08 11:58:42 -070025 * Tell the stats daemon that the android system server is up and running.
Joe Onorato5dcbc6c2017-08-29 15:13:58 -070026 */
Bookatzb487b552017-09-18 11:26:01 -070027 oneway void systemRunning();
28
29 /**
30 * Tell the stats daemon that the StatsCompanionService is up and running.
31 * Two-way binder call so that caller knows message received.
32 */
33 void statsCompanionReady();
Bookatz1b0b1142017-09-08 11:58:42 -070034
35 /**
36 * Tells statsd that an anomaly may have occurred, so statsd can check whether this is so and
37 * act accordingly.
Bookatzb487b552017-09-18 11:26:01 -070038 * Two-way binder call so that caller's method (and corresponding wakelocks) will linger.
Bookatz1b0b1142017-09-08 11:58:42 -070039 */
40 void informAnomalyAlarmFired();
41
Bookatzb487b552017-09-18 11:26:01 -070042 /**
43 * Tells statsd that it is time to poll some stats. Statsd will be responsible for determing
Bookatz1b0b1142017-09-08 11:58:42 -070044 * what stats to poll and initiating the polling.
Bookatzb487b552017-09-18 11:26:01 -070045 * Two-way binder call so that caller's method (and corresponding wakelocks) will linger.
Bookatz1b0b1142017-09-08 11:58:42 -070046 */
47 void informPollAlarmFired();
David Chende701692017-10-05 13:16:02 -070048
49 /**
yro947fbce2017-11-15 22:50:23 -080050 * Tells statsd to store data to disk.
51 */
52 void writeDataToDisk();
53
54 /**
David Chende701692017-10-05 13:16:02 -070055 * Inform statsd what the version and package are for each uid. Note that each array should
56 * have the same number of elements, and version[i] and package[i] correspond to uid[i].
57 */
Dianne Hackborn3accca02013-09-20 09:32:11 -070058 oneway void informAllUidData(in int[] uid, in long[] version, in String[] app);
David Chende701692017-10-05 13:16:02 -070059
60 /**
61 * Inform statsd what the uid and version are for one app that was updated.
62 */
Dianne Hackborn3accca02013-09-20 09:32:11 -070063 oneway void informOnePackage(in String app, in int uid, in long version);
David Chende701692017-10-05 13:16:02 -070064
65 /**
66 * Inform stats that an app was removed.
67 */
68 oneway void informOnePackageRemoved(in String app, in int uid);
yro31eb67b2017-10-24 13:33:21 -070069
70 /**
David Chenadaf8b32017-11-03 15:42:08 -070071 * Fetches data for the specified configuration key. Returns a byte array representing proto
David Chen2e8f3802017-11-22 10:56:48 -080072 * wire-encoded of ConfigMetricsReportList.
yro31eb67b2017-10-24 13:33:21 -070073 */
David Chenadaf8b32017-11-03 15:42:08 -070074 byte[] getData(in String key);
yro31eb67b2017-10-24 13:33:21 -070075
76 /**
David Chen2e8f3802017-11-22 10:56:48 -080077 * Fetches metadata across statsd. Returns byte array representing wire-encoded proto.
78 */
79 byte[] getMetadata();
80
81 /**
David Chenadaf8b32017-11-03 15:42:08 -070082 * Sets a configuration with the specified config key and subscribes to updates for this
83 * configuration key. Broadcasts will be sent if this configuration needs to be collected.
84 * The configuration must be a wire-encoded StatsDConfig. The caller specifies the name of the
85 * package and class that should receive these broadcasts.
86 *
87 * Returns if this configuration was correctly registered.
yro31eb67b2017-10-24 13:33:21 -070088 */
David Chenadaf8b32017-11-03 15:42:08 -070089 boolean addConfiguration(in String configKey, in byte[] config, in String pkg, in String cls);
90
91 /**
92 * Removes the configuration with the matching config key. No-op if this config key does not
93 * exist.
94 *
95 * Returns if this configuration key was removed.
96 */
97 boolean removeConfiguration(in String configKey);
Joe Onorato5dcbc6c2017-08-29 15:13:58 -070098}