| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.app; |
| 18 |
|
| 19 |
import android.annotation.CurrentTimeMillisLong; |
| 20 |
import android.annotation.IntRange; |
| 21 |
import android.annotation.NonNull; |
| 22 |
import android.annotation.Nullable; |
| 23 |
import android.os.Parcelable; |
| 24 |
|
| 25 |
import com.android.internal.annotations.Immutable; |
| 26 |
import com.android.internal.util.DataClass; |
| 27 |
import com.android.internal.util.Preconditions; |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
@Immutable |
| 38 |
@DataClass(genEqualsHashCode = true, |
| 39 |
genAidl = true, |
| 40 |
genHiddenConstructor = true, |
| 41 |
genToString = true) |
| 42 |
|
| 43 |
|
| 44 |
@DataClass.Suppress({"getOpCode"}) |
| 45 |
public final class AsyncNotedAppOp implements Parcelable { |
| 46 |
|
| 47 |
private final @IntRange(from = 0) int mOpCode; |
| 48 |
|
| 49 |
|
| 50 |
private final @IntRange(from = 0) int mNotingUid; |
| 51 |
|
| 52 |
|
| 53 |
private final @Nullable String mAttributionTag; |
| 54 |
|
| 55 |
|
| 56 |
private final @NonNull String mMessage; |
| 57 |
|
| 58 |
|
| 59 |
private final @CurrentTimeMillisLong long mTime; |
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
public @NonNull String getOp() { |
| 65 |
return AppOpsManager.opToPublicName(mOpCode); |
| 66 |
} |
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
private void onConstructed() { |
| 71 |
Preconditions.checkArgumentInRange(mOpCode, 0, AppOpsManager._NUM_OP - 1, "opCode"); |
| 72 |
} |
| 73 |
|
| 74 |
private String opCodeToString() { |
| 75 |
return getOp(); |
| 76 |
} |
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
@DataClass.Generated.Member |
| 109 |
public AsyncNotedAppOp( |
| 110 |
@IntRange(from = 0) int opCode, |
| 111 |
@IntRange(from = 0) int notingUid, |
| 112 |
@Nullable String attributionTag, |
| 113 |
@NonNull String message, |
| 114 |
@CurrentTimeMillisLong long time) { |
| 115 |
this.mOpCode = opCode; |
| 116 |
com.android.internal.util.AnnotationValidations.validate( |
| 117 |
IntRange.class, null, mOpCode, |
| 118 |
"from", 0); |
| 119 |
this.mNotingUid = notingUid; |
| 120 |
com.android.internal.util.AnnotationValidations.validate( |
| 121 |
IntRange.class, null, mNotingUid, |
| 122 |
"from", 0); |
| 123 |
this.mAttributionTag = attributionTag; |
| 124 |
this.mMessage = message; |
| 125 |
com.android.internal.util.AnnotationValidations.validate( |
| 126 |
NonNull.class, null, mMessage); |
| 127 |
this.mTime = time; |
| 128 |
com.android.internal.util.AnnotationValidations.validate( |
| 129 |
CurrentTimeMillisLong.class, null, mTime); |
| 130 |
|
| 131 |
onConstructed(); |
| 132 |
} |
| 133 |
|
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
@DataClass.Generated.Member |
| 138 |
public @IntRange(from = 0) int getNotingUid() { |
| 139 |
return mNotingUid; |
| 140 |
} |
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
@DataClass.Generated.Member |
| 146 |
public @Nullable String getAttributionTag() { |
| 147 |
return mAttributionTag; |
| 148 |
} |
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
@DataClass.Generated.Member |
| 154 |
public @NonNull String getMessage() { |
| 155 |
return mMessage; |
| 156 |
} |
| 157 |
|
| 158 |
|
| 159 |
|
| 160 |
|
| 161 |
@DataClass.Generated.Member |
| 162 |
public @CurrentTimeMillisLong long getTime() { |
| 163 |
return mTime; |
| 164 |
} |
| 165 |
|
| 166 |
@Override |
| 167 |
@DataClass.Generated.Member |
| 168 |
public String toString() { |
| 169 |
|
| 170 |
|
| 171 |
|
| 172 |
return "AsyncNotedAppOp { " + |
| 173 |
"opCode = " + opCodeToString() + ", " + |
| 174 |
"notingUid = " + mNotingUid + ", " + |
| 175 |
"attributionTag = " + mAttributionTag + ", " + |
| 176 |
"message = " + mMessage + ", " + |
| 177 |
"time = " + mTime + |
| 178 |
" }"; |
| 179 |
} |
| 180 |
|
| 181 |
@Override |
| 182 |
@DataClass.Generated.Member |
| 183 |
public boolean equals(@Nullable Object o) { |
| 184 |
|
| 185 |
|
| 186 |
|
| 187 |
|
| 188 |
if (this == o) return true; |
| 189 |
if (o == null || getClass() != o.getClass()) return false; |
| 190 |
@SuppressWarnings("unchecked") |
| 191 |
AsyncNotedAppOp that = (AsyncNotedAppOp) o; |
| 192 |
|
| 193 |
return true |
| 194 |
&& mOpCode == that.mOpCode |
| 195 |
&& mNotingUid == that.mNotingUid |
| 196 |
&& java.util.Objects.equals(mAttributionTag, that.mAttributionTag) |
| 197 |
&& java.util.Objects.equals(mMessage, that.mMessage) |
| 198 |
&& mTime == that.mTime; |
| 199 |
} |
| 200 |
|
| 201 |
@Override |
| 202 |
@DataClass.Generated.Member |
| 203 |
public int hashCode() { |
| 204 |
|
| 205 |
|
| 206 |
|
| 207 |
int _hash = 1; |
| 208 |
_hash = 31 * _hash + mOpCode; |
| 209 |
_hash = 31 * _hash + mNotingUid; |
| 210 |
_hash = 31 * _hash + java.util.Objects.hashCode(mAttributionTag); |
| 211 |
_hash = 31 * _hash + java.util.Objects.hashCode(mMessage); |
| 212 |
_hash = 31 * _hash + Long.hashCode(mTime); |
| 213 |
return _hash; |
| 214 |
} |
| 215 |
|
| 216 |
@Override |
| 217 |
@DataClass.Generated.Member |
| 218 |
public void writeToParcel(@NonNull android.os.Parcel dest, int flags) { |
| 219 |
|
| 220 |
|
| 221 |
|
| 222 |
byte flg = 0; |
| 223 |
if (mAttributionTag != null) flg |= 0x4; |
| 224 |
dest.writeByte(flg); |
| 225 |
dest.writeInt(mOpCode); |
| 226 |
dest.writeInt(mNotingUid); |
| 227 |
if (mAttributionTag != null) dest.writeString(mAttributionTag); |
| 228 |
dest.writeString(mMessage); |
| 229 |
dest.writeLong(mTime); |
| 230 |
} |
| 231 |
|
| 232 |
@Override |
| 233 |
@DataClass.Generated.Member |
| 234 |
public int describeContents() { return 0; } |
| 235 |
|
| 236 |
|
| 237 |
@SuppressWarnings({"unchecked", "RedundantCast"}) |
| 238 |
@DataClass.Generated.Member |
| 239 |
AsyncNotedAppOp(@NonNull android.os.Parcel in) { |
| 240 |
|
| 241 |
|
| 242 |
|
| 243 |
byte flg = in.readByte(); |
| 244 |
int opCode = in.readInt(); |
| 245 |
int notingUid = in.readInt(); |
| 246 |
String attributionTag = (flg & 0x4) == 0 ? null : in.readString(); |
| 247 |
String message = in.readString(); |
| 248 |
long time = in.readLong(); |
| 249 |
|
| 250 |
this.mOpCode = opCode; |
| 251 |
com.android.internal.util.AnnotationValidations.validate( |
| 252 |
IntRange.class, null, mOpCode, |
| 253 |
"from", 0); |
| 254 |
this.mNotingUid = notingUid; |
| 255 |
com.android.internal.util.AnnotationValidations.validate( |
| 256 |
IntRange.class, null, mNotingUid, |
| 257 |
"from", 0); |
| 258 |
this.mAttributionTag = attributionTag; |
| 259 |
this.mMessage = message; |
| 260 |
com.android.internal.util.AnnotationValidations.validate( |
| 261 |
NonNull.class, null, mMessage); |
| 262 |
this.mTime = time; |
| 263 |
com.android.internal.util.AnnotationValidations.validate( |
| 264 |
CurrentTimeMillisLong.class, null, mTime); |
| 265 |
|
| 266 |
onConstructed(); |
| 267 |
} |
| 268 |
|
| 269 |
@DataClass.Generated.Member |
| 270 |
public static final @NonNull Parcelable.Creator<AsyncNotedAppOp> CREATOR |
| 271 |
= new Parcelable.Creator<AsyncNotedAppOp>() { |
| 272 |
@Override |
| 273 |
public AsyncNotedAppOp[] newArray(int size) { |
| 274 |
return new AsyncNotedAppOp[size]; |
| 275 |
} |
| 276 |
|
| 277 |
@Override |
| 278 |
public AsyncNotedAppOp createFromParcel(@NonNull android.os.Parcel in) { |
| 279 |
return new AsyncNotedAppOp(in); |
| 280 |
} |
| 281 |
}; |
| 282 |
|
| 283 |
@DataClass.Generated( |
| 284 |
time = 1643320606160L, |
| 285 |
codegenVersion = "1.0.23", |
| 286 |
sourceFile = "frameworks/base/core/java/android/app/AsyncNotedAppOp.java", |
| 287 |
inputSignatures = "private final @android.annotation.IntRange int mOpCode\nprivate final @android.annotation.IntRange int mNotingUid\nprivate final @android.annotation.Nullable java.lang.String mAttributionTag\nprivate final @android.annotation.NonNull java.lang.String mMessage\nprivate final @android.annotation.CurrentTimeMillisLong long mTime\npublic @android.annotation.NonNull java.lang.String getOp()\nprivate void onConstructed()\nprivate java.lang.String opCodeToString()\nclass AsyncNotedAppOp extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genEqualsHashCode=true, genAidl=true, genHiddenConstructor=true, genToString=true)") |
| 288 |
@Deprecated |
| 289 |
private void __metadata() {} |
| 290 |
|
| 291 |
|
| 292 |
|
| 293 |
|
| 294 |
|
| 295 |
} |