From 8ac6a63a94494b356b30f076d7ad52fcc6024935 Mon Sep 17 00:00:00 2001 From: Alon Albert Date: Mon, 17 Dec 2012 17:21:18 -0800 Subject: [PATCH] Put some useful information in User-Agent Header Put information in User-Agent: * Build fingerprint * Calendar or CalendarSyncAdapter package name + version code * Package name of app making changes to provider for uphill syncs Example: google/mantaray/manta:K/MASTER/eng.aalbert.20121217.140040:eng/dev-keys:com.google.android.calendar:201212060:com.google.android.calendar Google-HTTP-Java-Client/1.11.0-beta (gzip) Change-Id: Ief8f57809ce240df4f5c662c703dcb80dab47367 --- api/current.txt | 1 + core/java/android/provider/CalendarContract.java | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/api/current.txt b/api/current.txt index 4c962fb997440..3175c3de85129 100644 --- a/api/current.txt +++ b/api/current.txt @@ -17360,6 +17360,7 @@ package android.provider { field public static final java.lang.String CAN_PARTIALLY_UPDATE = "canPartiallyUpdate"; field public static final java.lang.String DELETED = "deleted"; field public static final java.lang.String DIRTY = "dirty"; + field public static final java.lang.String MUTATORS = "mutators"; field public static final java.lang.String _SYNC_ID = "_sync_id"; } diff --git a/core/java/android/provider/CalendarContract.java b/core/java/android/provider/CalendarContract.java index af6e88e99bcab..5fdca86c8d8af 100644 --- a/core/java/android/provider/CalendarContract.java +++ b/core/java/android/provider/CalendarContract.java @@ -302,8 +302,15 @@ public final class CalendarContract { * Used to indicate that local, unsynced, changes are present. *

Type: INTEGER (long)

*/ + public static final String DIRTY = "dirty"; + /** + * Used in conjunction with {@link #DIRTY} to indicate what packages wrote local changes. + *

Type: TEXT

+ */ + public static final String MUTATORS = "mutators"; + /** * Whether the row has been deleted but not synced to the server. A * deleted row should be ignored. @@ -525,6 +532,7 @@ public final class CalendarContract { DatabaseUtils.cursorStringToContentValuesIfPresent(cursor, cv, _SYNC_ID); DatabaseUtils.cursorLongToContentValuesIfPresent(cursor, cv, DIRTY); + DatabaseUtils.cursorStringToContentValuesIfPresent(cursor, cv, MUTATORS); DatabaseUtils.cursorStringToContentValuesIfPresent(cursor, cv, CAL_SYNC1); DatabaseUtils.cursorStringToContentValuesIfPresent(cursor, cv, CAL_SYNC2); @@ -647,6 +655,7 @@ public final class CalendarContract { *
  • {@link #CALENDAR_COLOR}
  • *
  • {@link #_SYNC_ID}
  • *
  • {@link #DIRTY}
  • + *
  • {@link #MUTATORS}
  • *
  • {@link #OWNER_ACCOUNT}
  • *
  • {@link #MAX_REMINDERS}
  • *
  • {@link #ALLOWED_REMINDERS}
  • @@ -714,6 +723,7 @@ public final class CalendarContract { ACCOUNT_TYPE, _SYNC_ID, DIRTY, + MUTATORS, OWNER_ACCOUNT, MAX_REMINDERS, ALLOWED_REMINDERS, @@ -1393,6 +1403,7 @@ public final class CalendarContract { DatabaseUtils.cursorStringToContentValuesIfPresent(cursor, cv, IS_ORGANIZER); DatabaseUtils.cursorStringToContentValuesIfPresent(cursor, cv, _SYNC_ID); DatabaseUtils.cursorLongToContentValuesIfPresent(cursor, cv, DIRTY); + DatabaseUtils.cursorStringToContentValuesIfPresent(cursor, cv, MUTATORS); DatabaseUtils.cursorLongToContentValuesIfPresent(cursor, cv, LAST_SYNCED); DatabaseUtils.cursorIntToContentValuesIfPresent(cursor, cv, DELETED); DatabaseUtils.cursorStringToContentValuesIfPresent(cursor, cv, SYNC_DATA1); @@ -1599,6 +1610,7 @@ public final class CalendarContract { * The following Events columns are writable only by a sync adapter *