summaryrefslogtreecommitdiffstats
path: root/core/java/android/content/SyncInfo.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android/content/SyncInfo.java')
-rw-r--r--core/java/android/content/SyncInfo.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/core/java/android/content/SyncInfo.java b/core/java/android/content/SyncInfo.java
index a586d6f..ab3c30b 100644
--- a/core/java/android/content/SyncInfo.java
+++ b/core/java/android/content/SyncInfo.java
@@ -24,6 +24,13 @@ import android.os.Parcelable;
* Information about the sync operation that is currently underway.
*/
public class SyncInfo implements Parcelable {
+ /**
+ * Used when the caller receiving this object doesn't have permission to access the accounts
+ * on device.
+ * @See Manifest.permission.GET_ACCOUNTS
+ */
+ private static final Account REDACTED_ACCOUNT = new Account("*****", "*****");
+
/** @hide */
public final int authorityId;
@@ -44,6 +51,17 @@ public class SyncInfo implements Parcelable {
*/
public final long startTime;
+ /**
+ * Creates a SyncInfo object with an unusable Account. Used when the caller receiving this
+ * object doesn't have access to the accounts on the device.
+ * @See Manifest.permission.GET_ACCOUNTS
+ * @hide
+ */
+ public static SyncInfo createAccountRedacted(
+ int authorityId, String authority, long startTime) {
+ return new SyncInfo(authorityId, REDACTED_ACCOUNT, authority, startTime);
+ }
+
/** @hide */
public SyncInfo(int authorityId, Account account, String authority, long startTime) {
this.authorityId = authorityId;