| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.service.games; |
| 18 |
|
| 19 |
import android.annotation.Hide; |
| 20 |
import android.annotation.NonNull; |
| 21 |
import android.os.Parcel; |
| 22 |
import android.os.Parcelable; |
| 23 |
|
| 24 |
import java.util.Objects; |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
@Hide |
| 33 |
public final class GameSessionViewHostConfiguration implements Parcelable { |
| 34 |
|
| 35 |
@NonNull |
| 36 |
public static final Creator<GameSessionViewHostConfiguration> CREATOR = |
| 37 |
new Creator<GameSessionViewHostConfiguration>() { |
| 38 |
@Override |
| 39 |
public GameSessionViewHostConfiguration createFromParcel(Parcel source) { |
| 40 |
return new GameSessionViewHostConfiguration( |
| 41 |
source.readInt(), |
| 42 |
source.readInt(), |
| 43 |
source.readInt()); |
| 44 |
} |
| 45 |
|
| 46 |
@Override |
| 47 |
public GameSessionViewHostConfiguration[] newArray(int size) { |
| 48 |
return new GameSessionViewHostConfiguration[0]; |
| 49 |
} |
| 50 |
}; |
| 51 |
|
| 52 |
final int mDisplayId; |
| 53 |
final int mWidthPx; |
| 54 |
final int mHeightPx; |
| 55 |
|
| 56 |
public GameSessionViewHostConfiguration(int displayId, int widthPx, int heightPx) { |
| 57 |
this.mDisplayId = displayId; |
| 58 |
this.mWidthPx = widthPx; |
| 59 |
this.mHeightPx = heightPx; |
| 60 |
} |
| 61 |
|
| 62 |
@Override |
| 63 |
public int describeContents() { |
| 64 |
return 0; |
| 65 |
} |
| 66 |
|
| 67 |
@Override |
| 68 |
public void writeToParcel(@NonNull Parcel dest, int flags) { |
| 69 |
dest.writeInt(mDisplayId); |
| 70 |
dest.writeInt(mWidthPx); |
| 71 |
dest.writeInt(mHeightPx); |
| 72 |
} |
| 73 |
|
| 74 |
@Override |
| 75 |
public boolean equals(Object o) { |
| 76 |
if (this == o) return true; |
| 77 |
if (!(o instanceof GameSessionViewHostConfiguration)) return false; |
| 78 |
GameSessionViewHostConfiguration that = (GameSessionViewHostConfiguration) o; |
| 79 |
return mDisplayId == that.mDisplayId && mWidthPx == that.mWidthPx |
| 80 |
&& mHeightPx == that.mHeightPx; |
| 81 |
} |
| 82 |
|
| 83 |
@Override |
| 84 |
public int hashCode() { |
| 85 |
return Objects.hash(mDisplayId, mWidthPx, mHeightPx); |
| 86 |
} |
| 87 |
|
| 88 |
@Override |
| 89 |
public String toString() { |
| 90 |
return "GameSessionViewHostConfiguration{" |
| 91 |
+ "mDisplayId=" + mDisplayId |
| 92 |
+ ", mWidthPx=" + mWidthPx |
| 93 |
+ ", mHeightPx=" + mHeightPx |
| 94 |
+ '}'; |
| 95 |
} |
| 96 |
} |