Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 584f10e3 authored by Makoto Onuki's avatar Makoto Onuki Committed by android-build-merger
Browse files

Merge "Persist/pacel # of periodic syncs properly." into oc-dr1-dev am: 5bbf44e7 am: 5eb5ec71

am: 6098a153

Change-Id: Ibe5deaaae3ccafef77eb8b1120222458d638bd5e
parents 1e518e1b 6098a153
Loading
Loading
Loading
Loading
+12 −1
Original line number Original line Diff line number Diff line
@@ -26,7 +26,7 @@ import java.util.ArrayList;
public class SyncStatusInfo implements Parcelable {
public class SyncStatusInfo implements Parcelable {
    private static final String TAG = "Sync";
    private static final String TAG = "Sync";


    static final int VERSION = 3;
    static final int VERSION = 4;


    private static final int MAX_EVENT_COUNT = 10;
    private static final int MAX_EVENT_COUNT = 10;


@@ -102,6 +102,7 @@ public class SyncStatusInfo implements Parcelable {
            parcel.writeLong(mLastEventTimes.get(i));
            parcel.writeLong(mLastEventTimes.get(i));
            parcel.writeString(mLastEvents.get(i));
            parcel.writeString(mLastEvents.get(i));
        }
        }
        parcel.writeInt(numSourcePeriodic);
    }
    }


    public SyncStatusInfo(Parcel parcel) {
    public SyncStatusInfo(Parcel parcel) {
@@ -146,6 +147,16 @@ public class SyncStatusInfo implements Parcelable {
                }
                }
            }
            }
        }
        }
        if (version < 4) {
            // Before version 4, numSourcePeriodic wasn't persisted.
            numSourcePeriodic = numSyncs - numSourceLocal - numSourcePoll - numSourceServer
                    - numSourceUser;
            if (numSourcePeriodic < 0) { // Sanity check.
                numSourcePeriodic = 0;
            }
        } else {
            numSourcePeriodic = parcel.readInt();
        }
    }
    }


    public SyncStatusInfo(SyncStatusInfo other) {
    public SyncStatusInfo(SyncStatusInfo other) {