Merge "Actually show secret notifications sometimes." into lmp-dev
diff --git a/api/current.txt b/api/current.txt
index 8e49566..0154eff 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -106,7 +106,7 @@
field public static final java.lang.String READ_PHONE_STATE = "android.permission.READ_PHONE_STATE";
field public static final java.lang.String READ_PROFILE = "android.permission.READ_PROFILE";
field public static final java.lang.String READ_SMS = "android.permission.READ_SMS";
- field public static final java.lang.String READ_SOCIAL_STREAM = "android.permission.READ_SOCIAL_STREAM";
+ field public static final deprecated java.lang.String READ_SOCIAL_STREAM = "android.permission.READ_SOCIAL_STREAM";
field public static final java.lang.String READ_SYNC_SETTINGS = "android.permission.READ_SYNC_SETTINGS";
field public static final java.lang.String READ_SYNC_STATS = "android.permission.READ_SYNC_STATS";
field public static final java.lang.String READ_USER_DICTIONARY = "android.permission.READ_USER_DICTIONARY";
@@ -157,7 +157,7 @@
field public static final java.lang.String WRITE_SECURE_SETTINGS = "android.permission.WRITE_SECURE_SETTINGS";
field public static final java.lang.String WRITE_SETTINGS = "android.permission.WRITE_SETTINGS";
field public static final java.lang.String WRITE_SMS = "android.permission.WRITE_SMS";
- field public static final java.lang.String WRITE_SOCIAL_STREAM = "android.permission.WRITE_SOCIAL_STREAM";
+ field public static final deprecated java.lang.String WRITE_SOCIAL_STREAM = "android.permission.WRITE_SOCIAL_STREAM";
field public static final java.lang.String WRITE_SYNC_SETTINGS = "android.permission.WRITE_SYNC_SETTINGS";
field public static final java.lang.String WRITE_USER_DICTIONARY = "android.permission.WRITE_USER_DICTIONARY";
}
@@ -13964,6 +13964,29 @@
method public android.media.AudioAttributes.Builder setUsage(int);
}
+ public class AudioDevice {
+ field public static final int DEVICE_TYPE_AUX_LINE = 19; // 0x13
+ field public static final int DEVICE_TYPE_BLUETOOTH_A2DP = 8; // 0x8
+ field public static final int DEVICE_TYPE_BLUETOOTH_SCO = 7; // 0x7
+ field public static final int DEVICE_TYPE_BUILTIN_EARPIECE = 1; // 0x1
+ field public static final int DEVICE_TYPE_BUILTIN_MIC = 15; // 0xf
+ field public static final int DEVICE_TYPE_BUILTIN_SPEAKER = 2; // 0x2
+ field public static final int DEVICE_TYPE_DOCK = 13; // 0xd
+ field public static final int DEVICE_TYPE_FM = 14; // 0xe
+ field public static final int DEVICE_TYPE_FM_TUNER = 16; // 0x10
+ field public static final int DEVICE_TYPE_HDMI = 9; // 0x9
+ field public static final int DEVICE_TYPE_HDMI_ARC = 10; // 0xa
+ field public static final int DEVICE_TYPE_LINE_ANALOG = 5; // 0x5
+ field public static final int DEVICE_TYPE_LINE_DIGITAL = 6; // 0x6
+ field public static final int DEVICE_TYPE_TELEPHONY = 18; // 0x12
+ field public static final int DEVICE_TYPE_TV_TUNER = 17; // 0x11
+ field public static final int DEVICE_TYPE_UNKNOWN = 0; // 0x0
+ field public static final int DEVICE_TYPE_USB_ACCESSORY = 12; // 0xc
+ field public static final int DEVICE_TYPE_USB_DEVICE = 11; // 0xb
+ field public static final int DEVICE_TYPE_WIRED_HEADPHONES = 4; // 0x4
+ field public static final int DEVICE_TYPE_WIRED_HEADSET = 3; // 0x3
+ }
+
public class AudioFormat {
field public static final deprecated int CHANNEL_CONFIGURATION_DEFAULT = 1; // 0x1
field public static final deprecated int CHANNEL_CONFIGURATION_INVALID = 0; // 0x0
@@ -15896,8 +15919,11 @@
public class Virtualizer extends android.media.audiofx.AudioEffect {
ctor public Virtualizer(int, int) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.RuntimeException, java.lang.UnsupportedOperationException;
+ method public boolean canVirtualize(int, int) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
+ method public boolean forceVirtualizationMode(int) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
method public android.media.audiofx.Virtualizer.Settings getProperties() throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
method public short getRoundedStrength() throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
+ method public boolean getSpeakerAngles(int, int, int[]) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
method public boolean getStrengthSupported();
method public void setParameterListener(android.media.audiofx.Virtualizer.OnParameterChangeListener);
method public void setProperties(android.media.audiofx.Virtualizer.Settings) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException;
@@ -24244,8 +24270,8 @@
field public static final java.lang.String PHOTO_FILE_ID = "data14";
}
- public static final class ContactsContract.Contacts.StreamItems implements android.provider.ContactsContract.StreamItemsColumns {
- field public static final java.lang.String CONTENT_DIRECTORY = "stream_items";
+ public static final deprecated class ContactsContract.Contacts.StreamItems implements android.provider.ContactsContract.StreamItemsColumns {
+ field public static final deprecated java.lang.String CONTENT_DIRECTORY = "stream_items";
}
protected static abstract interface ContactsContract.ContactsColumns {
@@ -24541,8 +24567,8 @@
field public static final java.lang.String DATA_ID = "data_id";
}
- public static final class ContactsContract.RawContacts.StreamItems implements android.provider.BaseColumns android.provider.ContactsContract.StreamItemsColumns {
- field public static final java.lang.String CONTENT_DIRECTORY = "stream_items";
+ public static final deprecated class ContactsContract.RawContacts.StreamItems implements android.provider.BaseColumns android.provider.ContactsContract.StreamItemsColumns {
+ field public static final deprecated java.lang.String CONTENT_DIRECTORY = "stream_items";
}
protected static abstract interface ContactsContract.RawContactsColumns {
@@ -24616,54 +24642,54 @@
field public static final android.net.Uri PROFILE_CONTENT_URI;
}
- public static final class ContactsContract.StreamItemPhotos implements android.provider.BaseColumns android.provider.ContactsContract.StreamItemPhotosColumns {
- field public static final java.lang.String PHOTO = "photo";
+ public static final deprecated class ContactsContract.StreamItemPhotos implements android.provider.BaseColumns android.provider.ContactsContract.StreamItemPhotosColumns {
+ field public static final deprecated java.lang.String PHOTO = "photo";
}
- protected static abstract interface ContactsContract.StreamItemPhotosColumns {
- field public static final java.lang.String PHOTO_FILE_ID = "photo_file_id";
- field public static final java.lang.String PHOTO_URI = "photo_uri";
- field public static final java.lang.String SORT_INDEX = "sort_index";
- field public static final java.lang.String STREAM_ITEM_ID = "stream_item_id";
- field public static final java.lang.String SYNC1 = "stream_item_photo_sync1";
- field public static final java.lang.String SYNC2 = "stream_item_photo_sync2";
- field public static final java.lang.String SYNC3 = "stream_item_photo_sync3";
- field public static final java.lang.String SYNC4 = "stream_item_photo_sync4";
+ protected static abstract deprecated interface ContactsContract.StreamItemPhotosColumns {
+ field public static final deprecated java.lang.String PHOTO_FILE_ID = "photo_file_id";
+ field public static final deprecated java.lang.String PHOTO_URI = "photo_uri";
+ field public static final deprecated java.lang.String SORT_INDEX = "sort_index";
+ field public static final deprecated java.lang.String STREAM_ITEM_ID = "stream_item_id";
+ field public static final deprecated java.lang.String SYNC1 = "stream_item_photo_sync1";
+ field public static final deprecated java.lang.String SYNC2 = "stream_item_photo_sync2";
+ field public static final deprecated java.lang.String SYNC3 = "stream_item_photo_sync3";
+ field public static final deprecated java.lang.String SYNC4 = "stream_item_photo_sync4";
}
- public static final class ContactsContract.StreamItems implements android.provider.BaseColumns android.provider.ContactsContract.StreamItemsColumns {
- field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/stream_item";
- field public static final android.net.Uri CONTENT_LIMIT_URI;
- field public static final android.net.Uri CONTENT_PHOTO_URI;
- field public static final java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/stream_item";
- field public static final android.net.Uri CONTENT_URI;
- field public static final java.lang.String MAX_ITEMS = "max_items";
+ public static final deprecated class ContactsContract.StreamItems implements android.provider.BaseColumns android.provider.ContactsContract.StreamItemsColumns {
+ field public static final deprecated java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/stream_item";
+ field public static final deprecated android.net.Uri CONTENT_LIMIT_URI;
+ field public static final deprecated android.net.Uri CONTENT_PHOTO_URI;
+ field public static final deprecated java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/stream_item";
+ field public static final deprecated android.net.Uri CONTENT_URI;
+ field public static final deprecated java.lang.String MAX_ITEMS = "max_items";
}
- public static final class ContactsContract.StreamItems.StreamItemPhotos implements android.provider.BaseColumns android.provider.ContactsContract.StreamItemPhotosColumns {
- field public static final java.lang.String CONTENT_DIRECTORY = "photo";
- field public static final java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/stream_item_photo";
- field public static final java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/stream_item_photo";
+ public static final deprecated class ContactsContract.StreamItems.StreamItemPhotos implements android.provider.BaseColumns android.provider.ContactsContract.StreamItemPhotosColumns {
+ field public static final deprecated java.lang.String CONTENT_DIRECTORY = "photo";
+ field public static final deprecated java.lang.String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/stream_item_photo";
+ field public static final deprecated java.lang.String CONTENT_TYPE = "vnd.android.cursor.dir/stream_item_photo";
}
- protected static abstract interface ContactsContract.StreamItemsColumns {
- field public static final java.lang.String ACCOUNT_NAME = "account_name";
- field public static final java.lang.String ACCOUNT_TYPE = "account_type";
- field public static final java.lang.String COMMENTS = "comments";
- field public static final java.lang.String CONTACT_ID = "contact_id";
- field public static final java.lang.String CONTACT_LOOKUP_KEY = "contact_lookup";
- field public static final java.lang.String DATA_SET = "data_set";
- field public static final java.lang.String RAW_CONTACT_ID = "raw_contact_id";
- field public static final java.lang.String RAW_CONTACT_SOURCE_ID = "raw_contact_source_id";
- field public static final java.lang.String RES_ICON = "icon";
- field public static final java.lang.String RES_LABEL = "label";
- field public static final java.lang.String RES_PACKAGE = "res_package";
- field public static final java.lang.String SYNC1 = "stream_item_sync1";
- field public static final java.lang.String SYNC2 = "stream_item_sync2";
- field public static final java.lang.String SYNC3 = "stream_item_sync3";
- field public static final java.lang.String SYNC4 = "stream_item_sync4";
- field public static final java.lang.String TEXT = "text";
- field public static final java.lang.String TIMESTAMP = "timestamp";
+ protected static abstract deprecated interface ContactsContract.StreamItemsColumns {
+ field public static final deprecated java.lang.String ACCOUNT_NAME = "account_name";
+ field public static final deprecated java.lang.String ACCOUNT_TYPE = "account_type";
+ field public static final deprecated java.lang.String COMMENTS = "comments";
+ field public static final deprecated java.lang.String CONTACT_ID = "contact_id";
+ field public static final deprecated java.lang.String CONTACT_LOOKUP_KEY = "contact_lookup";
+ field public static final deprecated java.lang.String DATA_SET = "data_set";
+ field public static final deprecated java.lang.String RAW_CONTACT_ID = "raw_contact_id";
+ field public static final deprecated java.lang.String RAW_CONTACT_SOURCE_ID = "raw_contact_source_id";
+ field public static final deprecated java.lang.String RES_ICON = "icon";
+ field public static final deprecated java.lang.String RES_LABEL = "label";
+ field public static final deprecated java.lang.String RES_PACKAGE = "res_package";
+ field public static final deprecated java.lang.String SYNC1 = "stream_item_sync1";
+ field public static final deprecated java.lang.String SYNC2 = "stream_item_sync2";
+ field public static final deprecated java.lang.String SYNC3 = "stream_item_sync3";
+ field public static final deprecated java.lang.String SYNC4 = "stream_item_sync4";
+ field public static final deprecated java.lang.String TEXT = "text";
+ field public static final deprecated java.lang.String TIMESTAMP = "timestamp";
}
protected static abstract interface ContactsContract.SyncColumns implements android.provider.ContactsContract.BaseSyncColumns {
@@ -28406,28 +28432,29 @@
}
public class PhoneAccount implements android.os.Parcelable {
- ctor public PhoneAccount(android.content.ComponentName, java.lang.String, android.net.Uri, int);
+ ctor public PhoneAccount(android.content.ComponentName, java.lang.String);
method public int describeContents();
- method public int getCapabilities();
method public android.content.ComponentName getComponentName();
- method public android.net.Uri getHandle();
method public java.lang.String getId();
method public void writeToParcel(android.os.Parcel, int);
- field public static final int CAPABILITY_CALL_PROVIDER = 2; // 0x2
- field public static final int CAPABILITY_SIM_CALL_MANAGER = 1; // 0x1
field public static final int CAPABILITY_SIM_SUBSCRIPTION = 4; // 0x4
field public static final android.os.Parcelable.Creator CREATOR;
}
public class PhoneAccountMetadata implements android.os.Parcelable {
- ctor public PhoneAccountMetadata(android.telecomm.PhoneAccount, int, java.lang.String, java.lang.String, boolean);
+ ctor public PhoneAccountMetadata(android.telecomm.PhoneAccount, android.net.Uri, int, int, java.lang.String, java.lang.String, boolean);
method public int describeContents();
method public android.telecomm.PhoneAccount getAccount();
+ method public int getCapabilities();
+ method public android.net.Uri getHandle();
method public android.graphics.drawable.Drawable getIcon(android.content.Context);
+ method public int getIconResId();
method public java.lang.String getLabel();
method public java.lang.String getShortDescription();
method public boolean isVideoCallingSupported();
method public void writeToParcel(android.os.Parcel, int);
+ field public static final int CAPABILITY_CALL_PROVIDER = 2; // 0x2
+ field public static final int CAPABILITY_SIM_CALL_MANAGER = 1; // 0x1
field public static final android.os.Parcelable.Creator CREATOR;
}
@@ -28537,9 +28564,10 @@
public class TelecommManager {
method public void clearAccounts(java.lang.String);
+ method public android.telecomm.PhoneAccount getDefaultOutgoingPhoneAccount();
method public java.util.List<android.telecomm.PhoneAccount> getEnabledPhoneAccounts();
method public android.telecomm.PhoneAccountMetadata getPhoneAccountMetadata(android.telecomm.PhoneAccount);
- method public void registerPhoneAccount(android.telecomm.PhoneAccount, android.telecomm.PhoneAccountMetadata);
+ method public void registerPhoneAccount(android.telecomm.PhoneAccountMetadata);
method public void unregisterPhoneAccount(android.telecomm.PhoneAccount);
}
@@ -31258,6 +31286,64 @@
method public android.text.style.TtsSpan.CardinalBuilder setNumber(java.lang.String);
}
+ public static class TtsSpan.DateBuilder extends android.text.style.TtsSpan.SemioticClassBuilder {
+ ctor public TtsSpan.DateBuilder();
+ ctor public TtsSpan.DateBuilder(java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer);
+ method public android.text.style.TtsSpan.DateBuilder setDay(int);
+ method public android.text.style.TtsSpan.DateBuilder setMonth(int);
+ method public android.text.style.TtsSpan.DateBuilder setWeekday(int);
+ method public android.text.style.TtsSpan.DateBuilder setYear(int);
+ }
+
+ public static class TtsSpan.DecimalBuilder extends android.text.style.TtsSpan.SemioticClassBuilder {
+ ctor public TtsSpan.DecimalBuilder();
+ ctor public TtsSpan.DecimalBuilder(double, int, int);
+ ctor public TtsSpan.DecimalBuilder(java.lang.String, java.lang.String);
+ method public android.text.style.TtsSpan.DecimalBuilder setArgumentsFromDouble(double, int, int);
+ method public android.text.style.TtsSpan.DecimalBuilder setFractionalPart(java.lang.String);
+ method public android.text.style.TtsSpan.DecimalBuilder setIntegerPart(long);
+ method public android.text.style.TtsSpan.DecimalBuilder setIntegerPart(java.lang.String);
+ }
+
+ public static class TtsSpan.DigitsBuilder extends android.text.style.TtsSpan.SemioticClassBuilder {
+ ctor public TtsSpan.DigitsBuilder();
+ ctor public TtsSpan.DigitsBuilder(java.lang.String);
+ method public android.text.style.TtsSpan.DigitsBuilder setDigits(java.lang.String);
+ }
+
+ public static class TtsSpan.FractionBuilder extends android.text.style.TtsSpan.SemioticClassBuilder {
+ ctor public TtsSpan.FractionBuilder();
+ ctor public TtsSpan.FractionBuilder(long, long, long);
+ method public android.text.style.TtsSpan.FractionBuilder setDenominator(long);
+ method public android.text.style.TtsSpan.FractionBuilder setDenominator(java.lang.String);
+ method public android.text.style.TtsSpan.FractionBuilder setIntegerPart(long);
+ method public android.text.style.TtsSpan.FractionBuilder setIntegerPart(java.lang.String);
+ method public android.text.style.TtsSpan.FractionBuilder setNumerator(long);
+ method public android.text.style.TtsSpan.FractionBuilder setNumerator(java.lang.String);
+ }
+
+ public static class TtsSpan.MeasureBuilder extends android.text.style.TtsSpan.SemioticClassBuilder {
+ ctor public TtsSpan.MeasureBuilder();
+ method public android.text.style.TtsSpan.MeasureBuilder setDenominator(long);
+ method public android.text.style.TtsSpan.MeasureBuilder setDenominator(java.lang.String);
+ method public android.text.style.TtsSpan.MeasureBuilder setFractionalPart(java.lang.String);
+ method public android.text.style.TtsSpan.MeasureBuilder setIntegerPart(long);
+ method public android.text.style.TtsSpan.MeasureBuilder setIntegerPart(java.lang.String);
+ method public android.text.style.TtsSpan.MeasureBuilder setNumber(long);
+ method public android.text.style.TtsSpan.MeasureBuilder setNumber(java.lang.String);
+ method public android.text.style.TtsSpan.MeasureBuilder setNumerator(long);
+ method public android.text.style.TtsSpan.MeasureBuilder setNumerator(java.lang.String);
+ method public android.text.style.TtsSpan.MeasureBuilder setUnit(java.lang.String);
+ }
+
+ public static class TtsSpan.OrdinalBuilder extends android.text.style.TtsSpan.SemioticClassBuilder {
+ ctor public TtsSpan.OrdinalBuilder();
+ ctor public TtsSpan.OrdinalBuilder(long);
+ ctor public TtsSpan.OrdinalBuilder(java.lang.String);
+ method public android.text.style.TtsSpan.OrdinalBuilder setNumber(long);
+ method public android.text.style.TtsSpan.OrdinalBuilder setNumber(java.lang.String);
+ }
+
public static class TtsSpan.SemioticClassBuilder extends android.text.style.TtsSpan.Builder {
ctor public TtsSpan.SemioticClassBuilder(java.lang.String);
method public C setAnimacy(java.lang.String);
@@ -31272,6 +31358,19 @@
method public android.text.style.TtsSpan.TextBuilder setText(java.lang.String);
}
+ public static class TtsSpan.TimeBuilder extends android.text.style.TtsSpan.SemioticClassBuilder {
+ ctor public TtsSpan.TimeBuilder();
+ ctor public TtsSpan.TimeBuilder(int, int);
+ method public android.text.style.TtsSpan.TimeBuilder setHours(int);
+ method public android.text.style.TtsSpan.TimeBuilder setMinutes(int);
+ }
+
+ public static class TtsSpan.VerbatimBuilder extends android.text.style.TtsSpan.SemioticClassBuilder {
+ ctor public TtsSpan.VerbatimBuilder();
+ ctor public TtsSpan.VerbatimBuilder(java.lang.String);
+ method public android.text.style.TtsSpan.VerbatimBuilder setVerbatim(java.lang.String);
+ }
+
public class TypefaceSpan extends android.text.style.MetricAffectingSpan implements android.text.ParcelableSpan {
ctor public TypefaceSpan(java.lang.String);
ctor public TypefaceSpan(android.os.Parcel);
diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java
index bfe90e6..829d459 100644
--- a/core/java/android/provider/ContactsContract.java
+++ b/core/java/android/provider/ContactsContract.java
@@ -1721,16 +1721,28 @@
* Querying for social stream data requires android.permission.READ_SOCIAL_STREAM
* permission.
* </p>
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
public static final class StreamItems implements StreamItemsColumns {
/**
* no public constructor since this is a utility class
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
private StreamItems() {}
/**
* The directory twig for this sub-table
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
public static final String CONTENT_DIRECTORY = "stream_items";
}
@@ -2830,17 +2842,29 @@
* inserting or updating social stream items requires android.permission.WRITE_SOCIAL_STREAM
* permission.
* </p>
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
public static final class StreamItems implements BaseColumns, StreamItemsColumns {
/**
* No public constructor since this is a utility class
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
private StreamItems() {
}
/**
* The directory twig for this sub-table
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
public static final String CONTENT_DIRECTORY = "stream_items";
}
@@ -3255,18 +3279,30 @@
* </pre>
* </dd>
* </dl>
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
public static final class StreamItems implements BaseColumns, StreamItemsColumns {
/**
* This utility class cannot be instantiated
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
private StreamItems() {
}
/**
* The content:// style URI for this table, which handles social network stream
* updates for the user's contacts.
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "stream_items");
/**
@@ -3281,31 +3317,51 @@
* When using this URI, the stream item ID for the photo(s) must be identified
* in the {@link ContentValues} passed in.
* </p>
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
public static final Uri CONTENT_PHOTO_URI = Uri.withAppendedPath(CONTENT_URI, "photo");
/**
* This URI allows the caller to query for the maximum number of stream items
* that will be stored under any single raw contact.
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
public static final Uri CONTENT_LIMIT_URI =
Uri.withAppendedPath(AUTHORITY_URI, "stream_items_limit");
/**
* The MIME type of a directory of stream items.
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
public static final String CONTENT_TYPE = "vnd.android.cursor.dir/stream_item";
/**
* The MIME type of a single stream item.
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/stream_item";
/**
* Queries to {@link ContactsContract.StreamItems#CONTENT_LIMIT_URI} will
* contain this column, with the value indicating the maximum number of
* stream items that will be stored under any single raw contact.
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
public static final String MAX_ITEMS = "max_items";
/**
@@ -3321,28 +3377,48 @@
* requires android.permission.READ_SOCIAL_STREAM permission, and inserting or updating
* social stream photos requires android.permission.WRITE_SOCIAL_STREAM permission.
* </p>
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
public static final class StreamItemPhotos
implements BaseColumns, StreamItemPhotosColumns {
/**
* No public constructor since this is a utility class
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
private StreamItemPhotos() {
}
/**
* The directory twig for this sub-table
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
public static final String CONTENT_DIRECTORY = "photo";
/**
* The MIME type of a directory of stream item photos.
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
public static final String CONTENT_TYPE = "vnd.android.cursor.dir/stream_item_photo";
/**
* The MIME type of a single stream item photo.
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
public static final String CONTENT_ITEM_TYPE
= "vnd.android.cursor.item/stream_item_photo";
}
@@ -3352,7 +3428,10 @@
* Columns in the StreamItems table.
*
* @see ContactsContract.StreamItems
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
protected interface StreamItemsColumns {
/**
* A reference to the {@link android.provider.ContactsContract.Contacts#_ID}
@@ -3360,7 +3439,11 @@
*
* <p>Type: INTEGER</p>
* <p>read-only</p>
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
public static final String CONTACT_ID = "contact_id";
/**
@@ -3369,14 +3452,22 @@
*
* <p>Type: TEXT</p>
* <p>read-only</p>
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
public static final String CONTACT_LOOKUP_KEY = "contact_lookup";
/**
* A reference to the {@link RawContacts#_ID}
* that this stream item belongs to.
* <p>Type: INTEGER</p>
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
public static final String RAW_CONTACT_ID = "raw_contact_id";
/**
@@ -3384,7 +3475,11 @@
* this stream item. This value is only designed for use when building
* user interfaces, and should not be used to infer the owner.
* <P>Type: TEXT</P>
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
public static final String RES_PACKAGE = "res_package";
/**
@@ -3393,7 +3488,11 @@
*
* <p>Type: TEXT</p>
* <p>read-only</p>
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
public static final String ACCOUNT_TYPE = "account_type";
/**
@@ -3402,7 +3501,11 @@
*
* <p>Type: TEXT</p>
* <p>read-only</p>
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
public static final String ACCOUNT_NAME = "account_name";
/**
@@ -3413,7 +3516,11 @@
*
* <P>Type: TEXT</P>
* <p>read-only</p>
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
public static final String DATA_SET = "data_set";
/**
@@ -3422,7 +3529,11 @@
*
* <P>Type: TEXT</P>
* <p>read-only</p>
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
public static final String RAW_CONTACT_SOURCE_ID = "raw_contact_source_id";
/**
@@ -3430,7 +3541,11 @@
* This resource should be scoped by the {@link #RES_PACKAGE}. As this can only reference
* drawables, the "@drawable/" prefix must be omitted.
* <P>Type: TEXT</P>
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
public static final String RES_ICON = "icon";
/**
@@ -3438,7 +3553,11 @@
* Talk". This resource should be scoped by the {@link #RES_PACKAGE}. As this can only
* reference strings, the "@string/" prefix must be omitted.
* <p>Type: TEXT</p>
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
public static final String RES_LABEL = "label";
/**
@@ -3455,14 +3574,22 @@
* is unspecified, but it should not break tags.
* </P>
* <P>Type: TEXT</P>
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
public static final String TEXT = "text";
/**
* The absolute time (milliseconds since epoch) when this stream item was
* inserted/updated.
* <P>Type: NUMBER</P>
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
public static final String TIMESTAMP = "timestamp";
/**
@@ -3480,16 +3607,44 @@
* is unspecified, but it should not break tags.
* </P>
* <P>Type: TEXT</P>
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
public static final String COMMENTS = "comments";
- /** Generic column for use by sync adapters. */
+ /**
+ * Generic column for use by sync adapters.
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
+ */
+ @Deprecated
public static final String SYNC1 = "stream_item_sync1";
- /** Generic column for use by sync adapters. */
+ /**
+ * Generic column for use by sync adapters.
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
+ */
+ @Deprecated
public static final String SYNC2 = "stream_item_sync2";
- /** Generic column for use by sync adapters. */
+ /**
+ * Generic column for use by sync adapters.
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
+ */
+ @Deprecated
public static final String SYNC3 = "stream_item_sync3";
- /** Generic column for use by sync adapters. */
+ /**
+ * Generic column for use by sync adapters.
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
+ */
+ @Deprecated
public static final String SYNC4 = "stream_item_sync4";
}
@@ -3662,11 +3817,19 @@
* <pre>
* </dd>
* </dl>
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
public static final class StreamItemPhotos implements BaseColumns, StreamItemPhotosColumns {
/**
* No public constructor since this is a utility class
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
private StreamItemPhotos() {
}
@@ -3681,7 +3844,11 @@
* as an asset file.
* </p>
* <P>Type: BLOB</P>
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
public static final String PHOTO = "photo";
}
@@ -3689,42 +3856,85 @@
* Columns in the StreamItemPhotos table.
*
* @see ContactsContract.StreamItemPhotos
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
protected interface StreamItemPhotosColumns {
/**
* A reference to the {@link StreamItems#_ID} this photo is associated with.
* <P>Type: NUMBER</P>
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
public static final String STREAM_ITEM_ID = "stream_item_id";
/**
* An integer to use for sort order for photos in the stream item. If not
* specified, the {@link StreamItemPhotos#_ID} will be used for sorting.
* <P>Type: NUMBER</P>
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
public static final String SORT_INDEX = "sort_index";
/**
* Photo file ID for the photo.
* See {@link ContactsContract.DisplayPhoto}.
* <P>Type: NUMBER</P>
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
public static final String PHOTO_FILE_ID = "photo_file_id";
/**
* URI for retrieving the photo content, automatically populated. Callers
* may retrieve the photo content by opening this URI as an asset file.
* <P>Type: TEXT</P>
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
*/
+ @Deprecated
public static final String PHOTO_URI = "photo_uri";
- /** Generic column for use by sync adapters. */
+ /**
+ * Generic column for use by sync adapters.
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
+ */
+ @Deprecated
public static final String SYNC1 = "stream_item_photo_sync1";
- /** Generic column for use by sync adapters. */
+ /**
+ * Generic column for use by sync adapters.
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
+ */
+ @Deprecated
public static final String SYNC2 = "stream_item_photo_sync2";
- /** Generic column for use by sync adapters. */
+ /**
+ * Generic column for use by sync adapters.
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
+ */
+ @Deprecated
public static final String SYNC3 = "stream_item_photo_sync3";
- /** Generic column for use by sync adapters. */
+ /**
+ * Generic column for use by sync adapters.
+ *
+ * @deprecated - Do not use. This will not be supported in the future. In the future,
+ * cursors returned from related queries will be empty.
+ */
+ @Deprecated
public static final String SYNC4 = "stream_item_photo_sync4";
}
diff --git a/core/java/android/text/style/TtsSpan.java b/core/java/android/text/style/TtsSpan.java
index 3ab3b31..04159af 100644
--- a/core/java/android/text/style/TtsSpan.java
+++ b/core/java/android/text/style/TtsSpan.java
@@ -16,6 +16,9 @@
package android.text.style;
+import java.text.NumberFormat;
+import java.util.Locale;
+
import android.os.Parcel;
import android.os.PersistableBundle;
import android.text.ParcelableSpan;
@@ -228,7 +231,8 @@
/**
* Argument used to specify the integer part of a decimal or fraction. The
- * value can be a string of digits of any size optionally prefixed with a - or +.
+ * value can be a string of digits of any size optionally prefixed with
+ * a - or +.
* Can be used with {@link #TYPE_DECIMAL} and {@link #TYPE_FRACTION}.
*/
public static final String ARG_INTEGER_PART = "android.arg.integer_part";
@@ -308,9 +312,10 @@
/**
* Argument used to specify the month of a date. The value should be
* provided as an integer and can be any of {@link #MONTH_JANUARY},
- * {@link #MONTH_FEBRUARY}, {@link #MONTH_MARCH}, {@link #MONTH_APRIL}, {@link #MONTH_MAY},
- * {@link #MONTH_JUNE}, {@link #MONTH_JULY}, {@link #MONTH_AUGUST}, {@link #MONTH_SEPTEMBER},
- * {@link #MONTH_OCTOBER}, {@link #MONTH_NOVEMBER} and {@link #MONTH_DECEMBER}.
+ * {@link #MONTH_FEBRUARY}, {@link #MONTH_MARCH}, {@link #MONTH_APRIL},
+ * {@link #MONTH_MAY}, {@link #MONTH_JUNE}, {@link #MONTH_JULY},
+ * {@link #MONTH_AUGUST}, {@link #MONTH_SEPTEMBER}, {@link #MONTH_OCTOBER},
+ * {@link #MONTH_NOVEMBER} and {@link #MONTH_DECEMBER}.
* Can be used with {@link #TYPE_DATE}.
*/
public static final String ARG_MONTH = "android.arg.month";
@@ -344,7 +349,8 @@
/**
* Argument used to specify the main number part of a telephone number. Can
- * be a string of digits.
+ * be a string of digits where the different parts of the telephone number
+ * can be separated with a space, '-', '/' or '.'.
* Can be used with {@link #TYPE_TELEPHONE}.
*/
public static final String ARG_NUMBER_PART = "android.arg.number_part";
@@ -473,8 +479,8 @@
* this builder like {@link TtsSpan.TextBuilder} and
* {@link TtsSpan.CardinalBuilder} are likely more useful.
*
- * This class uses generics so methods from this class can return instances of
- * its child classes, resulting in a fluent API (CRTP pattern).
+ * This class uses generics so methods from this class can return instances
+ * of its child classes, resulting in a fluent API (CRTP pattern).
*/
public static abstract class Builder<C extends Builder<C>> {
// Holds the type of this class.
@@ -597,7 +603,7 @@
public static class TextBuilder extends SemioticClassBuilder<TextBuilder> {
/**
- * Creates a TtsSpan of type {@link TtsSpan#TYPE_TEXT}.
+ * Creates a builder for a TtsSpan of type {@link TtsSpan#TYPE_TEXT}.
*/
public TextBuilder() {
super(TtsSpan.TYPE_TEXT);
@@ -628,10 +634,12 @@
/**
* A builder for TtsSpans of type {@link TtsSpan #TYPE_CARDINAL}.
*/
- public static class CardinalBuilder extends SemioticClassBuilder<CardinalBuilder> {
+ public static class CardinalBuilder
+ extends SemioticClassBuilder<CardinalBuilder> {
/**
- * Creates a TtsSpan of type {@link TtsSpan#TYPE_CARDINAL}.
+ * Creates a builder for a TtsSpan of type
+ * {@link TtsSpan#TYPE_CARDINAL}.
*/
public CardinalBuilder() {
super(TtsSpan.TYPE_CARDINAL);
@@ -679,4 +687,570 @@
return setStringArgument(TtsSpan.ARG_NUMBER, number);
}
}
+
+ /**
+ * A builder for TtsSpans of type {@link TtsSpan#TYPE_ORDINAL}.
+ */
+ public static class OrdinalBuilder
+ extends SemioticClassBuilder<OrdinalBuilder> {
+
+ /**
+ * Creates a builder for a TtsSpan of type {@link TtsSpan#TYPE_ORDINAL}.
+ */
+ public OrdinalBuilder() {
+ super(TtsSpan.TYPE_ORDINAL);
+ }
+
+ /**
+ * Creates a TtsSpan of type {@link TtsSpan#TYPE_ORDINAL} and sets the
+ * {@link TtsSpan#ARG_NUMBER} argument.
+ * @param number The ordinal number to synthesize.
+ * @see #setNumber(long)
+ */
+ public OrdinalBuilder(long number) {
+ this();
+ setNumber(number);
+ }
+
+ /**
+ * Creates a TtsSpan of type {@link TtsSpan#TYPE_ORDINAL} and sets the
+ * {@link TtsSpan#ARG_NUMBER} argument.
+ * @param number The number to synthesize.
+ * @see #setNumber(String)
+ */
+ public OrdinalBuilder(String number) {
+ this();
+ setNumber(number);
+ }
+
+ /**
+ * Convenience method that converts the number to a String and sets it
+ * to the value for {@link TtsSpan#ARG_NUMBER}.
+ * @param number The ordinal number that will be synthesized.
+ * @return This instance.
+ */
+ public OrdinalBuilder setNumber(long number) {
+ return setNumber(String.valueOf(number));
+ }
+
+ /**
+ * Sets the {@link TtsSpan#ARG_NUMBER} argument.
+ * @param number A non-empty string of digits with an optional
+ * leading + or -.
+ * @return This instance.
+ */
+ public OrdinalBuilder setNumber(String number) {
+ return setStringArgument(TtsSpan.ARG_NUMBER, number);
+ }
+ }
+
+ /**
+ * A builder for TtsSpans of type {@link TtsSpan#TYPE_DECIMAL}.
+ */
+ public static class DecimalBuilder
+ extends SemioticClassBuilder<DecimalBuilder> {
+
+ /**
+ * Creates a builder for a TtsSpan of type {@link TtsSpan#TYPE_DECIMAL}.
+ */
+ public DecimalBuilder() {
+ super(TtsSpan.TYPE_DECIMAL);
+ }
+
+ /**
+ * Creates a TtsSpan of type {@link TtsSpan#TYPE_DECIMAL} and sets the
+ * {@link TtsSpan#ARG_INTEGER_PART} and
+ * {@link TtsSpan#ARG_FRACTIONAL_PART} arguments.
+ * @see {@link #setArgumentsFromDouble(double, int, int)
+ */
+ public DecimalBuilder(double number,
+ int minimumFractionDigits,
+ int maximumFractionDigits) {
+ this();
+ setArgumentsFromDouble(number,
+ minimumFractionDigits,
+ maximumFractionDigits);
+ }
+
+ /**
+ * Creates a TtsSpan of type {@link TtsSpan#TYPE_DECIMAL} and sets the
+ * {@link TtsSpan#ARG_INTEGER_PART} and
+ * {@link TtsSpan#ARG_FRACTIONAL_PART} arguments.
+ */
+ public DecimalBuilder(String integerPart, String fractionalPart) {
+ this();
+ setIntegerPart(integerPart);
+ setFractionalPart(fractionalPart);
+ }
+
+ /**
+ * Convenience method takes a double and a maximum number of fractional
+ * digits, it sets the {@link TtsSpan#ARG_INTEGER_PART} and
+ * {@link TtsSpan#ARG_FRACTIONAL_PART} arguments.
+ * @param number The number to be synthesized.
+ * @param minimumFractionDigits The minimum number of fraction digits
+ * that are pronounced.
+ * @param maximumFractionDigits The maximum number of fraction digits
+ * that are pronounced. If maximumFractionDigits <
+ * minimumFractionDigits then minimumFractionDigits will be assumed
+ * to be equal to maximumFractionDigits.
+ * @return This instance.
+ */
+ public DecimalBuilder setArgumentsFromDouble(
+ double number,
+ int minimumFractionDigits,
+ int maximumFractionDigits) {
+ // Format double.
+ NumberFormat formatter = NumberFormat.getInstance(Locale.US);
+ formatter.setMinimumFractionDigits(maximumFractionDigits);
+ formatter.setMaximumFractionDigits(maximumFractionDigits);
+ formatter.setGroupingUsed(false);
+ String str = formatter.format(number);
+
+ // Split at decimal point.
+ int i = str.indexOf('.');
+ if (i >= 0) {
+ setIntegerPart(str.substring(0, i));
+ setFractionalPart(str.substring(i + 1));
+ } else {
+ setIntegerPart(str);
+ }
+ return this;
+ }
+
+ /**
+ * Convenience method that converts the number to a String and sets it
+ * to the value for {@link TtsSpan#ARG_INTEGER_PART}.
+ * @param integerPart The integer part of the decimal.
+ * @return This instance.
+ */
+ public DecimalBuilder setIntegerPart(long integerPart) {
+ return setIntegerPart(String.valueOf(integerPart));
+ }
+
+ /**
+ * Sets the {@link TtsSpan#ARG_INTEGER_PART} argument.
+ * @param integerPart A non-empty string of digits with an optional
+ * leading + or -.
+ * @return This instance.
+ */
+ public DecimalBuilder setIntegerPart(String integerPart) {
+ return setStringArgument(TtsSpan.ARG_INTEGER_PART, integerPart);
+ }
+
+ /**
+ * Sets the {@link TtsSpan#ARG_FRACTIONAL_PART} argument.
+ * @param fractionalPart A non-empty string of digits.
+ * @return This instance.
+ */
+ public DecimalBuilder setFractionalPart(String fractionalPart) {
+ return setStringArgument(TtsSpan.ARG_FRACTIONAL_PART,
+ fractionalPart);
+ }
+ }
+
+ /**
+ * A builder for TtsSpans of type {@link TtsSpan#TYPE_FRACTION}.
+ */
+ public static class FractionBuilder
+ extends SemioticClassBuilder<FractionBuilder> {
+
+ /**
+ * Creates a builder for a TtsSpan of type
+ * {@link TtsSpan#TYPE_FRACTION}.
+ */
+ public FractionBuilder() {
+ super(TtsSpan.TYPE_FRACTION);
+ }
+
+ /**
+ * Creates a TtsSpan of type {@link TtsSpan#TYPE_FRACTION} and sets the
+ * {@link TtsSpan#ARG_INTEGER_PART}, {@link TtsSpan#ARG_NUMERATOR}, and
+ * {@link TtsSpan#ARG_DENOMINATOR} arguments.
+ */
+ public FractionBuilder(long integerPart,
+ long numerator,
+ long denominator) {
+ this();
+ setIntegerPart(integerPart);
+ setNumerator(numerator);
+ setDenominator(denominator);
+ }
+
+
+ /**
+ * Convenience method that converts the integer to a String and sets the
+ * argument {@link TtsSpan#ARG_NUMBER}.
+ * @param integerPart The integer part.
+ * @return This instance.
+ */
+ public FractionBuilder setIntegerPart(long integerPart) {
+ return setIntegerPart(String.valueOf(integerPart));
+ }
+
+ /**
+ * Sets the {@link TtsSpan#ARG_INTEGER_PART} argument.
+ * @param integerPart A non-empty string of digits with an optional
+ * leading + or -.
+ * @return This instance.
+ */
+ public FractionBuilder setIntegerPart(String integerPart) {
+ return setStringArgument(TtsSpan.ARG_INTEGER_PART, integerPart);
+ }
+
+ /**
+ * Convenience method that converts the numerator to a String and sets
+ * the argument {@link TtsSpan#ARG_NUMERATOR}.
+ * @param numerator The numerator.
+ * @return This instance.
+ */
+ public FractionBuilder setNumerator(long numerator) {
+ return setNumerator(String.valueOf(numerator));
+ }
+
+ /**
+ * Sets the {@link TtsSpan#ARG_NUMERATOR} argument.
+ * @param numerator A non-empty string of digits with an optional
+ * leading + or -.
+ * @return This instance.
+ */
+ public FractionBuilder setNumerator(String numerator) {
+ return setStringArgument(TtsSpan.ARG_NUMERATOR, numerator);
+ }
+
+ /**
+ * Convenience method that converts the denominator to a String and sets
+ * the argument {@link TtsSpan#ARG_DENOMINATOR}.
+ * @param denominator The denominator.
+ * @return This instance.
+ */
+ public FractionBuilder setDenominator(long denominator) {
+ return setDenominator(String.valueOf(denominator));
+ }
+
+ /**
+ * Sets the {@link TtsSpan#ARG_DENOMINATOR} argument.
+ * @param denominator A non-empty string of digits with an optional
+ * leading + or -.
+ * @return This instance.
+ */
+ public FractionBuilder setDenominator(String denominator) {
+ return setStringArgument(TtsSpan.ARG_DENOMINATOR, denominator);
+ }
+ }
+
+ /**
+ * A builder for TtsSpans of type {@link TtsSpan #TYPE_MEASURE}.
+ */
+ public static class MeasureBuilder
+ extends SemioticClassBuilder<MeasureBuilder> {
+
+ /**
+ * Creates a builder for a TtsSpan of type {@link TtsSpan#TYPE_MEASURE}.
+ */
+ public MeasureBuilder() {
+ super(TtsSpan.TYPE_MEASURE);
+ }
+
+ /**
+ * Convenience method that converts the number to a String and set it to
+ * the value for {@link TtsSpan#ARG_NUMBER}.
+ * @param number The amount of the measure.
+ * @return This instance.
+ */
+ public MeasureBuilder setNumber(long number) {
+ return setNumber(String.valueOf(number));
+ }
+
+ /**
+ * Sets the {@link TtsSpan#ARG_NUMBER} argument.
+ * @param number A non-empty string of digits with an optional
+ * leading + or -.
+ * @return This instance.
+ */
+ public MeasureBuilder setNumber(String number) {
+ return setStringArgument(TtsSpan.ARG_NUMBER, number);
+ }
+
+ /**
+ * Convenience method that converts the integer part to a String and set
+ * it to the value for {@link TtsSpan#ARG_INTEGER_PART}.
+ * @param integerPart The integer part of a decimal or fraction.
+ * @return This instance.
+ */
+ public MeasureBuilder setIntegerPart(long integerPart) {
+ return setNumber(String.valueOf(integerPart));
+ }
+
+ /**
+ * Sets the {@link TtsSpan#ARG_INTEGER_PART} argument.
+ * @param integerPart The integer part of a decimal or fraction; a
+ * non-empty string of digits with an optional
+ * leading + or -.
+ * @return This instance.
+ */
+ public MeasureBuilder setIntegerPart(String integerPart) {
+ return setStringArgument(TtsSpan.ARG_INTEGER_PART, integerPart);
+ }
+
+ /**
+ * Sets the {@link TtsSpan#ARG_FRACTIONAL_PART} argument.
+ * @param fractionalPart The fractional part of a decimal; a non-empty
+ * string of digits with an optional
+ * leading + or -.
+ * @return This instance.
+ */
+ public MeasureBuilder setFractionalPart(String fractionalPart) {
+ return setStringArgument(TtsSpan.ARG_FRACTIONAL_PART,
+ fractionalPart);
+ }
+
+ /**
+ * Convenience method that converts the numerator to a String and set it
+ * to the value for {@link TtsSpan#ARG_NUMERATOR}.
+ * @param numerator The numerator of a fraction.
+ * @return This instance.
+ */
+ public MeasureBuilder setNumerator(long numerator) {
+ return setNumerator(String.valueOf(numerator));
+ }
+
+ /**
+ * Sets the {@link TtsSpan#ARG_NUMERATOR} argument.
+ * @param numerator The numerator of a fraction; a non-empty string of
+ * digits with an optional leading + or -.
+ * @return This instance.
+ */
+ public MeasureBuilder setNumerator(String numerator) {
+ return setStringArgument(TtsSpan.ARG_NUMERATOR, numerator);
+ }
+
+ /**
+ * Convenience method that converts the denominator to a String and set
+ * it to the value for {@link TtsSpan#ARG_DENOMINATOR}.
+ * @param denominator The denominator of a fraction.
+ * @return This instance.
+ */
+ public MeasureBuilder setDenominator(long denominator) {
+ return setDenominator(String.valueOf(denominator));
+ }
+
+ /**
+ * Sets the {@link TtsSpan#ARG_DENOMINATOR} argument.
+ * @param denominator The denominator of a fraction; a non-empty string
+ * of digits with an optional leading + or -.
+ * @return This instance.
+ */
+ public MeasureBuilder setDenominator(String denominator) {
+ return setStringArgument(TtsSpan.ARG_DENOMINATOR, denominator);
+ }
+
+ /**
+ * Sets the {@link TtsSpan#ARG_UNIT} argument.
+ * @param unit The unit of the measure.
+ * @return This instance.
+ * @see {@link TtsSpan.ARG_UNIT}
+ */
+ public MeasureBuilder setUnit(String unit) {
+ return setStringArgument(TtsSpan.ARG_UNIT, unit);
+ }
+ }
+
+ /**
+ * A builder for TtsSpans of type {@link TtsSpan #TYPE_TIME}.
+ */
+ public static class TimeBuilder
+ extends SemioticClassBuilder<TimeBuilder> {
+
+ /**
+ * Creates a builder for a TtsSpan of type {@link TtsSpan#TYPE_TIME}.
+ */
+ public TimeBuilder() {
+ super(TtsSpan.TYPE_TIME);
+ }
+
+ /**
+ * Creates a builder for a TtsSpan of type {@link TtsSpan#TYPE_TIME} and
+ * sets the {@link TtsSpan#ARG_HOURS} and {@link TtsSpan#ARG_MINUTES}
+ * arguments.
+ */
+ public TimeBuilder(int hours, int minutes) {
+ this();
+ setHours(hours);
+ setMinutes(minutes);
+ }
+
+ /**
+ * Sets the {@link TtsSpan#ARG_HOURS} argument.
+ * @param hours The value to be set for hours. See
+ * {@link TtsSpan#ARG_HOURS}.
+ * @return This instance.
+ * @see {@link TtsSpan#ARG_HOURS}
+ */
+ public TimeBuilder setHours(int hours) {
+ return setIntArgument(TtsSpan.ARG_HOURS, hours);
+ }
+
+ /**
+ * Sets the {@link TtsSpan#ARG_MINUTES} argument.
+ * @param minutes The value to be set for minutes. See
+ * {@link TtsSpan#ARG_MINUTES}.
+ * @return This instance.
+ * @see {@link TtsSpan#ARG_MINUTES}
+ */
+ public TimeBuilder setMinutes(int minutes) {
+ return setIntArgument(TtsSpan.ARG_MINUTES, minutes);
+ }
+ }
+
+ /**
+ * A builder for TtsSpans of type {@link TtsSpan #TYPE_DATE}.
+ */
+ public static class DateBuilder
+ extends SemioticClassBuilder<DateBuilder> {
+
+ /**
+ * Creates a builder for a TtsSpan of type {@link TtsSpan#TYPE_DATE}.
+ */
+ public DateBuilder() {
+ super(TtsSpan.TYPE_DATE);
+ }
+
+ /**
+ * Creates a builder for a TtsSpan of type {@link TtsSpan#TYPE_TIME} and
+ * possibly sets the {@link TtsSpan#ARG_WEEKDAY},
+ * {@link TtsSpan#ARG_DAY}, {@link TtsSpan#ARG_MONTH} and
+ * {@link TtsSpan#ARG_YEAR} arguments. Pass null to any argument to
+ * leave it unset.
+ */
+ public DateBuilder(Integer weekday,
+ Integer day,
+ Integer month,
+ Integer year) {
+ this();
+ if (weekday != null) {
+ setWeekday(weekday);
+ }
+ if (day != null) {
+ setDay(day);
+ }
+ if (month != null) {
+ setMonth(month);
+ }
+ if (year != null) {
+ setYear(year);
+ }
+ }
+
+ /**
+ * Sets the {@link TtsSpan#ARG_WEEKDAY} argument.
+ * @param weekday The value to be set for weekday. See
+ * {@link TtsSpan#ARG_WEEKDAY}.
+ * @return This instance.
+ * @see {@link TtsSpan#ARG_WEEKDAY}
+ */
+ public DateBuilder setWeekday(int weekday) {
+ return setIntArgument(TtsSpan.ARG_WEEKDAY, weekday);
+ }
+
+ /**
+ * Sets the {@link TtsSpan#ARG_DAY} argument.
+ * @param day The value to be set for day. See
+ * {@link TtsSpan#ARG_DAY}.
+ * @return This instance.
+ * @see {@link TtsSpan#ARG_DAY}
+ */
+ public DateBuilder setDay(int day) {
+ return setIntArgument(TtsSpan.ARG_DAY, day);
+ }
+
+ /**
+ * Sets the {@link TtsSpan#ARG_MONTH} argument.
+ * @param month The value to be set for month. See
+ * {@link TtsSpan#ARG_MONTH}.
+ * @return This instance.
+ * @see {@link TtsSpan#ARG_MONTH}
+ */
+ public DateBuilder setMonth(int month) {
+ return setIntArgument(TtsSpan.ARG_MONTH, month);
+ }
+
+ /**
+ * Sets the {@link TtsSpan#ARG_YEAR} argument.
+ * @param year The value to be set for year. See
+ * {@link TtsSpan#ARG_YEAR}.
+ * @return This instance.
+ * @see {@link TtsSpan#ARG_YEAR}
+ */
+ public DateBuilder setYear(int year) {
+ return setIntArgument(TtsSpan.ARG_YEAR, year);
+ }
+ }
+
+ /**
+ * A builder for TtsSpans of type {@link TtsSpan #TYPE_DIGITS}.
+ */
+ public static class DigitsBuilder
+ extends SemioticClassBuilder<DigitsBuilder> {
+
+ /**
+ * Creates a builder for a TtsSpan of type
+ * {@link TtsSpan#TYPE_VERBATIM}.
+ */
+ public DigitsBuilder() {
+ super(TtsSpan.TYPE_DIGITS);
+ }
+
+ /**
+ * Creates a builder for a TtsSpan of type {@link TtsSpan#TYPE_DIGITS}
+ * and sets the {@link TtsSpan#ARG_DIGITS} argument.
+ */
+ public DigitsBuilder(String digits) {
+ this();
+ setDigits(digits);
+ }
+
+ /**
+ * Sets the {@link TtsSpan#ARG_DIGITS} argument.
+ * @param digits A string of digits.
+ * @return This instance.
+ */
+ public DigitsBuilder setDigits(String digits) {
+ return setStringArgument(TtsSpan.ARG_DIGITS, digits);
+ }
+ }
+
+ /**
+ * A builder for TtsSpans of type {@link TtsSpan #TYPE_VERBATIM}.
+ */
+ public static class VerbatimBuilder
+ extends SemioticClassBuilder<VerbatimBuilder> {
+
+ /**
+ * Creates a builder for a TtsSpan of type
+ * {@link TtsSpan#TYPE_VERBATIM}.
+ */
+ public VerbatimBuilder() {
+ super(TtsSpan.TYPE_VERBATIM);
+ }
+
+ /**
+ * Creates a builder for a TtsSpan of type {@link TtsSpan#TYPE_VERBATIM}
+ * and sets the {@link TtsSpan#ARG_VERBATIM} argument.
+ */
+ public VerbatimBuilder(String verbatim) {
+ this();
+ setVerbatim(verbatim);
+ }
+
+ /**
+ * Sets the {@link TtsSpan#ARG_VERBATIM} argument.
+ * @param verbatim A string of characters that will be read verbatim,
+ * except whitespace.
+ * @return This instance.
+ */
+ public VerbatimBuilder setVerbatim(String verbatim) {
+ return setStringArgument(TtsSpan.ARG_VERBATIM, verbatim);
+ }
+ }
}
diff --git a/core/java/android/view/textservice/TextServicesManager.java b/core/java/android/view/textservice/TextServicesManager.java
index e0e19b9..89d879e 100644
--- a/core/java/android/view/textservice/TextServicesManager.java
+++ b/core/java/android/view/textservice/TextServicesManager.java
@@ -90,6 +90,18 @@
}
/**
+ * Returns the language component of a given locale string.
+ */
+ private static String parseLanguageFromLocaleString(String locale) {
+ final int idx = locale.indexOf('_');
+ if (idx < 0) {
+ return locale;
+ } else {
+ return locale.substring(0, idx);
+ }
+ }
+
+ /**
* Get a spell checker session for the specified spell checker
* @param locale the locale for the spell checker. If {@code locale} is null and
* referToSpellCheckerLanguageSettings is true, the locale specified in Settings will be
@@ -134,9 +146,8 @@
}
if (locale != null) {
final String subtypeLocale = subtypeInUse.getLocale();
- final String inputLocale = locale.toString();
- if (subtypeLocale.length() < 2 || inputLocale.length() < 2
- || !subtypeLocale.substring(0, 2).equals(inputLocale.substring(0, 2))) {
+ final String subtypeLanguage = parseLanguageFromLocaleString(subtypeLocale);
+ if (subtypeLanguage.length() < 2 || !locale.getLanguage().equals(subtypeLanguage)) {
return null;
}
}
@@ -145,11 +156,12 @@
for (int i = 0; i < sci.getSubtypeCount(); ++i) {
final SpellCheckerSubtype subtype = sci.getSubtypeAt(i);
final String tempSubtypeLocale = subtype.getLocale();
+ final String tempSubtypeLanguage = parseLanguageFromLocaleString(tempSubtypeLocale);
if (tempSubtypeLocale.equals(localeStr)) {
subtypeInUse = subtype;
break;
- } else if (localeStr.length() >= 2 && tempSubtypeLocale.length() >= 2
- && localeStr.startsWith(tempSubtypeLocale)) {
+ } else if (tempSubtypeLanguage.length() >= 2 &&
+ locale.getLanguage().equals(tempSubtypeLanguage)) {
subtypeInUse = subtype;
}
}
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 2b313b3..ba65d63 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -481,7 +481,9 @@
android:label="@string/permlab_writeCallLog"
android:description="@string/permdesc_writeCallLog" />
- <!-- Allows an application to read from the user's social stream. -->
+ <!-- Allows an application to read from the user's social stream.
+ @deprecated This functionality will be unsupported in the future; cursors returned
+ will be empty. Please do not use. -->
<permission android:name="android.permission.READ_SOCIAL_STREAM"
android:permissionGroup="android.permission-group.SOCIAL_INFO"
android:protectionLevel="dangerous"
@@ -489,7 +491,9 @@
android:description="@string/permdesc_readSocialStream" />
<!-- Allows an application to write (but not read) the user's
- social stream data. -->
+ social stream data.
+ @deprecated This functionality will be unsupported in the future; cursors returned
+ will be empty. Please do not use. -->
<permission android:name="android.permission.WRITE_SOCIAL_STREAM"
android:permissionGroup="android.permission-group.SOCIAL_INFO"
android:protectionLevel="dangerous"
diff --git a/media/java/android/media/AudioDevice.java b/media/java/android/media/AudioDevice.java
index 96d6196..e078354 100644
--- a/media/java/android/media/AudioDevice.java
+++ b/media/java/android/media/AudioDevice.java
@@ -19,30 +19,91 @@
import android.util.SparseIntArray;
/**
- * @hide
- * CANDIDATE FOR PUBLIC API
+ * Class to provide information about the audio devices.
*/
public class AudioDevice {
+ /**
+ * A device type associated with an unknown or uninitialized device.
+ */
public static final int DEVICE_TYPE_UNKNOWN = 0;
+ /**
+ * A device type describing the attached earphone speaker.
+ */
public static final int DEVICE_TYPE_BUILTIN_EARPIECE = 1;
+ /**
+ * A device type describing the speaker system (i.e. a mono speaker or stereo speakers) built
+ * in a device.
+ */
public static final int DEVICE_TYPE_BUILTIN_SPEAKER = 2;
+ /**
+ * A device type describing a headset, which is the combination of a headphones and microphone.
+ */
public static final int DEVICE_TYPE_WIRED_HEADSET = 3;
+ /**
+ * A device type describing a pair of wired headphones .
+ */
public static final int DEVICE_TYPE_WIRED_HEADPHONES = 4;
+ /**
+ * A device type describing an analog line-level connection.
+ */
public static final int DEVICE_TYPE_LINE_ANALOG = 5;
+ /**
+ * A device type describing a digital line connection (e.g. SPDIF).
+ */
public static final int DEVICE_TYPE_LINE_DIGITAL = 6;
+ /**
+ * A device type describing a Bluetooth device typically used for telephony .
+ */
public static final int DEVICE_TYPE_BLUETOOTH_SCO = 7;
+ /**
+ * A device type describing a Bluetooth device supporting the A2DP profile.
+ */
public static final int DEVICE_TYPE_BLUETOOTH_A2DP = 8;
+ /**
+ * A device type describing an HDMI connection .
+ */
public static final int DEVICE_TYPE_HDMI = 9;
+ /**
+ * A device type describing the Audio Return Channel of an HDMI connection.
+ */
public static final int DEVICE_TYPE_HDMI_ARC = 10;
+ /**
+ * A device type describing a USB audio device.
+ */
public static final int DEVICE_TYPE_USB_DEVICE = 11;
+ /**
+ * A device type describing a USB audio device in accessory mode.
+ */
public static final int DEVICE_TYPE_USB_ACCESSORY = 12;
+ /**
+ * A device type describing the audio device associated with a dock.
+ */
public static final int DEVICE_TYPE_DOCK = 13;
+ /**
+ * A device type associated with the transmission of audio signals over FM.
+ */
public static final int DEVICE_TYPE_FM = 14;
+ /**
+ * A device type describing the microphone(s) built in a device.
+ */
public static final int DEVICE_TYPE_BUILTIN_MIC = 15;
+ /**
+ * A device type for accessing the audio content transmitted over FM.
+ */
public static final int DEVICE_TYPE_FM_TUNER = 16;
+ /**
+ * A device type for accessing the audio content transmitted over the TV tuner system.
+ */
public static final int DEVICE_TYPE_TV_TUNER = 17;
+ /**
+ * A device type describing the transmission of audio signals over the telephony network.
+ */
public static final int DEVICE_TYPE_TELEPHONY = 18;
+ /**
+ * A device type describing the auxiliary line-level connectors.
+ */
+ public static final int DEVICE_TYPE_AUX_LINE = 19;
AudioDevicePortConfig mConfig;
@@ -50,18 +111,38 @@
mConfig = new AudioDevicePortConfig(config);
}
+ /**
+ * @hide
+ * CANDIDATE FOR PUBLIC API
+ * @return
+ */
public boolean isInputDevice() {
return (mConfig.port().role() == AudioPort.ROLE_SOURCE);
}
+ /**
+ * @hide
+ * CANDIDATE FOR PUBLIC API
+ * @return
+ */
public boolean isOutputDevice() {
return (mConfig.port().role() == AudioPort.ROLE_SINK);
}
+ /**
+ * @hide
+ * CANDIDATE FOR PUBLIC API
+ * @return
+ */
public int getDeviceType() {
return INT_TO_EXT_DEVICE_MAPPING.get(mConfig.port().type(), DEVICE_TYPE_UNKNOWN);
}
+ /**
+ * @hide
+ * CANDIDATE FOR PUBLIC API
+ * @return
+ */
public String getAddress() {
return mConfig.port().address();
}
@@ -102,6 +183,7 @@
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_HDMI_ARC, DEVICE_TYPE_HDMI_ARC);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_SPDIF, DEVICE_TYPE_LINE_DIGITAL);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_FM, DEVICE_TYPE_FM);
+ INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_AUX_LINE, DEVICE_TYPE_AUX_LINE);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_BUILTIN_MIC, DEVICE_TYPE_BUILTIN_MIC);
INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_BLUETOOTH_SCO_HEADSET, DEVICE_TYPE_BLUETOOTH_SCO);
@@ -143,6 +225,7 @@
EXT_TO_INT_DEVICE_MAPPING.put(DEVICE_TYPE_FM_TUNER, AudioSystem.DEVICE_IN_FM_TUNER);
EXT_TO_INT_DEVICE_MAPPING.put(DEVICE_TYPE_TV_TUNER, AudioSystem.DEVICE_IN_TV_TUNER);
EXT_TO_INT_DEVICE_MAPPING.put(DEVICE_TYPE_TELEPHONY, AudioSystem.DEVICE_OUT_TELEPHONY_TX);
+ EXT_TO_INT_DEVICE_MAPPING.put(DEVICE_TYPE_AUX_LINE, AudioSystem.DEVICE_OUT_AUX_LINE);
}
}
diff --git a/media/java/android/media/audiofx/Virtualizer.java b/media/java/android/media/audiofx/Virtualizer.java
index 136761b..78eeccb 100644
--- a/media/java/android/media/audiofx/Virtualizer.java
+++ b/media/java/android/media/audiofx/Virtualizer.java
@@ -248,8 +248,6 @@
}
/**
- * @hide
- * CANDIDATE FOR PUBLIC API
* Checks if the combination of a channel mask and device type is supported by this virtualizer.
* Some virtualizer implementations may only support binaural processing (i.e. only support
* headphone output), some may support transaural processing (i.e. for speaker output) for the
@@ -276,8 +274,6 @@
}
/**
- * @hide
- * CANDIDATE FOR PUBLIC API
* Queries the virtual speaker angles (azimuth and elevation) for a combination of a channel
* mask and device type.
* If the virtualization configuration (mask and device) is supported (see
@@ -318,8 +314,6 @@
}
/**
- * @hide
- * CANDIDATE FOR PUBLIC API
* Forces the virtualizer effect to use the processing mode used for the given device type.
* The effect must be enabled for the forced mode to be applied.
* @param deviceType one of the device types defined in {@link AudioDevice}.
diff --git a/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java b/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java
index 2c1db02..09525b2 100644
--- a/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java
+++ b/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java
@@ -97,6 +97,16 @@
}
@Override
+ public void onBackPressed() {
+ WebView myWebView = (WebView) findViewById(R.id.webview);
+ if (myWebView.canGoBack()) {
+ myWebView.goBack();
+ } else {
+ super.onBackPressed();
+ }
+ }
+
+ @Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.action_use_network) {
diff --git a/packages/PrintSpooler/src/com/android/printspooler/ui/PrintPreviewController.java b/packages/PrintSpooler/src/com/android/printspooler/ui/PrintPreviewController.java
index ce47b3e..4a23ec4 100644
--- a/packages/PrintSpooler/src/com/android/printspooler/ui/PrintPreviewController.java
+++ b/packages/PrintSpooler/src/com/android/printspooler/ui/PrintPreviewController.java
@@ -311,7 +311,7 @@
}
}
- private final class PreloadController implements RecyclerView.OnScrollListener {
+ private final class PreloadController extends RecyclerView.OnScrollListener {
private final RecyclerView mRecyclerView;
private int mOldScrollState;
@@ -322,7 +322,7 @@
}
@Override
- public void onScrollStateChanged(int state) {
+ public void onScrollStateChanged(RecyclerView recyclerView, int state) {
switch (mOldScrollState) {
case RecyclerView.SCROLL_STATE_SETTLING: {
if (state == RecyclerView.SCROLL_STATE_IDLE
@@ -341,11 +341,6 @@
mOldScrollState = state;
}
- @Override
- public void onScrolled(int dx, int dy) {
- /* do nothing */
- }
-
public void startPreloadContent() {
PageAdapter pageAdapter = (PageAdapter) mRecyclerView.getAdapter();
diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeUI.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeUI.java
index e38c2ac..6d6fd60 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/VolumeUI.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeUI.java
@@ -132,6 +132,9 @@
final Intent intent = ZenModePanel.ZEN_SETTINGS;
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
mContext.startActivityAsUser(intent, new UserHandle(UserHandle.USER_CURRENT));
+
+ // dismiss shade if showing
+ mContext.sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));
}
});
mDialogPanel.postDismiss(mDismissDelay);
diff --git a/telecomm/java/android/telecomm/PhoneAccount.java b/telecomm/java/android/telecomm/PhoneAccount.java
index b246d92..bb335c3 100644
--- a/telecomm/java/android/telecomm/PhoneAccount.java
+++ b/telecomm/java/android/telecomm/PhoneAccount.java
@@ -16,8 +16,10 @@
package android.telecomm;
+import org.json.JSONException;
+import org.json.JSONObject;
+
import android.content.ComponentName;
-import android.net.Uri;
import android.os.Parcel;
import android.os.Parcelable;
@@ -26,55 +28,27 @@
/**
* Represents a distinct account, line of service or call placement method that
* the system can use to place phone calls.
+ *
+ * TODO: Per feedback from API Council, rename to "PhoneAccountHandle". See also comment on class
+ * PhoneAccountMetadata.
*/
public class PhoneAccount implements Parcelable {
-
/**
- * Flag indicating that this {@code PhoneAccount} can act as a call manager for traditional
- * SIM-based telephony calls. The {@link ConnectionService} associated with this phone-account
- * will be allowed to manage SIM-based phone calls including using its own proprietary
- * phone-call implementation (like VoIP calling) to make calls instead of the telephony stack.
- * When a user opts to place a call using the SIM-based telephony stack, the connection-service
- * associated with this phone-account will be attempted first if the user has explicitly
- * selected it to be used as the default call-manager.
+ * Flag indicating that this {@code PhoneAccount} represents built-in PSTN SIM subscription.
* <p>
- * See {@link #getCapabilities}
- */
- public static final int CAPABILITY_SIM_CALL_MANAGER = 0x1;
-
- /**
- * Flag indicating that this {@code PhoneAccount} can make phone calls in place of traditional
- * SIM-based telephony calls. This account will be treated as a distinct method for placing
- * calls alongside the traditional SIM-based telephony stack. This flag is distinct from
- * {@link #CAPABILITY_SIM_CALL_MANAGER} in that it is not allowed to manage calls from or use
- * the built-in telephony stack to place its calls.
- * <p>
- * See {@link #getCapabilities}
- */
- public static final int CAPABILITY_CALL_PROVIDER = 0x2;
-
- /**
- * Flag indicating that this {@code PhoneAccount} represents a built-in PSTN SIM subscription.
- * <p>
- * Only the android framework can set this capability on a phone-account.
+ * Only the android framework can set this capability on a phone account.
*/
public static final int CAPABILITY_SIM_SUBSCRIPTION = 0x4;
private ComponentName mComponentName;
private String mId;
- private Uri mHandle;
- private int mCapabilities;
public PhoneAccount(
ComponentName componentName,
- String id,
- Uri handle,
- int capabilities) {
+ String id) {
mComponentName = componentName;
mId = id;
- mHandle = handle;
- mCapabilities = capabilities;
}
/**
@@ -97,31 +71,9 @@
return mId;
}
- /**
- * The handle (e.g., a phone number) associated with this {@code PhoneAccount}. This represents
- * the destination from which outgoing calls using this {@code PhoneAccount} will appear to
- * come, if applicable, and the destination to which incoming calls using this
- * {@code PhoneAccount} may be addressed.
- *
- * @return A handle expressed as a {@code Uri}, for example, a phone number.
- */
- public Uri getHandle() {
- return mHandle;
- }
-
- /**
- * The capabilities of this {@code PhoneAccount}.
- *
- * @return A bit field of flags describing this {@code PhoneAccount}'s capabilities.
- */
- public int getCapabilities() {
- return mCapabilities;
- }
-
@Override
public int hashCode() {
- return Objects.hashCode(mComponentName) + Objects.hashCode(mId) +
- Objects.hashCode(mHandle) + mCapabilities;
+ return Objects.hashCode(mComponentName) + Objects.hashCode(mId);
}
@Override
@@ -130,20 +82,16 @@
.append(", ")
.append(mId)
.append(", ")
- .append(Log.pii(mHandle))
.append(", ")
- .append(String.valueOf(mCapabilities))
.toString();
}
- /**
- * TODO: Change this to just be equals() and use Set<> in Telecomm code instead of Lists.
- * @hide
- */
- public boolean equalsComponentAndId(PhoneAccount other) {
+ @Override
+ public boolean equals(Object other) {
return other != null &&
- Objects.equals(other.getComponentName(), getComponentName()) &&
- Objects.equals(other.getId(), getId());
+ other instanceof PhoneAccount &&
+ Objects.equals(((PhoneAccount) other).getComponentName(), getComponentName()) &&
+ Objects.equals(((PhoneAccount) other).getId(), getId());
}
//
@@ -159,8 +107,6 @@
public void writeToParcel(Parcel out, int flags) {
out.writeParcelable(mComponentName, flags);
out.writeString(mId);
- out.writeString(mHandle != null ? mHandle.toString() : "");
- out.writeInt(mCapabilities);
}
public static final Creator<PhoneAccount> CREATOR = new Creator<PhoneAccount>() {
@@ -178,8 +124,5 @@
private PhoneAccount(Parcel in) {
mComponentName = in.readParcelable(getClass().getClassLoader());
mId = in.readString();
- String uriString = in.readString();
- mHandle = uriString.length() > 0 ? Uri.parse(uriString) : null;
- mCapabilities = in.readInt();
}
}
diff --git a/telecomm/java/android/telecomm/PhoneAccountMetadata.java b/telecomm/java/android/telecomm/PhoneAccountMetadata.java
index 7232218..e5e41ff 100644
--- a/telecomm/java/android/telecomm/PhoneAccountMetadata.java
+++ b/telecomm/java/android/telecomm/PhoneAccountMetadata.java
@@ -19,6 +19,7 @@
import android.content.Context;
import android.content.pm.PackageManager;
import android.graphics.drawable.Drawable;
+import android.net.Uri;
import android.os.Parcel;
import android.os.Parcelable;
@@ -26,21 +27,55 @@
/**
* Provides user interface description information for a {@code PhoneAccount}.
+ *
+ * TODO: Per feedback from API Council, rename to "PhoneAccount". See also comment on class
+ * PhoneAccount.
*/
public class PhoneAccountMetadata implements Parcelable {
- private PhoneAccount mAccount;
- private int mIconResId;
- private String mLabel;
- private String mShortDescription;
+
+ /**
+ * Flag indicating that this {@code PhoneAccount} can act as a call manager for traditional
+ * SIM-based telephony calls. The {@link ConnectionService} associated with this phone-account
+ * will be allowed to manage SIM-based phone calls including using its own proprietary
+ * phone-call implementation (like VoIP calling) to make calls instead of the telephony stack.
+ * When a user opts to place a call using the SIM-based telephony stack, the connection-service
+ * associated with this phone-account will be attempted first if the user has explicitly
+ * selected it to be used as the default call-manager.
+ * <p>
+ * See {@link #getCapabilities}
+ */
+ public static final int CAPABILITY_SIM_CALL_MANAGER = 0x1;
+
+ /**
+ * Flag indicating that this {@code PhoneAccount} can make phone calls in place of traditional
+ * SIM-based telephony calls. This account will be treated as a distinct method for placing
+ * calls alongside the traditional SIM-based telephony stack. This flag is distinct from
+ * {@link #CAPABILITY_SIM_CALL_MANAGER} in that it is not allowed to manage calls from or use
+ * the built-in telephony stack to place its calls.
+ * <p>
+ * See {@link #getCapabilities}
+ */
+ public static final int CAPABILITY_CALL_PROVIDER = 0x2;
+
+ private final PhoneAccount mAccount;
+ private final Uri mHandle;
+ private final int mCapabilities;
+ private final int mIconResId;
+ private final String mLabel;
+ private final String mShortDescription;
private boolean mVideoCallingSupported;
public PhoneAccountMetadata(
PhoneAccount account,
+ Uri handle,
+ int capabilities,
int iconResId,
String label,
String shortDescription,
boolean supportsVideoCalling) {
mAccount = account;
+ mHandle = handle;
+ mCapabilities = capabilities;
mIconResId = iconResId;
mLabel = label;
mShortDescription = shortDescription;
@@ -57,6 +92,27 @@
}
/**
+ * The handle (e.g., a phone number) associated with this {@code PhoneAccount}. This represents
+ * the destination from which outgoing calls using this {@code PhoneAccount} will appear to
+ * come, if applicable, and the destination to which incoming calls using this
+ * {@code PhoneAccount} may be addressed.
+ *
+ * @return A handle expressed as a {@code Uri}, for example, a phone number.
+ */
+ public Uri getHandle() {
+ return mHandle;
+ }
+
+ /**
+ * The capabilities of this {@code PhoneAccount}.
+ *
+ * @return A bit field of flags describing this {@code PhoneAccount}'s capabilities.
+ */
+ public int getCapabilities() {
+ return mCapabilities;
+ }
+
+ /**
* A short string label describing a {@code PhoneAccount}.
*
* @return A label for this {@code PhoneAccount}.
@@ -75,6 +131,15 @@
}
/**
+ * The icon resource ID for the icon of this {@code PhoneAccount}.
+ *
+ * @return A resource ID.
+ */
+ public int getIconResId() {
+ return mIconResId;
+ }
+
+ /**
* An icon to represent this {@code PhoneAccount} in a user interface.
*
* @return An icon for this {@code PhoneAccount}.
@@ -122,10 +187,12 @@
@Override
public void writeToParcel(Parcel out, int flags) {
out.writeParcelable(mAccount, 0);
+ out.writeParcelable(mHandle, 0);
+ out.writeInt(mCapabilities);
out.writeInt(mIconResId);
out.writeString(mLabel);
out.writeString(mShortDescription);
- out.writeInt(mVideoCallingSupported ? 1: 0);
+ out.writeInt(mVideoCallingSupported ? 1 : 0);
}
public static final Creator<PhoneAccountMetadata> CREATOR
@@ -143,6 +210,8 @@
private PhoneAccountMetadata(Parcel in) {
mAccount = in.readParcelable(getClass().getClassLoader());
+ mHandle = in.readParcelable(getClass().getClassLoader());
+ mCapabilities = in.readInt();
mIconResId = in.readInt();
mLabel = in.readString();
mShortDescription = in.readString();
diff --git a/telecomm/java/android/telecomm/RemoteConnectionService.java b/telecomm/java/android/telecomm/RemoteConnectionService.java
index 25ff5bc..c2b574c 100644
--- a/telecomm/java/android/telecomm/RemoteConnectionService.java
+++ b/telecomm/java/android/telecomm/RemoteConnectionService.java
@@ -260,9 +260,7 @@
List<PhoneAccount> accounts = new LinkedList<>();
accounts.add(new PhoneAccount(
mComponentName,
- null /* id */,
- null /* handle */,
- 0 /* capabilities */));
+ null /* id */));
return accounts;
}
diff --git a/telecomm/java/android/telecomm/TelecommManager.java b/telecomm/java/android/telecomm/TelecommManager.java
index 8bf80bb..89fcdb5 100644
--- a/telecomm/java/android/telecomm/TelecommManager.java
+++ b/telecomm/java/android/telecomm/TelecommManager.java
@@ -56,6 +56,34 @@
}
/**
+ * Return the {@link PhoneAccount} which is the user-chosen default for making outgoing
+ * phone calls. This {@code PhoneAccount} will always be a member of the list which is
+ * returned from calling {@link #getEnabledPhoneAccounts()}.
+ * <p>
+ * Apps must be prepared for this method to return {@code null}, indicating that there
+ * currently exists no user-chosen default {@code PhoneAccount}. In this case, apps wishing to
+ * initiate a phone call must either create their {@link android.content.Intent#ACTION_CALL} or
+ * {@link android.content.Intent#ACTION_DIAL} {@code Intent} with no
+ * {@link TelecommConstants#EXTRA_PHONE_ACCOUNT}, or present the user with an affordance
+ * to select one of the elements of {@link #getEnabledPhoneAccounts()}.
+ * <p>
+ * An {@link android.content.Intent#ACTION_CALL} or {@link android.content.Intent#ACTION_DIAL}
+ * {@code Intent} with no {@link TelecommConstants#EXTRA_PHONE_ACCOUNT} is valid, and subsequent
+ * steps in the phone call flow are responsible for presenting the user with an affordance, if
+ * necessary, to choose a {@code PhoneAccount}.
+ */
+ public PhoneAccount getDefaultOutgoingPhoneAccount() {
+ try {
+ if (isServiceConnected()) {
+ return getTelecommService().getDefaultOutgoingPhoneAccount();
+ }
+ } catch (RemoteException e) {
+ Log.e(TAG, "Error calling ITelecommService#getDefaultOutgoingPhoneAccount", e);
+ }
+ return null;
+ }
+
+ /**
* Return a list of {@link PhoneAccount}s which can be used to make and receive phone calls.
*
* @see #EXTRA_PHONE_ACCOUNT
@@ -94,13 +122,12 @@
/**
* Register a {@link PhoneAccount} for use by the system.
*
- * @param account The {@link PhoneAccount}.
- * @param metadata The metadata for the account.
+ * @param metadata The complete {@link PhoneAccountMetadata}.
*/
- public void registerPhoneAccount(PhoneAccount account, PhoneAccountMetadata metadata) {
+ public void registerPhoneAccount(PhoneAccountMetadata metadata) {
try {
if (isServiceConnected()) {
- getTelecommService().registerPhoneAccount(account, metadata);
+ getTelecommService().registerPhoneAccount(metadata);
}
} catch (RemoteException e) {
Log.e(TAG, "Error calling ITelecommService#registerPhoneAccount", e);
diff --git a/telecomm/java/com/android/internal/telecomm/ITelecommService.aidl b/telecomm/java/com/android/internal/telecomm/ITelecommService.aidl
index 43caa1e..59393ed 100644
--- a/telecomm/java/com/android/internal/telecomm/ITelecommService.aidl
+++ b/telecomm/java/com/android/internal/telecomm/ITelecommService.aidl
@@ -34,6 +34,11 @@
void showCallScreen(boolean showDialpad);
/**
+ * @see TelecommManager#getDefaultOutgoingPhoneAccount
+ */
+ PhoneAccount getDefaultOutgoingPhoneAccount();
+
+ /**
* @see TelecommManager#getEnabledPhoneAccounts
*/
List<PhoneAccount> getEnabledPhoneAccounts();
@@ -46,7 +51,7 @@
/**
* @see TelecommManager#registerPhoneAccount
*/
- void registerPhoneAccount(in PhoneAccount account, in PhoneAccountMetadata metadata);
+ void registerPhoneAccount(in PhoneAccountMetadata metadata);
/**
* @see TelecommManager#unregisterPhoneAccount