| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.service.rotationresolver; |
| 18 |
|
| 19 |
import android.annotation.DurationMillisLong; |
| 20 |
import android.annotation.NonNull; |
| 21 |
import android.annotation.SystemApi; |
| 22 |
import android.os.Parcel; |
| 23 |
import android.os.Parcelable; |
| 24 |
import android.view.Surface; |
| 25 |
|
| 26 |
import com.android.internal.util.DataClass; |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
@SystemApi |
| 39 |
@DataClass ( |
| 40 |
genParcelable = true, |
| 41 |
genToString = true |
| 42 |
) |
| 43 |
public final class RotationResolutionRequest implements Parcelable { |
| 44 |
|
| 45 |
@NonNull private final String mForegroundPackageName; |
| 46 |
|
| 47 |
|
| 48 |
@Surface.Rotation private final int mCurrentRotation; |
| 49 |
|
| 50 |
|
| 51 |
@Surface.Rotation private final int mProposedRotation; |
| 52 |
|
| 53 |
|
| 54 |
private final boolean mShouldUseCamera; |
| 55 |
|
| 56 |
|
| 57 |
@DurationMillisLong private final long mTimeoutMillis; |
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
@DataClass.Generated.Member |
| 90 |
public RotationResolutionRequest( |
| 91 |
@NonNull String foregroundPackageName, |
| 92 |
@Surface.Rotation int currentRotation, |
| 93 |
@Surface.Rotation int proposedRotation, |
| 94 |
boolean shouldUseCamera, |
| 95 |
@DurationMillisLong long timeoutMillis) { |
| 96 |
this.mForegroundPackageName = foregroundPackageName; |
| 97 |
com.android.internal.util.AnnotationValidations.validate( |
| 98 |
NonNull.class, null, mForegroundPackageName); |
| 99 |
this.mCurrentRotation = currentRotation; |
| 100 |
com.android.internal.util.AnnotationValidations.validate( |
| 101 |
Surface.Rotation.class, null, mCurrentRotation); |
| 102 |
this.mProposedRotation = proposedRotation; |
| 103 |
com.android.internal.util.AnnotationValidations.validate( |
| 104 |
Surface.Rotation.class, null, mProposedRotation); |
| 105 |
this.mShouldUseCamera = shouldUseCamera; |
| 106 |
this.mTimeoutMillis = timeoutMillis; |
| 107 |
com.android.internal.util.AnnotationValidations.validate( |
| 108 |
DurationMillisLong.class, null, mTimeoutMillis); |
| 109 |
|
| 110 |
|
| 111 |
} |
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
@DataClass.Generated.Member |
| 117 |
public @NonNull String getForegroundPackageName() { |
| 118 |
return mForegroundPackageName; |
| 119 |
} |
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
@DataClass.Generated.Member |
| 125 |
public @Surface.Rotation int getCurrentRotation() { |
| 126 |
return mCurrentRotation; |
| 127 |
} |
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
|
| 132 |
@DataClass.Generated.Member |
| 133 |
public @Surface.Rotation int getProposedRotation() { |
| 134 |
return mProposedRotation; |
| 135 |
} |
| 136 |
|
| 137 |
|
| 138 |
|
| 139 |
|
| 140 |
@DataClass.Generated.Member |
| 141 |
public boolean shouldUseCamera() { |
| 142 |
return mShouldUseCamera; |
| 143 |
} |
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
@DataClass.Generated.Member |
| 149 |
public @DurationMillisLong long getTimeoutMillis() { |
| 150 |
return mTimeoutMillis; |
| 151 |
} |
| 152 |
|
| 153 |
@Override |
| 154 |
@DataClass.Generated.Member |
| 155 |
public String toString() { |
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
return "RotationResolutionRequest { " + |
| 160 |
"foregroundPackageName = " + mForegroundPackageName + ", " + |
| 161 |
"currentRotation = " + mCurrentRotation + ", " + |
| 162 |
"proposedRotation = " + mProposedRotation + ", " + |
| 163 |
"shouldUseCamera = " + mShouldUseCamera + ", " + |
| 164 |
"timeoutMillis = " + mTimeoutMillis + |
| 165 |
" }"; |
| 166 |
} |
| 167 |
|
| 168 |
@Override |
| 169 |
@DataClass.Generated.Member |
| 170 |
public void writeToParcel(@NonNull Parcel dest, int flags) { |
| 171 |
|
| 172 |
|
| 173 |
|
| 174 |
byte flg = 0; |
| 175 |
if (mShouldUseCamera) flg |= 0x8; |
| 176 |
dest.writeByte(flg); |
| 177 |
dest.writeString(mForegroundPackageName); |
| 178 |
dest.writeInt(mCurrentRotation); |
| 179 |
dest.writeInt(mProposedRotation); |
| 180 |
dest.writeLong(mTimeoutMillis); |
| 181 |
} |
| 182 |
|
| 183 |
@Override |
| 184 |
@DataClass.Generated.Member |
| 185 |
public int describeContents() { return 0; } |
| 186 |
|
| 187 |
|
| 188 |
@SuppressWarnings({"unchecked", "RedundantCast"}) |
| 189 |
@DataClass.Generated.Member |
| 190 |
RotationResolutionRequest(@NonNull Parcel in) { |
| 191 |
|
| 192 |
|
| 193 |
|
| 194 |
byte flg = in.readByte(); |
| 195 |
boolean shouldUseCamera = (flg & 0x8) != 0; |
| 196 |
String foregroundPackageName = in.readString(); |
| 197 |
int currentRotation = in.readInt(); |
| 198 |
int proposedRotation = in.readInt(); |
| 199 |
long timeoutMillis = in.readLong(); |
| 200 |
|
| 201 |
this.mForegroundPackageName = foregroundPackageName; |
| 202 |
com.android.internal.util.AnnotationValidations.validate( |
| 203 |
NonNull.class, null, mForegroundPackageName); |
| 204 |
this.mCurrentRotation = currentRotation; |
| 205 |
com.android.internal.util.AnnotationValidations.validate( |
| 206 |
Surface.Rotation.class, null, mCurrentRotation); |
| 207 |
this.mProposedRotation = proposedRotation; |
| 208 |
com.android.internal.util.AnnotationValidations.validate( |
| 209 |
Surface.Rotation.class, null, mProposedRotation); |
| 210 |
this.mShouldUseCamera = shouldUseCamera; |
| 211 |
this.mTimeoutMillis = timeoutMillis; |
| 212 |
com.android.internal.util.AnnotationValidations.validate( |
| 213 |
DurationMillisLong.class, null, mTimeoutMillis); |
| 214 |
|
| 215 |
|
| 216 |
} |
| 217 |
|
| 218 |
@DataClass.Generated.Member |
| 219 |
public static final @NonNull Parcelable.Creator<RotationResolutionRequest> CREATOR |
| 220 |
= new Parcelable.Creator<RotationResolutionRequest>() { |
| 221 |
@Override |
| 222 |
public RotationResolutionRequest[] newArray(int size) { |
| 223 |
return new RotationResolutionRequest[size]; |
| 224 |
} |
| 225 |
|
| 226 |
@Override |
| 227 |
public RotationResolutionRequest createFromParcel(@NonNull Parcel in) { |
| 228 |
return new RotationResolutionRequest(in); |
| 229 |
} |
| 230 |
}; |
| 231 |
|
| 232 |
@DataClass.Generated( |
| 233 |
time = 1618447759819L, |
| 234 |
codegenVersion = "1.0.23", |
| 235 |
sourceFile = "frameworks/base/core/java/android/service/rotationresolver/RotationResolutionRequest.java", |
| 236 |
inputSignatures = "private final @android.annotation.NonNull java.lang.String mForegroundPackageName\nprivate final @android.view.Surface.Rotation int mCurrentRotation\nprivate final @android.view.Surface.Rotation int mProposedRotation\nprivate final boolean mShouldUseCamera\nprivate final @android.annotation.DurationMillisLong long mTimeoutMillis\nclass RotationResolutionRequest extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genParcelable=true, genToString=true)") |
| 237 |
@Deprecated |
| 238 |
private void __metadata() {} |
| 239 |
|
| 240 |
|
| 241 |
|
| 242 |
|
| 243 |
|
| 244 |
} |