1// Signature format: 2.0
2package android.app {
3
4  public class StatsCursor extends android.database.AbstractCursor {
5    method @NonNull public String[] getColumnNames();
6    method public int getCount();
7    method public double getDouble(int);
8    method public float getFloat(int);
9    method public int getInt(int);
10    method public long getLong(int);
11    method public short getShort(int);
12    method @NonNull public String getString(int);
13    method public boolean isNull(int);
14  }
15
16  public final class StatsManager {
17    method @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public void addConfig(long, byte[]) throws android.app.StatsManager.StatsUnavailableException;
18    method @Deprecated @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public boolean addConfiguration(long, byte[]);
19    method @RequiresPermission(android.Manifest.permission.REGISTER_STATS_PULL_ATOM) public void clearPullAtomCallback(int);
20    method @Deprecated @Nullable @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public byte[] getData(long);
21    method @Deprecated @Nullable @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public byte[] getMetadata();
22    method @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public long[] getRegisteredExperimentIds() throws android.app.StatsManager.StatsUnavailableException;
23    method @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public byte[] getReports(long) throws android.app.StatsManager.StatsUnavailableException;
24    method @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public byte[] getStatsMetadata() throws android.app.StatsManager.StatsUnavailableException;
25    method @RequiresPermission(android.Manifest.permission.READ_RESTRICTED_STATS) public void query(long, @NonNull String, @NonNull android.app.StatsQuery, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<android.app.StatsCursor,android.app.StatsManager.StatsQueryException>) throws android.app.StatsManager.StatsUnavailableException;
26    method @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public void removeConfig(long) throws android.app.StatsManager.StatsUnavailableException;
27    method @Deprecated @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public boolean removeConfiguration(long);
28    method @NonNull @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public long[] setActiveConfigsChangedOperation(@Nullable android.app.PendingIntent) throws android.app.StatsManager.StatsUnavailableException;
29    method @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public void setBroadcastSubscriber(android.app.PendingIntent, long, long) throws android.app.StatsManager.StatsUnavailableException;
30    method @Deprecated @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public boolean setBroadcastSubscriber(long, long, android.app.PendingIntent);
31    method @Deprecated @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public boolean setDataFetchOperation(long, android.app.PendingIntent);
32    method @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public void setFetchReportsOperation(android.app.PendingIntent, long) throws android.app.StatsManager.StatsUnavailableException;
33    method @RequiresPermission(android.Manifest.permission.REGISTER_STATS_PULL_ATOM) public void setPullAtomCallback(int, @Nullable android.app.StatsManager.PullAtomMetadata, @NonNull java.util.concurrent.Executor, @NonNull android.app.StatsManager.StatsPullAtomCallback);
34    method @NonNull @RequiresPermission(android.Manifest.permission.READ_RESTRICTED_STATS) public long[] setRestrictedMetricsChangedOperation(long, @NonNull String, @Nullable android.app.PendingIntent) throws android.app.StatsManager.StatsUnavailableException;
35    field public static final String ACTION_STATSD_STARTED = "android.app.action.STATSD_STARTED";
36    field public static final String EXTRA_STATS_ACTIVE_CONFIG_KEYS = "android.app.extra.STATS_ACTIVE_CONFIG_KEYS";
37    field public static final String EXTRA_STATS_BROADCAST_SUBSCRIBER_COOKIES = "android.app.extra.STATS_BROADCAST_SUBSCRIBER_COOKIES";
38    field public static final String EXTRA_STATS_CONFIG_KEY = "android.app.extra.STATS_CONFIG_KEY";
39    field public static final String EXTRA_STATS_CONFIG_UID = "android.app.extra.STATS_CONFIG_UID";
40    field public static final String EXTRA_STATS_DIMENSIONS_VALUE = "android.app.extra.STATS_DIMENSIONS_VALUE";
41    field public static final String EXTRA_STATS_RESTRICTED_METRIC_IDS = "android.app.extra.STATS_RESTRICTED_METRIC_IDS";
42    field public static final String EXTRA_STATS_SUBSCRIPTION_ID = "android.app.extra.STATS_SUBSCRIPTION_ID";
43    field public static final String EXTRA_STATS_SUBSCRIPTION_RULE_ID = "android.app.extra.STATS_SUBSCRIPTION_RULE_ID";
44    field public static final int PULL_SKIP = 1; // 0x1
45    field public static final int PULL_SUCCESS = 0; // 0x0
46  }
47
48  public static class StatsManager.PullAtomMetadata {
49    method @Nullable public int[] getAdditiveFields();
50    method public long getCoolDownMillis();
51    method public long getTimeoutMillis();
52  }
53
54  public static class StatsManager.PullAtomMetadata.Builder {
55    ctor public StatsManager.PullAtomMetadata.Builder();
56    method @NonNull public android.app.StatsManager.PullAtomMetadata build();
57    method @NonNull public android.app.StatsManager.PullAtomMetadata.Builder setAdditiveFields(@NonNull int[]);
58    method @NonNull public android.app.StatsManager.PullAtomMetadata.Builder setCoolDownMillis(long);
59    method @NonNull public android.app.StatsManager.PullAtomMetadata.Builder setTimeoutMillis(long);
60  }
61
62  public static interface StatsManager.StatsPullAtomCallback {
63    method public int onPullAtom(int, @NonNull java.util.List<android.util.StatsEvent>);
64  }
65
66  public static class StatsManager.StatsQueryException extends android.util.AndroidException {
67    ctor public StatsManager.StatsQueryException(@NonNull String);
68    ctor public StatsManager.StatsQueryException(@NonNull String, @NonNull Throwable);
69  }
70
71  public static class StatsManager.StatsUnavailableException extends android.util.AndroidException {
72    ctor public StatsManager.StatsUnavailableException(String);
73    ctor public StatsManager.StatsUnavailableException(String, Throwable);
74  }
75
76  public final class StatsQuery {
77    method @IntRange(from=0) public int getMinSqlClientVersion();
78    method @Nullable public byte[] getPolicyConfig();
79    method @NonNull public String getRawSql();
80    method public int getSqlDialect();
81    field public static final int DIALECT_SQLITE = 1; // 0x1
82    field public static final int DIALECT_UNKNOWN = 0; // 0x0
83  }
84
85  public static final class StatsQuery.Builder {
86    ctor public StatsQuery.Builder(@NonNull String);
87    method @NonNull public android.app.StatsQuery build();
88    method @NonNull public android.app.StatsQuery.Builder setMinSqlClientVersion(@IntRange(from=0) int);
89    method @NonNull public android.app.StatsQuery.Builder setPolicyConfig(@NonNull byte[]);
90    method @NonNull public android.app.StatsQuery.Builder setSqlDialect(int);
91  }
92
93}
94
95package android.os {
96
97  public final class StatsDimensionsValue implements android.os.Parcelable {
98    method public int describeContents();
99    method public boolean getBooleanValue();
100    method public int getField();
101    method public float getFloatValue();
102    method public int getIntValue();
103    method public long getLongValue();
104    method public String getStringValue();
105    method public java.util.List<android.os.StatsDimensionsValue> getTupleValueList();
106    method public int getValueType();
107    method public boolean isValueType(int);
108    method public void writeToParcel(android.os.Parcel, int);
109    field public static final int BOOLEAN_VALUE_TYPE = 5; // 0x5
110    field @NonNull public static final android.os.Parcelable.Creator<android.os.StatsDimensionsValue> CREATOR;
111    field public static final int FLOAT_VALUE_TYPE = 6; // 0x6
112    field public static final int INT_VALUE_TYPE = 3; // 0x3
113    field public static final int LONG_VALUE_TYPE = 4; // 0x4
114    field public static final int STRING_VALUE_TYPE = 2; // 0x2
115    field public static final int TUPLE_VALUE_TYPE = 7; // 0x7
116  }
117
118}
119
120package android.util {
121
122  public final class StatsEvent {
123    method @NonNull public static android.util.StatsEvent.Builder newBuilder();
124  }
125
126  public static final class StatsEvent.Builder {
127    method @NonNull public android.util.StatsEvent.Builder addBooleanAnnotation(byte, boolean);
128    method @NonNull public android.util.StatsEvent.Builder addIntAnnotation(byte, int);
129    method @NonNull public android.util.StatsEvent build();
130    method @NonNull public android.util.StatsEvent.Builder setAtomId(int);
131    method @NonNull public android.util.StatsEvent.Builder usePooledBuffer();
132    method @NonNull public android.util.StatsEvent.Builder writeAttributionChain(@NonNull int[], @NonNull String[]);
133    method @NonNull public android.util.StatsEvent.Builder writeBoolean(boolean);
134    method @NonNull public android.util.StatsEvent.Builder writeBooleanArray(@NonNull boolean[]);
135    method @NonNull public android.util.StatsEvent.Builder writeByteArray(@NonNull byte[]);
136    method @NonNull public android.util.StatsEvent.Builder writeFloat(float);
137    method @NonNull public android.util.StatsEvent.Builder writeFloatArray(@NonNull float[]);
138    method @NonNull public android.util.StatsEvent.Builder writeInt(int);
139    method @NonNull public android.util.StatsEvent.Builder writeIntArray(@NonNull int[]);
140    method @NonNull public android.util.StatsEvent.Builder writeKeyValuePairs(@Nullable android.util.SparseIntArray, @Nullable android.util.SparseLongArray, @Nullable android.util.SparseArray<java.lang.String>, @Nullable android.util.SparseArray<java.lang.Float>);
141    method @NonNull public android.util.StatsEvent.Builder writeLong(long);
142    method @NonNull public android.util.StatsEvent.Builder writeLongArray(@NonNull long[]);
143    method @NonNull public android.util.StatsEvent.Builder writeString(@NonNull String);
144    method @NonNull public android.util.StatsEvent.Builder writeStringArray(@NonNull String[]);
145  }
146
147  public final class StatsLog {
148    method public static void write(@NonNull android.util.StatsEvent);
149    method @Deprecated public static void writeRaw(@NonNull byte[], int);
150    field public static final byte ANNOTATION_ID_DEFAULT_STATE = 6; // 0x6
151    field public static final byte ANNOTATION_ID_EXCLUSIVE_STATE = 4; // 0x4
152    field public static final byte ANNOTATION_ID_FIELD_RESTRICTION_ACCESSIBILITY = 14; // 0xe
153    field public static final byte ANNOTATION_ID_FIELD_RESTRICTION_AMBIENT_SENSING = 17; // 0x11
154    field public static final byte ANNOTATION_ID_FIELD_RESTRICTION_APP_ACTIVITY = 12; // 0xc
155    field public static final byte ANNOTATION_ID_FIELD_RESTRICTION_APP_USAGE = 11; // 0xb
156    field public static final byte ANNOTATION_ID_FIELD_RESTRICTION_DEMOGRAPHIC_CLASSIFICATION = 18; // 0x12
157    field public static final byte ANNOTATION_ID_FIELD_RESTRICTION_HEALTH_CONNECT = 13; // 0xd
158    field public static final byte ANNOTATION_ID_FIELD_RESTRICTION_PERIPHERAL_DEVICE_INFO = 10; // 0xa
159    field public static final byte ANNOTATION_ID_FIELD_RESTRICTION_SYSTEM_SEARCH = 15; // 0xf
160    field public static final byte ANNOTATION_ID_FIELD_RESTRICTION_USER_ENGAGEMENT = 16; // 0x10
161    field public static final byte ANNOTATION_ID_IS_UID = 1; // 0x1
162    field public static final byte ANNOTATION_ID_PRIMARY_FIELD = 3; // 0x3
163    field public static final byte ANNOTATION_ID_PRIMARY_FIELD_FIRST_UID = 5; // 0x5
164    field public static final byte ANNOTATION_ID_RESTRICTION_CATEGORY = 9; // 0x9
165    field public static final byte ANNOTATION_ID_STATE_NESTED = 8; // 0x8
166    field public static final byte ANNOTATION_ID_TRIGGER_STATE_RESET = 7; // 0x7
167    field public static final byte ANNOTATION_ID_TRUNCATE_TIMESTAMP = 2; // 0x2
168    field public static final int RESTRICTION_CATEGORY_AUTHENTICATION = 3; // 0x3
169    field public static final int RESTRICTION_CATEGORY_DIAGNOSTIC = 1; // 0x1
170    field public static final int RESTRICTION_CATEGORY_FRAUD_AND_ABUSE = 4; // 0x4
171    field public static final int RESTRICTION_CATEGORY_SYSTEM_INTELLIGENCE = 2; // 0x2
172  }
173
174}
175
176