blob: d1cae94f02b4fe318d196c23a4111198df602a0e [file] [log] [blame]
Rafal Slawik3bea8952018-11-15 12:39:33 +00001/*
2 * Copyright (C) 2018 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.app;
18
19import android.os.Parcel;
20import android.os.Parcelable;
21
22/**
23 * The memory high-water mark value for a process.
24 * {@hide}
25 */
26public final class ProcessMemoryHighWaterMark implements Parcelable {
27 public final int uid;
28 public final String processName;
29 public final long rssHighWaterMarkInBytes;
30
31 public ProcessMemoryHighWaterMark(int uid, String processName, long rssHighWaterMarkInBytes) {
32 this.uid = uid;
33 this.processName = processName;
34 this.rssHighWaterMarkInBytes = rssHighWaterMarkInBytes;
35 }
36
37 private ProcessMemoryHighWaterMark(Parcel in) {
38 uid = in.readInt();
39 processName = in.readString();
40 rssHighWaterMarkInBytes = in.readLong();
41 }
42
Jeff Sharkey9e8f83d2019-02-28 12:06:45 -070043 public static final @android.annotation.NonNull Creator<ProcessMemoryHighWaterMark> CREATOR =
Rafal Slawik3bea8952018-11-15 12:39:33 +000044 new Creator<ProcessMemoryHighWaterMark>() {
45 @Override
46 public ProcessMemoryHighWaterMark createFromParcel(Parcel in) {
47 return new ProcessMemoryHighWaterMark(in);
48 }
49
50 @Override
51 public ProcessMemoryHighWaterMark[] newArray(int size) {
52 return new ProcessMemoryHighWaterMark[size];
53 }
54 };
55
56 @Override
57 public int describeContents() {
58 return 0;
59 }
60
61 @Override
62 public void writeToParcel(Parcel parcel, int flags) {
63 parcel.writeInt(uid);
64 parcel.writeString(processName);
65 parcel.writeLong(rssHighWaterMarkInBytes);
66 }
67}