Rafal Slawik | 3bea895 | 2018-11-15 12:39:33 +0000 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package android.app; |
| 18 | |
| 19 | import android.os.Parcel; |
| 20 | import android.os.Parcelable; |
| 21 | |
| 22 | /** |
| 23 | * The memory high-water mark value for a process. |
| 24 | * {@hide} |
| 25 | */ |
| 26 | public 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 | |
| 43 | public static final Creator<ProcessMemoryHighWaterMark> CREATOR = |
| 44 | 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 | } |