| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.content; |
| 18 |
|
| 19 |
import android.accounts.Account; |
| 20 |
import android.compat.annotation.UnsupportedAppUsage; |
| 21 |
import android.os.Build; |
| 22 |
import android.os.Parcel; |
| 23 |
import android.os.Parcelable; |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
public class SyncInfo implements Parcelable { |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
private static final Account REDACTED_ACCOUNT = new Account("*****", "*****"); |
| 35 |
|
| 36 |
|
| 37 |
@UnsupportedAppUsage |
| 38 |
public final int authorityId; |
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
public final Account account; |
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
public final String authority; |
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
public final long startTime; |
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
public static SyncInfo createAccountRedacted( |
| 64 |
int authorityId, String authority, long startTime) { |
| 65 |
return new SyncInfo(authorityId, REDACTED_ACCOUNT, authority, startTime); |
| 66 |
} |
| 67 |
|
| 68 |
|
| 69 |
@UnsupportedAppUsage |
| 70 |
public SyncInfo(int authorityId, Account account, String authority, long startTime) { |
| 71 |
this.authorityId = authorityId; |
| 72 |
this.account = account; |
| 73 |
this.authority = authority; |
| 74 |
this.startTime = startTime; |
| 75 |
} |
| 76 |
|
| 77 |
|
| 78 |
public SyncInfo(SyncInfo other) { |
| 79 |
this.authorityId = other.authorityId; |
| 80 |
this.account = new Account(other.account.name, other.account.type); |
| 81 |
this.authority = other.authority; |
| 82 |
this.startTime = other.startTime; |
| 83 |
} |
| 84 |
|
| 85 |
|
| 86 |
public int describeContents() { |
| 87 |
return 0; |
| 88 |
} |
| 89 |
|
| 90 |
|
| 91 |
public void writeToParcel(Parcel parcel, int flags) { |
| 92 |
parcel.writeInt(authorityId); |
| 93 |
parcel.writeParcelable(account, flags); |
| 94 |
parcel.writeString(authority); |
| 95 |
parcel.writeLong(startTime); |
| 96 |
} |
| 97 |
|
| 98 |
|
| 99 |
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) |
| 100 |
SyncInfo(Parcel parcel) { |
| 101 |
authorityId = parcel.readInt(); |
| 102 |
account = parcel.readParcelable(Account.class.getClassLoader(), android.accounts.Account.class); |
| 103 |
authority = parcel.readString(); |
| 104 |
startTime = parcel.readLong(); |
| 105 |
} |
| 106 |
|
| 107 |
|
| 108 |
@UnsupportedAppUsage |
| 109 |
public static final @android.annotation.NonNull Creator<SyncInfo> CREATOR = new Creator<SyncInfo>() { |
| 110 |
public SyncInfo createFromParcel(Parcel in) { |
| 111 |
return new SyncInfo(in); |
| 112 |
} |
| 113 |
|
| 114 |
public SyncInfo[] newArray(int size) { |
| 115 |
return new SyncInfo[size]; |
| 116 |
} |
| 117 |
}; |
| 118 |
} |