| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.window; |
| 18 |
|
| 19 |
import static android.window.DisplayAreaOrganizer.FEATURE_UNDEFINED; |
| 20 |
|
| 21 |
import android.annotation.NonNull; |
| 22 |
import android.annotation.TestApi; |
| 23 |
import android.content.res.Configuration; |
| 24 |
import android.os.Parcel; |
| 25 |
import android.os.Parcelable; |
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
@TestApi |
| 35 |
public final class DisplayAreaInfo implements Parcelable { |
| 36 |
|
| 37 |
@NonNull |
| 38 |
public final WindowContainerToken token; |
| 39 |
|
| 40 |
@NonNull |
| 41 |
public final Configuration configuration = new Configuration(); |
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
public final int displayId; |
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
public final int featureId; |
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
public int rootDisplayAreaId = FEATURE_UNDEFINED; |
| 58 |
|
| 59 |
public DisplayAreaInfo(@NonNull WindowContainerToken token, int displayId, int featureId) { |
| 60 |
this.token = token; |
| 61 |
this.displayId = displayId; |
| 62 |
this.featureId = featureId; |
| 63 |
} |
| 64 |
|
| 65 |
private DisplayAreaInfo(Parcel in) { |
| 66 |
token = WindowContainerToken.CREATOR.createFromParcel(in); |
| 67 |
configuration.readFromParcel(in); |
| 68 |
displayId = in.readInt(); |
| 69 |
featureId = in.readInt(); |
| 70 |
rootDisplayAreaId = in.readInt(); |
| 71 |
} |
| 72 |
|
| 73 |
@Override |
| 74 |
public void writeToParcel(@NonNull Parcel dest, int flags) { |
| 75 |
token.writeToParcel(dest, flags); |
| 76 |
configuration.writeToParcel(dest, flags); |
| 77 |
dest.writeInt(displayId); |
| 78 |
dest.writeInt(featureId); |
| 79 |
dest.writeInt(rootDisplayAreaId); |
| 80 |
} |
| 81 |
|
| 82 |
@NonNull |
| 83 |
public static final Creator<DisplayAreaInfo> CREATOR = new Creator<DisplayAreaInfo>() { |
| 84 |
@Override |
| 85 |
public DisplayAreaInfo createFromParcel(Parcel in) { |
| 86 |
return new DisplayAreaInfo(in); |
| 87 |
} |
| 88 |
|
| 89 |
@Override |
| 90 |
public DisplayAreaInfo[] newArray(int size) { |
| 91 |
return new DisplayAreaInfo[size]; |
| 92 |
} |
| 93 |
}; |
| 94 |
|
| 95 |
@Override |
| 96 |
public String toString() { |
| 97 |
return "DisplayAreaInfo{token=" + token |
| 98 |
+ " config=" + configuration + "}"; |
| 99 |
} |
| 100 |
|
| 101 |
@Override |
| 102 |
public int describeContents() { |
| 103 |
return 0; |
| 104 |
} |
| 105 |
} |