| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.security.keymaster; |
| 18 |
|
| 19 |
import android.compat.annotation.UnsupportedAppUsage; |
| 20 |
import android.os.Build; |
| 21 |
import android.os.IBinder; |
| 22 |
import android.os.Parcel; |
| 23 |
import android.os.Parcelable; |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
public class OperationResult implements Parcelable { |
| 31 |
public final int resultCode; |
| 32 |
public final IBinder token; |
| 33 |
public final long operationHandle; |
| 34 |
public final int inputConsumed; |
| 35 |
public final byte[] output; |
| 36 |
public final KeymasterArguments outParams; |
| 37 |
|
| 38 |
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) |
| 39 |
public static final @android.annotation.NonNull Parcelable.Creator<OperationResult> CREATOR = new |
| 40 |
Parcelable.Creator<OperationResult>() { |
| 41 |
@Override |
| 42 |
public OperationResult createFromParcel(Parcel in) { |
| 43 |
return new OperationResult(in); |
| 44 |
} |
| 45 |
|
| 46 |
@Override |
| 47 |
public OperationResult[] newArray(int length) { |
| 48 |
return new OperationResult[length]; |
| 49 |
} |
| 50 |
}; |
| 51 |
|
| 52 |
public OperationResult( |
| 53 |
int resultCode, IBinder token, long operationHandle, int inputConsumed, byte[] output, |
| 54 |
KeymasterArguments outParams) { |
| 55 |
this.resultCode = resultCode; |
| 56 |
this.token = token; |
| 57 |
this.operationHandle = operationHandle; |
| 58 |
this.inputConsumed = inputConsumed; |
| 59 |
this.output = output; |
| 60 |
this.outParams = outParams; |
| 61 |
} |
| 62 |
|
| 63 |
public OperationResult(int resultCode) { |
| 64 |
this(resultCode, null, 0, 0, null, null); |
| 65 |
} |
| 66 |
|
| 67 |
protected OperationResult(Parcel in) { |
| 68 |
resultCode = in.readInt(); |
| 69 |
token = in.readStrongBinder(); |
| 70 |
operationHandle = in.readLong(); |
| 71 |
inputConsumed = in.readInt(); |
| 72 |
output = in.createByteArray(); |
| 73 |
outParams = KeymasterArguments.CREATOR.createFromParcel(in); |
| 74 |
} |
| 75 |
|
| 76 |
@Override |
| 77 |
public int describeContents() { |
| 78 |
return 0; |
| 79 |
} |
| 80 |
|
| 81 |
@Override |
| 82 |
public void writeToParcel(Parcel out, int flags) { |
| 83 |
out.writeInt(resultCode); |
| 84 |
out.writeStrongBinder(token); |
| 85 |
out.writeLong(operationHandle); |
| 86 |
out.writeInt(inputConsumed); |
| 87 |
out.writeByteArray(output); |
| 88 |
outParams.writeToParcel(out, flags); |
| 89 |
} |
| 90 |
} |