| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.security; |
| 18 |
|
| 19 |
import android.compat.annotation.UnsupportedAppUsage; |
| 20 |
import android.os.Build; |
| 21 |
import android.os.Parcel; |
| 22 |
import android.os.Parcelable; |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
public class KeystoreArguments implements Parcelable { |
| 30 |
public byte[][] args; |
| 31 |
|
| 32 |
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) |
| 33 |
public static final @android.annotation.NonNull Parcelable.Creator<KeystoreArguments> CREATOR = new |
| 34 |
Parcelable.Creator<KeystoreArguments>() { |
| 35 |
public KeystoreArguments createFromParcel(Parcel in) { |
| 36 |
return new KeystoreArguments(in); |
| 37 |
} |
| 38 |
public KeystoreArguments[] newArray(int size) { |
| 39 |
return new KeystoreArguments[size]; |
| 40 |
} |
| 41 |
}; |
| 42 |
|
| 43 |
public KeystoreArguments() { |
| 44 |
args = null; |
| 45 |
} |
| 46 |
|
| 47 |
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) |
| 48 |
public KeystoreArguments(byte[][] args) { |
| 49 |
this.args = args; |
| 50 |
} |
| 51 |
|
| 52 |
private KeystoreArguments(Parcel in) { |
| 53 |
readFromParcel(in); |
| 54 |
} |
| 55 |
|
| 56 |
@Override |
| 57 |
public void writeToParcel(Parcel out, int flags) { |
| 58 |
if (args == null) { |
| 59 |
out.writeInt(0); |
| 60 |
} else { |
| 61 |
out.writeInt(args.length); |
| 62 |
for (byte[] arg : args) { |
| 63 |
out.writeByteArray(arg); |
| 64 |
} |
| 65 |
} |
| 66 |
} |
| 67 |
|
| 68 |
private void readFromParcel(Parcel in) { |
| 69 |
int length = in.readInt(); |
| 70 |
args = new byte[length][]; |
| 71 |
for (int i = 0; i < length; i++) { |
| 72 |
args[i] = in.createByteArray(); |
| 73 |
} |
| 74 |
} |
| 75 |
|
| 76 |
@Override |
| 77 |
public int describeContents() { |
| 78 |
return 0; |
| 79 |
} |
| 80 |
} |