Debian Codegraph @

core/java/android/service/contentcapture/FlushMetrics.java

raw symbols SCIP
1 /*
2 * Copyright (C) 2019 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
17 package android.service.contentcapture;
18
19 import android.annotation.NonNull;
20 import android.os.Parcel;
21 import android.os.Parcelable;
22
23 /**
24 * Holds metrics for content capture events flushing.
25 *
26 * @hide
27 */
28 public final class FlushMetrics implements Parcelable {
29 public int viewAppearedCount;
30 public int viewDisappearedCount;
31 public int viewTextChangedCount;
32 public int sessionStarted;
33 public int sessionFinished;
34
35 /**
36 * Resets all flush metrics.
37 */
38 public void reset() {
39 viewAppearedCount = 0;
40 viewDisappearedCount = 0;
41 viewTextChangedCount = 0;
42 sessionStarted = 0;
43 sessionFinished = 0;
44 }
45
46 @Override
47 public int describeContents() {
48 return 0;
49 }
50
51 @Override
52 public void writeToParcel(Parcel out, int flags) {
53 out.writeInt(sessionStarted);
54 out.writeInt(sessionFinished);
55 out.writeInt(viewAppearedCount);
56 out.writeInt(viewDisappearedCount);
57 out.writeInt(viewTextChangedCount);
58 }
59
60 @NonNull
61 public static final Creator<FlushMetrics> CREATOR = new Creator<FlushMetrics>() {
62 @NonNull
63 @Override
64 public FlushMetrics createFromParcel(Parcel in) {
65 final FlushMetrics flushMetrics = new FlushMetrics();
66 flushMetrics.sessionStarted = in.readInt();
67 flushMetrics.sessionFinished = in.readInt();
68 flushMetrics.viewAppearedCount = in.readInt();
69 flushMetrics.viewDisappearedCount = in.readInt();
70 flushMetrics.viewTextChangedCount = in.readInt();
71 return flushMetrics;
72 }
73
74 @Override
75 public FlushMetrics[] newArray(int size) {
76 return new FlushMetrics[size];
77 }
78 };
79 }