| 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.NonNull; |
| 20 |
import android.annotation.SystemApi; |
| 21 |
import android.os.Parcel; |
| 22 |
import android.os.Parcelable; |
| 23 |
|
| 24 |
import java.util.Objects; |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
@SystemApi |
| 37 |
public final class CreateGameSessionRequest implements Parcelable { |
| 38 |
|
| 39 |
@NonNull |
| 40 |
public static final Parcelable.Creator<CreateGameSessionRequest> CREATOR = |
| 41 |
new Parcelable.Creator<CreateGameSessionRequest>() { |
| 42 |
@Override |
| 43 |
public CreateGameSessionRequest createFromParcel(Parcel source) { |
| 44 |
return new CreateGameSessionRequest( |
| 45 |
source.readInt(), |
| 46 |
source.readString8()); |
| 47 |
} |
| 48 |
|
| 49 |
@Override |
| 50 |
public CreateGameSessionRequest[] newArray(int size) { |
| 51 |
return new CreateGameSessionRequest[0]; |
| 52 |
} |
| 53 |
}; |
| 54 |
|
| 55 |
private final int mTaskId; |
| 56 |
private final String mGamePackageName; |
| 57 |
|
| 58 |
public CreateGameSessionRequest(int taskId, @NonNull String gamePackageName) { |
| 59 |
this.mTaskId = taskId; |
| 60 |
this.mGamePackageName = gamePackageName; |
| 61 |
} |
| 62 |
|
| 63 |
@Override |
| 64 |
public int describeContents() { |
| 65 |
return 0; |
| 66 |
} |
| 67 |
|
| 68 |
@Override |
| 69 |
public void writeToParcel(@NonNull Parcel dest, int flags) { |
| 70 |
dest.writeInt(mTaskId); |
| 71 |
dest.writeString8(mGamePackageName); |
| 72 |
} |
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
public int getTaskId() { |
| 78 |
return mTaskId; |
| 79 |
} |
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
@NonNull |
| 85 |
public String getGamePackageName() { |
| 86 |
return mGamePackageName; |
| 87 |
} |
| 88 |
|
| 89 |
@Override |
| 90 |
public String toString() { |
| 91 |
return "GameSessionRequest{" |
| 92 |
+ "mTaskId=" |
| 93 |
+ mTaskId |
| 94 |
+ ", mGamePackageName='" |
| 95 |
+ mGamePackageName |
| 96 |
+ "\'}"; |
| 97 |
} |
| 98 |
|
| 99 |
@Override |
| 100 |
public boolean equals(Object o) { |
| 101 |
if (this == o) { |
| 102 |
return true; |
| 103 |
} |
| 104 |
|
| 105 |
if (!(o instanceof CreateGameSessionRequest)) { |
| 106 |
return false; |
| 107 |
} |
| 108 |
|
| 109 |
CreateGameSessionRequest that = (CreateGameSessionRequest) o; |
| 110 |
return mTaskId == that.mTaskId |
| 111 |
&& Objects.equals(mGamePackageName, that.mGamePackageName); |
| 112 |
} |
| 113 |
|
| 114 |
@Override |
| 115 |
public int hashCode() { |
| 116 |
return Objects.hash(mTaskId, mGamePackageName); |
| 117 |
} |
| 118 |
} |