summaryrefslogtreecommitdiffstats
path: root/core/java/android/content/PeriodicSync.java
diff options
context:
space:
mode:
authorMatthew Williams <mjwilliams@google.com>2014-06-04 09:25:11 -0700
committerMatthew Williams <mjwilliams@google.com>2014-06-04 14:55:53 -0700
commit5a9decd589f3f6a512168fd669ee2c5d8daa238b (patch)
treefe49786bcf13ee82b786a68f5a27eff8778c5421 /core/java/android/content/PeriodicSync.java
parent676f92e9a77a547b80a3a22bb3d4e4d0d2aa0bed (diff)
downloadframeworks_base-5a9decd589f3f6a512168fd669ee2c5d8daa238b.zip
frameworks_base-5a9decd589f3f6a512168fd669ee2c5d8daa238b.tar.gz
frameworks_base-5a9decd589f3f6a512168fd669ee2c5d8daa238b.tar.bz2
Redact SyncService stuff from master
This changes the API surface area, deleting things we aren't releasing. I'll do the internal clean-up at the same time I do the SyncManager refactor to sit on top of the TaskManager. Bug: 14997851 Change-Id: Ibefbb246f0e98d3159399151744279902468a23c
Diffstat (limited to 'core/java/android/content/PeriodicSync.java')
-rw-r--r--core/java/android/content/PeriodicSync.java73
1 files changed, 10 insertions, 63 deletions
diff --git a/core/java/android/content/PeriodicSync.java b/core/java/android/content/PeriodicSync.java
index 836c6f8..3efd89a 100644
--- a/core/java/android/content/PeriodicSync.java
+++ b/core/java/android/content/PeriodicSync.java
@@ -29,14 +29,10 @@ public class PeriodicSync implements Parcelable {
public final Account account;
/** The authority of the sync. Can be null. */
public final String authority;
- /** The service for syncing, if this is an anonymous sync. Can be null.*/
- public final ComponentName service;
/** Any extras that parameters that are to be passed to the sync adapter. */
public final Bundle extras;
/** How frequently the sync should be scheduled, in seconds. Kept around for API purposes. */
public final long period;
- /** Whether this periodic sync runs on a {@link SyncService}. */
- public final boolean isService;
/**
* How much flexibility can be taken in scheduling the sync, in seconds.
* {@hide}
@@ -44,16 +40,11 @@ public class PeriodicSync implements Parcelable {
public final long flexTime;
/**
- * Creates a new PeriodicSync, copying the Bundle. SM no longer uses this ctor - kept around
- * becuse it is part of the API.
- * Note - even calls to the old API will not use this ctor, as
- * they are given a default flex time.
+ * Creates a new PeriodicSync, copying the Bundle. This constructor is no longer used.
*/
public PeriodicSync(Account account, String authority, Bundle extras, long periodInSeconds) {
this.account = account;
this.authority = authority;
- this.service = null;
- this.isService = false;
if (extras == null) {
this.extras = new Bundle();
} else {
@@ -71,8 +62,6 @@ public class PeriodicSync implements Parcelable {
public PeriodicSync(PeriodicSync other) {
this.account = other.account;
this.authority = other.authority;
- this.service = other.service;
- this.isService = other.isService;
this.extras = new Bundle(other.extras);
this.period = other.period;
this.flexTime = other.flexTime;
@@ -86,40 +75,14 @@ public class PeriodicSync implements Parcelable {
long period, long flexTime) {
this.account = account;
this.authority = authority;
- this.service = null;
- this.isService = false;
- this.extras = new Bundle(extras);
- this.period = period;
- this.flexTime = flexTime;
- }
-
- /**
- * A PeriodicSync for a sync with a specified SyncService.
- * {@hide}
- */
- public PeriodicSync(ComponentName service, Bundle extras,
- long period,
- long flexTime) {
- this.account = null;
- this.authority = null;
- this.service = service;
- this.isService = true;
this.extras = new Bundle(extras);
this.period = period;
this.flexTime = flexTime;
}
private PeriodicSync(Parcel in) {
- this.isService = (in.readInt() != 0);
- if (this.isService) {
- this.service = in.readParcelable(null);
- this.account = null;
- this.authority = null;
- } else {
- this.account = in.readParcelable(null);
- this.authority = in.readString();
- this.service = null;
- }
+ this.account = in.readParcelable(null);
+ this.authority = in.readString();
this.extras = in.readBundle();
this.period = in.readLong();
this.flexTime = in.readLong();
@@ -132,13 +95,8 @@ public class PeriodicSync implements Parcelable {
@Override
public void writeToParcel(Parcel dest, int flags) {
- dest.writeInt(isService ? 1 : 0);
- if (account == null && authority == null) {
- dest.writeParcelable(service, flags);
- } else {
- dest.writeParcelable(account, flags);
- dest.writeString(authority);
- }
+ dest.writeParcelable(account, flags);
+ dest.writeString(authority);
dest.writeBundle(extras);
dest.writeLong(period);
dest.writeLong(flexTime);
@@ -165,24 +123,14 @@ public class PeriodicSync implements Parcelable {
return false;
}
final PeriodicSync other = (PeriodicSync) o;
- if (this.isService != other.isService) {
- return false;
- }
- boolean equal = false;
- if (this.isService) {
- equal = service.equals(other.service);
- } else {
- equal = account.equals(other.account)
- && authority.equals(other.authority);
- }
- return equal
- && period == other.period
- && syncExtrasEquals(extras, other.extras);
+ return account.equals(other.account)
+ && authority.equals(other.authority)
+ && period == other.period
+ && syncExtrasEquals(extras, other.extras);
}
/**
- * Periodic sync extra comparison function. Duplicated from
- * {@link com.android.server.content.SyncManager#syncExtrasEquals(Bundle b1, Bundle b2)}
+ * Periodic sync extra comparison function.
* {@hide}
*/
public static boolean syncExtrasEquals(Bundle b1, Bundle b2) {
@@ -207,7 +155,6 @@ public class PeriodicSync implements Parcelable {
public String toString() {
return "account: " + account +
", authority: " + authority +
- ", service: " + service +
". period: " + period + "s " +
", flex: " + flexTime;
}