blob: 8a27700edc15793a02b23a0b4c356053bbf0aefd [file] [log] [blame]
Bookatz94726412017-08-31 09:26:15 -07001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
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
Bookatzc6977972018-01-16 16:55:05 -080019import android.os.StatsDimensionsValue;
David Chen1481fe12017-10-16 13:16:34 -070020import android.os.StatsLogEventWrapper;
21
Bookatz94726412017-08-31 09:26:15 -070022/**
23 * Binder interface to communicate with the Java-based statistics service helper.
24 * {@hide}
25 */
Bookatzc68a9d22017-09-27 14:09:55 -070026interface IStatsCompanionService {
Bookatz94726412017-08-31 09:26:15 -070027 /**
Bookatzb487b552017-09-18 11:26:01 -070028 * Tell statscompanion that stastd is up and running.
29 */
Bookatzc68a9d22017-09-27 14:09:55 -070030 oneway void statsdReady();
Bookatzb487b552017-09-18 11:26:01 -070031
32 /**
Bookatz94726412017-08-31 09:26:15 -070033 * Register an alarm for anomaly detection to fire at the given timestamp (ms since epoch).
34 * If anomaly alarm had already been registered, it will be replaced with the new timestamp.
35 * Uses AlarmManager.set API, so if the timestamp is in the past, alarm fires immediately, and
36 * alarm is inexact.
37 */
Bookatzc68a9d22017-09-27 14:09:55 -070038 oneway void setAnomalyAlarm(long timestampMs);
Bookatz1b0b1142017-09-08 11:58:42 -070039
Bookatz94726412017-08-31 09:26:15 -070040 /** Cancel any anomaly detection alarm. */
Bookatzc68a9d22017-09-27 14:09:55 -070041 oneway void cancelAnomalyAlarm();
Bookatz94726412017-08-31 09:26:15 -070042
43 /**
44 * Register a repeating alarm for polling to fire at the given timestamp and every
45 * intervalMs thereafter (in ms since epoch).
46 * If polling alarm had already been registered, it will be replaced by new one.
47 * Uses AlarmManager.setRepeating API, so if the timestamp is in past, alarm fires immediately,
48 * and alarm is inexact.
49 */
Chenjie Yub3dda412017-10-24 13:41:59 -070050 oneway void setPullingAlarms(long timestampMs, long intervalMs);
Bookatz1b0b1142017-09-08 11:58:42 -070051
Bookatz94726412017-08-31 09:26:15 -070052 /** Cancel any repeating polling alarm. */
Chenjie Yub3dda412017-10-24 13:41:59 -070053 oneway void cancelPullingAlarms();
Bookatzc68a9d22017-09-27 14:09:55 -070054
55 /** Pull the specified data. Results will be sent to statsd when complete. */
David Chen1481fe12017-10-16 13:16:34 -070056 StatsLogEventWrapper[] pullData(int pullCode);
David Chenadaf8b32017-11-03 15:42:08 -070057
58 /** Send a broadcast to the specified pkg and class that it should getData now. */
Bookatzc6977972018-01-16 16:55:05 -080059 // TODO: Rename this and use a pending intent instead.
David Chenadaf8b32017-11-03 15:42:08 -070060 oneway void sendBroadcast(String pkg, String cls);
David Chenc136f452017-11-27 11:52:26 -080061
Bookatzc6977972018-01-16 16:55:05 -080062 /**
63 * Requests StatsCompanionService to send a broadcast using the given intentSender
64 * (which should cast to an IIntentSender), along with the other information specified.
65 */
66 oneway void sendSubscriberBroadcast(in IBinder intentSender, long configUid, long configId,
67 long subscriptionId, long subscriptionRuleId,
68 in StatsDimensionsValue dimensionsValue);
69
David Chenc136f452017-11-27 11:52:26 -080070 /** Tells StatsCompaionService to grab the uid map snapshot and send it to statsd. */
71 oneway void triggerUidSnapshot();
Bookatz94726412017-08-31 09:26:15 -070072}