| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.app; |
| 18 |
|
| 19 |
import android.os.Parcel; |
| 20 |
import android.os.Parcelable; |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
public final class ProcessMemoryState implements Parcelable { |
| 27 |
public final int uid; |
| 28 |
public final int pid; |
| 29 |
public final String processName; |
| 30 |
public final int oomScore; |
| 31 |
public final boolean hasForegroundServices; |
| 32 |
|
| 33 |
public ProcessMemoryState(int uid, int pid, String processName, int oomScore, |
| 34 |
boolean hasForegroundServices) { |
| 35 |
this.uid = uid; |
| 36 |
this.pid = pid; |
| 37 |
this.processName = processName; |
| 38 |
this.oomScore = oomScore; |
| 39 |
this.hasForegroundServices = hasForegroundServices; |
| 40 |
} |
| 41 |
|
| 42 |
private ProcessMemoryState(Parcel in) { |
| 43 |
uid = in.readInt(); |
| 44 |
pid = in.readInt(); |
| 45 |
processName = in.readString(); |
| 46 |
oomScore = in.readInt(); |
| 47 |
hasForegroundServices = in.readInt() == 1; |
| 48 |
} |
| 49 |
|
| 50 |
public static final @android.annotation.NonNull Creator<ProcessMemoryState> CREATOR = new Creator<ProcessMemoryState>() { |
| 51 |
@Override |
| 52 |
public ProcessMemoryState createFromParcel(Parcel in) { |
| 53 |
return new ProcessMemoryState(in); |
| 54 |
} |
| 55 |
|
| 56 |
@Override |
| 57 |
public ProcessMemoryState[] newArray(int size) { |
| 58 |
return new ProcessMemoryState[size]; |
| 59 |
} |
| 60 |
}; |
| 61 |
|
| 62 |
@Override |
| 63 |
public int describeContents() { |
| 64 |
return 0; |
| 65 |
} |
| 66 |
|
| 67 |
@Override |
| 68 |
public void writeToParcel(Parcel parcel, int i) { |
| 69 |
parcel.writeInt(uid); |
| 70 |
parcel.writeInt(pid); |
| 71 |
parcel.writeString(processName); |
| 72 |
parcel.writeInt(oomScore); |
| 73 |
parcel.writeInt(hasForegroundServices ? 1 : 0); |
| 74 |
} |
| 75 |
} |