diff options
author | 2015-12-18 18:22:10 +0000 | |
---|---|---|
committer | 2015-12-18 18:22:10 +0000 | |
commit | 76ef0fbe064fc7e197af0c5f4c30d733b37f834d (patch) | |
tree | 88fb79c4e1a69ea51626f05038516b06e07afcb9 | |
parent | 61924260f4071b4591c3c8694079088666558f3e (diff) | |
parent | a07707a899b223fa9f62eec553a54b643bb1a29e (diff) |
Merge "Add field QUOTA_OCCUPIED and QUOTA_TOTAL to VoicemailContract.Status"
-rw-r--r-- | api/current.txt | 6 | ||||
-rw-r--r-- | api/system-current.txt | 6 | ||||
-rw-r--r-- | api/test-current.txt | 6 | ||||
-rw-r--r-- | core/java/android/provider/CallLog.java | 7 | ||||
-rw-r--r-- | core/java/android/provider/VoicemailContract.java | 60 |
5 files changed, 85 insertions, 0 deletions
diff --git a/api/current.txt b/api/current.txt index e4962d822a4f..8ad1f65dbcac 100644 --- a/api/current.txt +++ b/api/current.txt @@ -29311,6 +29311,7 @@ package android.provider { field public static final java.lang.String GEOCODED_LOCATION = "geocoded_location"; field public static final int INCOMING_TYPE = 1; // 0x1 field public static final java.lang.String IS_READ = "is_read"; + field public static final java.lang.String LAST_MODIFIED = "last_modified"; field public static final java.lang.String LIMIT_PARAM_KEY = "limit"; field public static final int MISSED_TYPE = 3; // 0x3 field public static final java.lang.String NEW = "new"; @@ -31581,6 +31582,7 @@ package android.provider { public static final class VoicemailContract.Status implements android.provider.BaseColumns { method public static android.net.Uri buildSourceUri(java.lang.String); + method public static void setQuota(android.content.Context, android.telecom.PhoneAccountHandle, int, int); field public static final java.lang.String CONFIGURATION_STATE = "configuration_state"; field public static final int CONFIGURATION_STATE_CAN_BE_CONFIGURED = 2; // 0x2 field public static final int CONFIGURATION_STATE_NOT_CONFIGURED = 1; // 0x1 @@ -31597,6 +31599,9 @@ package android.provider { field public static final int NOTIFICATION_CHANNEL_STATE_OK = 0; // 0x0 field public static final java.lang.String PHONE_ACCOUNT_COMPONENT_NAME = "phone_account_component_name"; field public static final java.lang.String PHONE_ACCOUNT_ID = "phone_account_id"; + field public static final java.lang.String QUOTA_OCCUPIED = "quota_occupied"; + field public static final java.lang.String QUOTA_TOTAL = "quota_total"; + field public static final int QUOTA_UNAVAILABLE = -1; // 0xffffffff field public static final java.lang.String SETTINGS_URI = "settings_uri"; field public static final java.lang.String SOURCE_PACKAGE = "source_package"; field public static final java.lang.String VOICEMAIL_ACCESS_URI = "voicemail_access_uri"; @@ -31613,6 +31618,7 @@ package android.provider { field public static final java.lang.String HAS_CONTENT = "has_content"; field public static final java.lang.String IS_READ = "is_read"; field public static final java.lang.String ITEM_TYPE = "vnd.android.cursor.item/voicemail"; + field public static final java.lang.String LAST_MODIFIED = "last_modified"; field public static final java.lang.String MIME_TYPE = "mime_type"; field public static final java.lang.String NUMBER = "number"; field public static final java.lang.String PHONE_ACCOUNT_COMPONENT_NAME = "subscription_component_name"; diff --git a/api/system-current.txt b/api/system-current.txt index 586ea06df874..b83990cbc5cd 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -31321,6 +31321,7 @@ package android.provider { field public static final java.lang.String GEOCODED_LOCATION = "geocoded_location"; field public static final int INCOMING_TYPE = 1; // 0x1 field public static final java.lang.String IS_READ = "is_read"; + field public static final java.lang.String LAST_MODIFIED = "last_modified"; field public static final java.lang.String LIMIT_PARAM_KEY = "limit"; field public static final int MISSED_TYPE = 3; // 0x3 field public static final java.lang.String NEW = "new"; @@ -33724,6 +33725,7 @@ package android.provider { public static final class VoicemailContract.Status implements android.provider.BaseColumns { method public static android.net.Uri buildSourceUri(java.lang.String); + method public static void setQuota(android.content.Context, android.telecom.PhoneAccountHandle, int, int); field public static final java.lang.String CONFIGURATION_STATE = "configuration_state"; field public static final int CONFIGURATION_STATE_CAN_BE_CONFIGURED = 2; // 0x2 field public static final int CONFIGURATION_STATE_NOT_CONFIGURED = 1; // 0x1 @@ -33740,6 +33742,9 @@ package android.provider { field public static final int NOTIFICATION_CHANNEL_STATE_OK = 0; // 0x0 field public static final java.lang.String PHONE_ACCOUNT_COMPONENT_NAME = "phone_account_component_name"; field public static final java.lang.String PHONE_ACCOUNT_ID = "phone_account_id"; + field public static final java.lang.String QUOTA_OCCUPIED = "quota_occupied"; + field public static final java.lang.String QUOTA_TOTAL = "quota_total"; + field public static final int QUOTA_UNAVAILABLE = -1; // 0xffffffff field public static final java.lang.String SETTINGS_URI = "settings_uri"; field public static final java.lang.String SOURCE_PACKAGE = "source_package"; field public static final java.lang.String VOICEMAIL_ACCESS_URI = "voicemail_access_uri"; @@ -33756,6 +33761,7 @@ package android.provider { field public static final java.lang.String HAS_CONTENT = "has_content"; field public static final java.lang.String IS_READ = "is_read"; field public static final java.lang.String ITEM_TYPE = "vnd.android.cursor.item/voicemail"; + field public static final java.lang.String LAST_MODIFIED = "last_modified"; field public static final java.lang.String MIME_TYPE = "mime_type"; field public static final java.lang.String NUMBER = "number"; field public static final java.lang.String PHONE_ACCOUNT_COMPONENT_NAME = "subscription_component_name"; diff --git a/api/test-current.txt b/api/test-current.txt index eccd8b006c82..0cb6bc52461d 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -29313,6 +29313,7 @@ package android.provider { field public static final java.lang.String GEOCODED_LOCATION = "geocoded_location"; field public static final int INCOMING_TYPE = 1; // 0x1 field public static final java.lang.String IS_READ = "is_read"; + field public static final java.lang.String LAST_MODIFIED = "last_modified"; field public static final java.lang.String LIMIT_PARAM_KEY = "limit"; field public static final int MISSED_TYPE = 3; // 0x3 field public static final java.lang.String NEW = "new"; @@ -31583,6 +31584,7 @@ package android.provider { public static final class VoicemailContract.Status implements android.provider.BaseColumns { method public static android.net.Uri buildSourceUri(java.lang.String); + method public static void setQuota(android.content.Context, android.telecom.PhoneAccountHandle, int, int); field public static final java.lang.String CONFIGURATION_STATE = "configuration_state"; field public static final int CONFIGURATION_STATE_CAN_BE_CONFIGURED = 2; // 0x2 field public static final int CONFIGURATION_STATE_NOT_CONFIGURED = 1; // 0x1 @@ -31599,6 +31601,9 @@ package android.provider { field public static final int NOTIFICATION_CHANNEL_STATE_OK = 0; // 0x0 field public static final java.lang.String PHONE_ACCOUNT_COMPONENT_NAME = "phone_account_component_name"; field public static final java.lang.String PHONE_ACCOUNT_ID = "phone_account_id"; + field public static final java.lang.String QUOTA_OCCUPIED = "quota_occupied"; + field public static final java.lang.String QUOTA_TOTAL = "quota_total"; + field public static final int QUOTA_UNAVAILABLE = -1; // 0xffffffff field public static final java.lang.String SETTINGS_URI = "settings_uri"; field public static final java.lang.String SOURCE_PACKAGE = "source_package"; field public static final java.lang.String VOICEMAIL_ACCESS_URI = "voicemail_access_uri"; @@ -31615,6 +31620,7 @@ package android.provider { field public static final java.lang.String HAS_CONTENT = "has_content"; field public static final java.lang.String IS_READ = "is_read"; field public static final java.lang.String ITEM_TYPE = "vnd.android.cursor.item/voicemail"; + field public static final java.lang.String LAST_MODIFIED = "last_modified"; field public static final java.lang.String MIME_TYPE = "mime_type"; field public static final java.lang.String NUMBER = "number"; field public static final java.lang.String PHONE_ACCOUNT_COMPONENT_NAME = "subscription_component_name"; diff --git a/core/java/android/provider/CallLog.java b/core/java/android/provider/CallLog.java index 1d4d57278a57..6a5d857c4a37 100644 --- a/core/java/android/provider/CallLog.java +++ b/core/java/android/provider/CallLog.java @@ -421,6 +421,13 @@ public class CallLog { public static final String ADD_FOR_ALL_USERS = "add_for_all_users"; /** + * The date the row is last inserted, updated, or marked as deleted, in milliseconds + * since the epoch. Read only. + * <P>Type: INTEGER (long)</P> + */ + public static final String LAST_MODIFIED = "last_modified"; + + /** * If a successful call is made that is longer than this duration, update the phone number * in the ContactsProvider with the normalized version of the number, based on the user's * current country code. diff --git a/core/java/android/provider/VoicemailContract.java b/core/java/android/provider/VoicemailContract.java index 76eaea9998cd..24683cb1d9fd 100644 --- a/core/java/android/provider/VoicemailContract.java +++ b/core/java/android/provider/VoicemailContract.java @@ -245,6 +245,13 @@ public class VoicemailContract { public static final String DELETED = "deleted"; /** + * The date the row is last inserted, updated, or marked as deleted, in milliseconds + * since the epoch. Read only. + * <P>Type: INTEGER (long)</P> + */ + public static final String LAST_MODIFIED = "last_modified"; + + /** * A convenience method to build voicemail URI specific to a source package by appending * {@link VoicemailContract#PARAM_KEY_SOURCE_PACKAGE} param to the base URI. */ @@ -449,6 +456,26 @@ public class VoicemailContract { public static final int NOTIFICATION_CHANNEL_STATE_MESSAGE_WAITING = 2; /** + * Amount of resource that is used by existing voicemail in the visual voicemail inbox, + * or {@link #QUOTA_UNAVAILABLE}. Unit is not specified. + * <P>Type: INTEGER</P> + */ + public static final String QUOTA_OCCUPIED = "quota_occupied"; + + /** + * Total resource in the visual voicemail inbox that can be used, or + * {@link #QUOTA_UNAVAILABLE}. Unit is not specified. + * <P>Type: INTEGER</P> + */ + public static final String QUOTA_TOTAL = "quota_total"; + + /** + * Value for {@link #QUOTA_OCCUPIED} and {@link #QUOTA_TOTAL} to indicate that no + * information is available. + */ + public static final int QUOTA_UNAVAILABLE = -1; + + /** * A convenience method to build status URI specific to a source package by appending * {@link VoicemailContract#PARAM_KEY_SOURCE_PACKAGE} param to the base URI. */ @@ -488,6 +515,39 @@ public class VoicemailContract { } /** + * A helper method to set the quota of a voicemail source. Unit is unspecified. + * + * @param context The context from the package calling the method. This will be the source. + * @param accountHandle The handle for the account the source is associated with. + * @param occupied See {@link Status#QUOTA_OCCUPIED} + * @param total See {@link Status#QUOTA_TOTAL} + */ + public static void setQuota(Context context, PhoneAccountHandle accountHandle, int occupied, + int total) { + if (occupied == QUOTA_UNAVAILABLE && total == QUOTA_UNAVAILABLE) { + return; + } + ContentValues values = new ContentValues(); + values.put(Status.PHONE_ACCOUNT_COMPONENT_NAME, + accountHandle.getComponentName().flattenToString()); + values.put(Status.PHONE_ACCOUNT_ID, accountHandle.getId()); + if (occupied != QUOTA_UNAVAILABLE) { + values.put(Status.QUOTA_OCCUPIED,occupied); + } + if (total != QUOTA_UNAVAILABLE) { + values.put(Status.QUOTA_TOTAL,total); + } + + ContentResolver contentResolver = context.getContentResolver(); + Uri statusUri = buildSourceUri(context.getPackageName()); + if (isStatusPresent(contentResolver, statusUri)) { + contentResolver.update(statusUri, values, null, null); + } else { + contentResolver.insert(statusUri, values); + } + } + + /** * Determines if a voicemail source exists in the status table. * * @param contentResolver A content resolver constructed from the appropriate context. |