diff --git a/api/11.xml b/api/11.xml index 6d12990facd73..ee962717a92f8 100644 --- a/api/11.xml +++ b/api/11.xml @@ -1790,7 +1790,7 @@ type="int" transient="false" volatile="false" - value="16843501" + value="16843499" static="true" final="true" deprecated="not deprecated" @@ -1812,7 +1812,7 @@ type="int" transient="false" volatile="false" - value="16843510" + value="16843508" static="true" final="true" deprecated="not deprecated" @@ -1823,7 +1823,7 @@ type="int" transient="false" volatile="false" - value="16843509" + value="16843507" static="true" final="true" deprecated="not deprecated" @@ -1834,7 +1834,7 @@ type="int" transient="false" volatile="false" - value="16843511" + value="16843509" static="true" final="true" deprecated="not deprecated" @@ -1867,7 +1867,7 @@ type="int" transient="false" volatile="false" - value="16843517" + value="16843515" static="true" final="true" deprecated="not deprecated" @@ -1889,7 +1889,7 @@ type="int" transient="false" volatile="false" - value="16843513" + value="16843511" static="true" final="true" deprecated="not deprecated" @@ -1911,7 +1911,7 @@ type="int" transient="false" volatile="false" - value="16843540" + value="16843538" static="true" final="true" deprecated="not deprecated" @@ -1922,7 +1922,7 @@ type="int" transient="false" volatile="false" - value="16843539" + value="16843537" static="true" final="true" deprecated="not deprecated" @@ -1933,7 +1933,7 @@ type="int" transient="false" volatile="false" - value="16843541" + value="16843539" static="true" final="true" deprecated="not deprecated" @@ -1944,7 +1944,7 @@ type="int" transient="false" volatile="false" - value="16843512" + value="16843510" static="true" final="true" deprecated="not deprecated" @@ -1955,7 +1955,7 @@ type="int" transient="false" volatile="false" - value="16843518" + value="16843516" static="true" final="true" deprecated="not deprecated" @@ -1966,7 +1966,7 @@ type="int" transient="false" volatile="false" - value="16843519" + value="16843517" static="true" final="true" deprecated="not deprecated" @@ -2043,7 +2043,7 @@ type="int" transient="false" volatile="false" - value="16843607" + value="16843605" static="true" final="true" deprecated="not deprecated" @@ -2065,7 +2065,7 @@ type="int" transient="false" volatile="false" - value="16843531" + value="16843529" static="true" final="true" deprecated="not deprecated" @@ -2109,7 +2109,7 @@ type="int" transient="false" volatile="false" - value="16843572" + value="16843570" static="true" final="true" deprecated="not deprecated" @@ -2142,7 +2142,7 @@ type="int" transient="false" volatile="false" - value="16843553" + value="16843551" static="true" final="true" deprecated="not deprecated" @@ -2208,7 +2208,7 @@ type="int" transient="false" volatile="false" - value="16843508" + value="16843506" static="true" final="true" deprecated="not deprecated" @@ -2274,7 +2274,7 @@ type="int" transient="false" volatile="false" - value="16843548" + value="16843546" static="true" final="true" deprecated="not deprecated" @@ -2340,7 +2340,7 @@ type="int" transient="false" volatile="false" - value="16843537" + value="16843535" static="true" final="true" deprecated="not deprecated" @@ -2450,7 +2450,7 @@ type="int" transient="false" volatile="false" - value="16843550" + value="16843548" static="true" final="true" deprecated="not deprecated" @@ -2494,7 +2494,7 @@ type="int" transient="false" volatile="false" - value="16843565" + value="16843563" static="true" final="true" deprecated="not deprecated" @@ -2582,7 +2582,7 @@ type="int" transient="false" volatile="false" - value="16843526" + value="16843524" static="true" final="true" deprecated="not deprecated" @@ -2593,7 +2593,7 @@ type="int" transient="false" volatile="false" - value="16843525" + value="16843523" static="true" final="true" deprecated="not deprecated" @@ -2626,7 +2626,7 @@ type="int" transient="false" volatile="false" - value="16843569" + value="16843567" static="true" final="true" deprecated="not deprecated" @@ -2637,7 +2637,7 @@ type="int" transient="false" volatile="false" - value="16843568" + value="16843566" static="true" final="true" deprecated="not deprecated" @@ -2703,7 +2703,7 @@ type="int" transient="false" volatile="false" - value="16843598" + value="16843596" static="true" final="true" deprecated="not deprecated" @@ -3220,7 +3220,7 @@ type="int" transient="false" volatile="false" - value="16843581" + value="16843579" static="true" final="true" deprecated="not deprecated" @@ -3275,7 +3275,7 @@ type="int" transient="false" volatile="false" - value="16843595" + value="16843593" static="true" final="true" deprecated="not deprecated" @@ -3385,7 +3385,7 @@ type="int" transient="false" volatile="false" - value="16843600" + value="16843598" static="true" final="true" deprecated="not deprecated" @@ -3451,7 +3451,7 @@ type="int" transient="false" volatile="false" - value="16843530" + value="16843528" static="true" final="true" deprecated="not deprecated" @@ -3572,7 +3572,7 @@ type="int" transient="false" volatile="false" - value="16843566" + value="16843564" static="true" final="true" deprecated="not deprecated" @@ -3583,7 +3583,7 @@ type="int" transient="false" volatile="false" - value="16843564" + value="16843562" static="true" final="true" deprecated="not deprecated" @@ -3594,7 +3594,7 @@ type="int" transient="false" volatile="false" - value="16843532" + value="16843530" static="true" final="true" deprecated="not deprecated" @@ -3825,7 +3825,7 @@ type="int" transient="false" volatile="false" - value="16843604" + value="16843602" static="true" final="true" deprecated="not deprecated" @@ -3836,7 +3836,7 @@ type="int" transient="false" volatile="false" - value="16843603" + value="16843601" static="true" final="true" deprecated="not deprecated" @@ -3946,7 +3946,7 @@ type="int" transient="false" volatile="false" - value="16843534" + value="16843532" static="true" final="true" deprecated="not deprecated" @@ -4001,7 +4001,7 @@ type="int" transient="false" volatile="false" - value="16843535" + value="16843533" static="true" final="true" deprecated="not deprecated" @@ -4199,7 +4199,7 @@ type="int" transient="false" volatile="false" - value="16843575" + value="16843573" static="true" final="true" deprecated="not deprecated" @@ -4221,7 +4221,7 @@ type="int" transient="false" volatile="false" - value="16843580" + value="16843578" static="true" final="true" deprecated="not deprecated" @@ -4232,7 +4232,7 @@ type="int" transient="false" volatile="false" - value="16843577" + value="16843575" static="true" final="true" deprecated="not deprecated" @@ -4243,7 +4243,7 @@ type="int" transient="false" volatile="false" - value="16843578" + value="16843576" static="true" final="true" deprecated="not deprecated" @@ -4254,7 +4254,7 @@ type="int" transient="false" volatile="false" - value="16843611" + value="16843609" static="true" final="true" deprecated="not deprecated" @@ -4265,7 +4265,7 @@ type="int" transient="false" volatile="false" - value="16843576" + value="16843574" static="true" final="true" deprecated="not deprecated" @@ -4276,7 +4276,7 @@ type="int" transient="false" volatile="false" - value="16843579" + value="16843577" static="true" final="true" deprecated="not deprecated" @@ -4375,7 +4375,7 @@ type="int" transient="false" volatile="false" - value="16843583" + value="16843581" static="true" final="true" deprecated="not deprecated" @@ -4430,7 +4430,7 @@ type="int" transient="false" volatile="false" - value="16843589" + value="16843587" static="true" final="true" deprecated="not deprecated" @@ -4514,7 +4514,7 @@ visibility="public" > - - - - - - - - + + @@ -30764,6 +30742,19 @@ + + + + + + @@ -30944,6 +30946,17 @@ visibility="public" > + + + + - + + @@ -33072,19 +33107,6 @@ - - - - - + + + + - - @@ -44250,8 +44283,6 @@ > - - @@ -44290,18 +44321,20 @@ visibility="public" > - + + - + + + + + + @@ -44354,6 +44402,21 @@ > + + + + + + @@ -44371,6 +44434,21 @@ > + + + + + + @@ -44390,6 +44468,23 @@ + + + + + + + + @@ -50362,6 +50457,16 @@ > + + + + @@ -50452,7 +50557,7 @@ visibility="public" > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -57791,17 +57757,6 @@ > - - - - - - - - - - + + @@ -30790,6 +30768,19 @@ + + + + + + + + + + - + + @@ -33098,19 +33133,6 @@ - - - - - + + + + - - @@ -44276,8 +44309,6 @@ > - - @@ -44316,18 +44347,20 @@ visibility="public" > - + + - + + + + + + @@ -44380,6 +44428,21 @@ > + + + + + + @@ -44397,6 +44460,21 @@ > + + + + + + @@ -44416,6 +44494,23 @@ + + + + + + + + @@ -50388,6 +50483,16 @@ > + + + + @@ -50478,7 +50583,7 @@ visibility="public" > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -57817,17 +57783,6 @@ > - -Note that you should never hold on to a BackStackEntry object; @@ -64,6 +64,18 @@ public abstract class FragmentManager { */ public int getId(); + /** + * Return the full bread crumb title resource identifier for the entry, + * or 0 if it does not have one. + */ + public int getBreadCrumbTitleRes(); + + /** + * Return the short bread crumb title resource identifier for the entry, + * or 0 if it does not have one. + */ + public int getBreadCrumbShortTitleRes(); + /** * Return the full bread crumb title for the entry, or null if it * does not have one. @@ -102,7 +114,8 @@ public abstract class FragmentManager { */ public abstract FragmentTransaction beginTransaction(); - /** Old API */ + /** @deprecated Old API */ + @Deprecated public FragmentTransaction openTransaction() { return beginTransaction(); } @@ -153,7 +166,9 @@ public abstract class FragmentManager { /** * Pop the top state off the back stack. Returns true if there was one - * to pop, else false. + * to pop, else false. This function is asynchronous -- it enqueues the + * request to pop, but the action will not be performed until the application + * returns to its event loop. */ public abstract void popBackStack(); @@ -168,6 +183,10 @@ public abstract class FragmentManager { /** * Pop the last fragment transition from the manager's fragment * back stack. If there is nothing to pop, false is returned. + * This function is asynchronous -- it enqueues the + * request to pop, but the action will not be performed until the application + * returns to its event loop. + * * @param name If non-null, this is the name of a previous back state * to look for; if found, all states up to that state will be popped. The * {@link #POP_BACK_STACK_INCLUSIVE} flag can be used to control whether @@ -186,6 +205,10 @@ public abstract class FragmentManager { /** * Pop all back stack states up to the one with the given identifier. + * This function is asynchronous -- it enqueues the + * request to pop, but the action will not be performed until the application + * returns to its event loop. + * * @param id Identifier of the stated to be popped. If no identifier exists, * false is returned. * The identifier is the number returned by @@ -207,14 +230,24 @@ public abstract class FragmentManager { /** * Return the number of entries currently in the back stack. */ - public abstract int countBackStackEntries(); + public abstract int getBackStackEntryCount(); + @Deprecated + public int countBackStackEntries() { + return getBackStackEntryCount(); + } + /** * Return the BackStackEntry at index index in the back stack; * entries start index 0 being the bottom of the stack. */ - public abstract BackStackEntry getBackStackEntry(int index); + public abstract BackStackEntry getBackStackEntryAt(int index); + @Deprecated + public BackStackEntry getBackStackEntry(int index) { + return getBackStackEntryAt(index); + } + /** * Add a new listener for changes to the fragment back stack. */ @@ -416,12 +449,12 @@ final class FragmentManagerImpl extends FragmentManager { } @Override - public int countBackStackEntries() { + public int getBackStackEntryCount() { return mBackStack != null ? mBackStack.size() : 0; } @Override - public BackStackEntry getBackStackEntry(int index) { + public BackStackEntry getBackStackEntryAt(int index) { return mBackStack.get(index); } @@ -1678,11 +1711,8 @@ final class FragmentManagerImpl extends FragmentManager { case FragmentTransaction.TRANSIT_FRAGMENT_CLOSE: rev = FragmentTransaction.TRANSIT_FRAGMENT_OPEN; break; - case FragmentTransaction.TRANSIT_FRAGMENT_NEXT: - rev = FragmentTransaction.TRANSIT_FRAGMENT_PREV; - break; - case FragmentTransaction.TRANSIT_FRAGMENT_PREV: - rev = FragmentTransaction.TRANSIT_FRAGMENT_NEXT; + case FragmentTransaction.TRANSIT_FRAGMENT_FADE: + rev = FragmentTransaction.TRANSIT_FRAGMENT_FADE; break; } return rev; @@ -1702,15 +1732,10 @@ final class FragmentManagerImpl extends FragmentManager { ? com.android.internal.R.styleable.FragmentAnimation_fragmentCloseEnterAnimation : com.android.internal.R.styleable.FragmentAnimation_fragmentCloseExitAnimation; break; - case FragmentTransaction.TRANSIT_FRAGMENT_NEXT: + case FragmentTransaction.TRANSIT_FRAGMENT_FADE: animAttr = enter - ? com.android.internal.R.styleable.FragmentAnimation_fragmentNextEnterAnimation - : com.android.internal.R.styleable.FragmentAnimation_fragmentNextExitAnimation; - break; - case FragmentTransaction.TRANSIT_FRAGMENT_PREV: - animAttr = enter - ? com.android.internal.R.styleable.FragmentAnimation_fragmentPrevEnterAnimation - : com.android.internal.R.styleable.FragmentAnimation_fragmentPrevExitAnimation; + ? com.android.internal.R.styleable.FragmentAnimation_fragmentFadeEnterAnimation + : com.android.internal.R.styleable.FragmentAnimation_fragmentFadeExitAnimation; break; } return animAttr; diff --git a/core/java/android/app/FragmentTransaction.java b/core/java/android/app/FragmentTransaction.java index 1b8debcda993e..fc59310c364d2 100644 --- a/core/java/android/app/FragmentTransaction.java +++ b/core/java/android/app/FragmentTransaction.java @@ -110,11 +110,16 @@ public abstract class FragmentTransaction { public static final int TRANSIT_FRAGMENT_OPEN = 1 | TRANSIT_ENTER_MASK; /** Fragment is being removed from the stack */ public static final int TRANSIT_FRAGMENT_CLOSE = 2 | TRANSIT_EXIT_MASK; - /** Fragment is being added in a 'next' operation*/ - public static final int TRANSIT_FRAGMENT_NEXT = 3 | TRANSIT_ENTER_MASK; - /** Fragment is being removed in a 'previous' operation */ - public static final int TRANSIT_FRAGMENT_PREV = 4 | TRANSIT_EXIT_MASK; + /** Fragment should simply fade in or out; that is, no strong navigation associated + * with it except that it is appearing or disappearing for some reason. */ + public static final int TRANSIT_FRAGMENT_FADE = 3 | TRANSIT_ENTER_MASK; + // Temp compat. + @Deprecated + public static final int TRANSIT_FRAGMENT_NEXT = TRANSIT_FRAGMENT_FADE; + @Deprecated + public static final int TRANSIT_FRAGMENT_PREV = TRANSIT_FRAGMENT_FADE; + /** * Set specific animation resources to run for the fragments that are * entering and exiting in this transaction. diff --git a/core/java/android/app/LoaderManager.java b/core/java/android/app/LoaderManager.java index cd5e3bb5b2eb2..ffe2a5d68aaf2 100644 --- a/core/java/android/app/LoaderManager.java +++ b/core/java/android/app/LoaderManager.java @@ -158,14 +158,6 @@ public abstract class LoaderManager { */ public abstract void destroyLoader(int id); - /** - * @deprecated Renamed to {@link #destroyLoader}. - */ - @Deprecated - public void stopLoader(int id) { - destroyLoader(id); - } - /** * Return the Loader with the given id or null if no matching Loader * is found. diff --git a/core/java/android/content/AsyncTaskLoader.java b/core/java/android/content/AsyncTaskLoader.java index c6b9e805afce5..4cf356f3a7ad6 100644 --- a/core/java/android/content/AsyncTaskLoader.java +++ b/core/java/android/content/AsyncTaskLoader.java @@ -168,9 +168,14 @@ public abstract class AsyncTaskLoader extends Loader { * Called if the task was canceled before it was completed. Gives the class a chance * to properly dispose of the result. */ - public void onCancelled(D data) { + public void onCanceled(D data) { + onCancelled(data); } + @Deprecated + public void onCancelled(D data) { + } + void executePendingTask() { if (mCancellingTask == null && mTask != null) { if (mTask.waiting) { @@ -195,7 +200,7 @@ public abstract class AsyncTaskLoader extends Loader { } void dispatchOnCancelled(LoadTask task, D data) { - onCancelled(data); + onCanceled(data); if (mCancellingTask == task) { if (DEBUG) Slog.v(TAG, "Cancelled task is now canceled!"); mLastLoadCompleteTime = SystemClock.uptimeMillis(); diff --git a/core/java/android/content/BroadcastReceiver.java b/core/java/android/content/BroadcastReceiver.java index 5939643e85a88..028149b3760b0 100644 --- a/core/java/android/content/BroadcastReceiver.java +++ b/core/java/android/content/BroadcastReceiver.java @@ -170,6 +170,16 @@ public abstract class BroadcastReceiver { * State for a result that is pending for a broadcast receiver. Returned * by {@link BroadcastReceiver#goAsync() goAsync()} * while in {@link BroadcastReceiver#onReceive BroadcastReceiver.onReceive()}. + * This allows you to return from onReceive() without having the broadcast + * terminate; you must call {@link #finish()} once you are done with the + * broadcast. This allows you to process the broadcast off of the main + * thread of your app. + * + *

Note on threading: the state inside of this class is not itself + * thread-safe, however you can use it from any thread if you properly + * sure that you do not have races. Typically this means you will hand + * the entire object to another thread, which will be solely responsible + * for setting any results and finally calling {@link #finish()}. */ public static class PendingResult { /** @hide */ diff --git a/core/java/android/content/ClipData.java b/core/java/android/content/ClipData.java index 6f4d098075dc1..7963b509b6aac 100644 --- a/core/java/android/content/ClipData.java +++ b/core/java/android/content/ClipData.java @@ -42,9 +42,9 @@ import java.util.ArrayList; * {@link ClipDescription#getMimeType(int) getDescription().getMimeType(int)} * must return correct MIME type(s) describing the data in the clip. For help * in correctly constructing a clip with the correct MIME type, use - * {@link #newPlainText(CharSequence, Bitmap, CharSequence)}, - * {@link #newUri(ContentResolver, CharSequence, Bitmap, Uri)}, and - * {@link #newIntent(CharSequence, Bitmap, Intent)}. + * {@link #newPlainText(CharSequence, CharSequence)}, + * {@link #newUri(ContentResolver, CharSequence, Uri)}, and + * {@link #newIntent(CharSequence, Intent)}. * *

Each Item instance can be one of three main classes of data: a simple * CharSequence of text, a single Intent object, or a Uri. See {@link Item} @@ -70,7 +70,7 @@ import java.util.ArrayList; * "content:" URIs. A content URI allows the recipient of a ClippedData item * to interact closely with the ContentProvider holding the data in order to * negotiate the transfer of that data. The clip must also be filled in with - * the available MIME types; {@link #newUri(ContentResolver, CharSequence, Bitmap, Uri)} + * the available MIME types; {@link #newUri(ContentResolver, CharSequence, Uri)} * will take care of correctly doing this. * *

For example, here is the paste function of a simple NotePad application. @@ -321,16 +321,14 @@ public class ClipData implements Parcelable { * * @param label Label to show to the user describing this clip. * @param mimeTypes An array of MIME types this data is available as. - * @param icon Bitmap providing the user with an iconing representation of - * the clip. * @param item The contents of the first item in the clip. */ - public ClipData(CharSequence label, String[] mimeTypes, Bitmap icon, Item item) { + public ClipData(CharSequence label, String[] mimeTypes, Item item) { mClipDescription = new ClipDescription(label, mimeTypes); if (item == null) { throw new NullPointerException("item is null"); } - mIcon = icon; + mIcon = null; mItems.add(item); } @@ -338,16 +336,14 @@ public class ClipData implements Parcelable { * Create a new clip. * * @param description The ClipDescription describing the clip contents. - * @param icon Bitmap providing the user with an iconing representation of - * the clip. * @param item The contents of the first item in the clip. */ - public ClipData(ClipDescription description, Bitmap icon, Item item) { + public ClipData(ClipDescription description, Item item) { mClipDescription = description; if (item == null) { throw new NullPointerException("item is null"); } - mIcon = icon; + mIcon = null; mItems.add(item); } @@ -356,13 +352,17 @@ public class ClipData implements Parcelable { * {@link ClipDescription#MIMETYPE_TEXT_PLAIN}. * * @param label User-visible label for the clip data. - * @param icon Iconic representation of the clip data. * @param text The actual text in the clip. * @return Returns a new ClipData containing the specified data. */ - static public ClipData newPlainText(CharSequence label, Bitmap icon, CharSequence text) { + static public ClipData newPlainText(CharSequence label, CharSequence text) { Item item = new Item(text); - return new ClipData(label, MIMETYPES_TEXT_PLAIN, icon, item); + return new ClipData(label, MIMETYPES_TEXT_PLAIN, item); + } + + @Deprecated + static public ClipData newPlainText(CharSequence label, Bitmap icon, CharSequence text) { + return newPlainText(label, text); } /** @@ -370,15 +370,19 @@ public class ClipData implements Parcelable { * {@link ClipDescription#MIMETYPE_TEXT_INTENT}. * * @param label User-visible label for the clip data. - * @param icon Iconic representation of the clip data. * @param intent The actual Intent in the clip. * @return Returns a new ClipData containing the specified data. */ - static public ClipData newIntent(CharSequence label, Bitmap icon, Intent intent) { + static public ClipData newIntent(CharSequence label, Intent intent) { Item item = new Item(intent); - return new ClipData(label, MIMETYPES_TEXT_INTENT, icon, item); + return new ClipData(label, MIMETYPES_TEXT_INTENT, item); } + @Deprecated + static public ClipData newIntent(CharSequence label, Bitmap icon, Intent intent) { + return newIntent(label, intent); + } + /** * Create a new ClipData holding a URI. If the URI is a content: URI, * this will query the content provider for the MIME type of its data and @@ -387,12 +391,11 @@ public class ClipData implements Parcelable { * * @param resolver ContentResolver used to get information about the URI. * @param label User-visible label for the clip data. - * @param icon Iconic representation of the clip data. * @param uri The URI in the clip. * @return Returns a new ClipData containing the specified data. */ static public ClipData newUri(ContentResolver resolver, CharSequence label, - Bitmap icon, Uri uri) { + Uri uri) { Item item = new Item(uri); String[] mimeTypes = null; if ("content".equals(uri.getScheme())) { @@ -417,26 +420,36 @@ public class ClipData implements Parcelable { if (mimeTypes == null) { mimeTypes = MIMETYPES_TEXT_URILIST; } - return new ClipData(label, mimeTypes, icon, item); + return new ClipData(label, mimeTypes, item); } + @Deprecated + static public ClipData newUri(ContentResolver resolver, CharSequence label, + Bitmap icon, Uri uri) { + return newUri(resolver, label, uri); + } + /** * Create a new ClipData holding an URI with MIME type * {@link ClipDescription#MIMETYPE_TEXT_URILIST}. - * Unlike {@link #newUri(ContentResolver, CharSequence, Bitmap, Uri)}, nothing + * Unlike {@link #newUri(ContentResolver, CharSequence, Uri)}, nothing * is inferred about the URI -- if it is a content: URI holding a bitmap, * the reported type will still be uri-list. Use this with care! * * @param label User-visible label for the clip data. - * @param icon Iconic representation of the clip data. * @param uri The URI in the clip. * @return Returns a new ClipData containing the specified data. */ - static public ClipData newRawUri(CharSequence label, Bitmap icon, Uri uri) { + static public ClipData newRawUri(CharSequence label, Uri uri) { Item item = new Item(uri); - return new ClipData(label, MIMETYPES_TEXT_URILIST, icon, item); + return new ClipData(label, MIMETYPES_TEXT_URILIST, item); } + @Deprecated + static public ClipData newRawUri(CharSequence label, Bitmap icon, Uri uri) { + return newRawUri(label, uri); + } + /** * Return the {@link ClipDescription} associated with this data, describing * what it contains. @@ -445,6 +458,9 @@ public class ClipData implements Parcelable { return mClipDescription; } + /** + * Add a new Item to the overall ClipData container. + */ public void addItem(Item item) { if (item == null) { throw new NullPointerException("item is null"); @@ -452,18 +468,31 @@ public class ClipData implements Parcelable { mItems.add(item); } + /** @hide */ public Bitmap getIcon() { return mIcon; } + /** + * Return the number of items in the clip data. + */ public int getItemCount() { return mItems.size(); } - public Item getItem(int index) { + /** + * Return a single item inside of the clip data. The index can range + * from 0 to {@link #getItemCount()}-1. + */ + public Item getItemAt(int index) { return mItems.get(index); } + @Deprecated + public Item getItem(int index) { + return getItemAt(index); + } + @Override public int describeContents() { return 0; diff --git a/core/java/android/content/ClipboardManager.java b/core/java/android/content/ClipboardManager.java index 3e2b763ecdd84..a79f0602ad11b 100644 --- a/core/java/android/content/ClipboardManager.java +++ b/core/java/android/content/ClipboardManager.java @@ -170,7 +170,7 @@ public class ClipboardManager extends android.text.ClipboardManager { public CharSequence getText() { ClipData clip = getPrimaryClip(); if (clip != null && clip.getItemCount() > 0) { - return clip.getItem(0).coerceToText(mContext); + return clip.getItemAt(0).coerceToText(mContext); } return null; } @@ -181,7 +181,7 @@ public class ClipboardManager extends android.text.ClipboardManager { * primary clip. It has no label or icon. */ public void setText(CharSequence text) { - setPrimaryClip(ClipData.newPlainText(null, null, text)); + setPrimaryClip(ClipData.newPlainText(null, text)); } /** diff --git a/core/java/android/content/CursorLoader.java b/core/java/android/content/CursorLoader.java index 38ebaf2ffc203..6228bd059f2d7 100644 --- a/core/java/android/content/CursorLoader.java +++ b/core/java/android/content/CursorLoader.java @@ -26,6 +26,17 @@ import java.util.Arrays; /** * A loader that queries the {@link ContentResolver} and returns a {@link Cursor}. + * This class implements the {@link Loader} protocol in a standard way for + * querying cursors, building on {@link AsyncTaskLoader} to perform the cursor + * query on a background thread so that it does not block the application's UI. + * + *

A CursorLoader must be built with the full information for the query to + * perform, either through the + * {@link #CursorLoader(Context, Uri, String[], String, String[], String)} or + * creating an empty instance with {@link #CursorLoader(Context)} and filling + * in the desired paramters with {@link #setUri(Uri)}, {@link #setSelection(String)}, + * {@link #setSelectionArgs(String[])}, {@link #setSortOrder(String)}, + * and {@link #setProjection(String[])}. */ public class CursorLoader extends AsyncTaskLoader { final ForceLoadContentObserver mObserver; @@ -81,6 +92,22 @@ public class CursorLoader extends AsyncTaskLoader { } } + /** + * Creates an empty unspecified CursorLoader. You must follow this with + * calls to {@link #setUri(Uri)}, {@link #setSelection(String)}, etc + * to specify the query to perform. + */ + public CursorLoader(Context context) { + super(context); + mObserver = new ForceLoadContentObserver(); + } + + /** + * Creates a fully-specified CursorLoader. See + * {@link ContentResolver#query(Uri, String[], String, String[], String) + * ContentResolver.query()} for documentation on the meaning of the + * parameters. These will be passed as-is to that call. + */ public CursorLoader(Context context, Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) { super(context); @@ -119,7 +146,7 @@ public class CursorLoader extends AsyncTaskLoader { } @Override - public void onCancelled(Cursor cursor) { + public void onCanceled(Cursor cursor) { if (cursor != null && !cursor.isClosed()) { cursor.close(); } diff --git a/core/java/android/content/XmlDocumentProvider.java b/core/java/android/content/XmlDocumentProvider.java index 153ad38b8bfdb..76539c75ba1ca 100644 --- a/core/java/android/content/XmlDocumentProvider.java +++ b/core/java/android/content/XmlDocumentProvider.java @@ -40,6 +40,8 @@ import java.util.Stack; import java.util.regex.Pattern; /** + * @hide -- not yet ready to support, should be provided just as a static lib. + * * A read-only content provider which extracts data out of an XML document. * *

A XPath-like selection pattern is used to select some nodes in the XML document. Each such diff --git a/core/java/android/content/pm/ActivityInfo.java b/core/java/android/content/pm/ActivityInfo.java index e688c86d0f9bb..46f611fba8cb9 100644 --- a/core/java/android/content/pm/ActivityInfo.java +++ b/core/java/android/content/pm/ActivityInfo.java @@ -149,7 +149,13 @@ public class ActivityInfo extends ComponentInfo * {@link android.R.attr#finishOnCloseSystemDialogs} attribute. */ public static final int FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS = 0x0100; - /** + /** + * Value for {@link #flags}: true when the application's rendering should + * be hardware accelerated. + */ + public static final int FLAG_HARDWARE_ACCELERATED = 0x0200; + /** + * @hide * Bit in {@link #flags} corresponding to an immersive activity * that wishes not to be interrupted by notifications. * Applications that hide the system notification bar with @@ -164,12 +170,7 @@ public class ActivityInfo extends ComponentInfo * "toast" window). * {@see android.app.Notification#FLAG_HIGH_PRIORITY} */ - public static final int FLAG_IMMERSIVE = 0x0200; - /** - * Value for {@link #flags}: true when the application's rendering should - * be hardware accelerated. - */ - public static final int FLAG_HARDWARE_ACCELERATED = 0x0400; + public static final int FLAG_IMMERSIVE = 0x0400; /** * Options that have been set in the activity declaration in the * manifest. @@ -180,7 +181,7 @@ public class ActivityInfo extends ComponentInfo * {@link #FLAG_STATE_NOT_NEEDED}, {@link #FLAG_EXCLUDE_FROM_RECENTS}, * {@link #FLAG_ALLOW_TASK_REPARENTING}, {@link #FLAG_NO_HISTORY}, * {@link #FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS}, - * {@link #FLAG_IMMERSIVE}, {@link #FLAG_HARDWARE_ACCELERATED} + * {@link #FLAG_HARDWARE_ACCELERATED} */ public int flags; diff --git a/core/java/android/preference/PreferenceActivity.java b/core/java/android/preference/PreferenceActivity.java index ee3bdab3e0c25..3883451e4b23d 100644 --- a/core/java/android/preference/PreferenceActivity.java +++ b/core/java/android/preference/PreferenceActivity.java @@ -1045,9 +1045,7 @@ public abstract class PreferenceActivity extends ListActivity implements FragmentManager.POP_BACK_STACK_INCLUSIVE); Fragment f = Fragment.instantiate(this, fragmentName, args); FragmentTransaction transaction = getFragmentManager().beginTransaction(); - transaction.setTransition(direction == 0 ? FragmentTransaction.TRANSIT_NONE - : direction > 0 ? FragmentTransaction.TRANSIT_FRAGMENT_NEXT - : FragmentTransaction.TRANSIT_FRAGMENT_PREV); + transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE); transaction.replace(com.android.internal.R.id.prefs, f); transaction.commit(); } @@ -1142,7 +1140,7 @@ public abstract class PreferenceActivity extends ListActivity implements transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN); transaction.addToBackStack(BACK_STACK_PREFS); } else { - transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_NEXT); + transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE); } transaction.commit(); } diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index 623cd4180c3d8..de886d8019dee 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -7942,7 +7942,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener for (int i=0; i - - - - \ No newline at end of file diff --git a/core/res/res/animator/fragment_prev_exit.xml b/core/res/res/animator/fragment_prev_exit.xml deleted file mode 100644 index 503b7ad2338a7..0000000000000 --- a/core/res/res/animator/fragment_prev_exit.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - \ No newline at end of file diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index 19e2b8d9c937d..6ca42e3c85d0c 100755 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -1379,10 +1379,8 @@ - - - - + + diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index 3ad29c4bd933b..eabd4575e1c3d 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -1311,10 +1311,8 @@ - - - - + + diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml index a3660470ca19f..16c80d0e72fdb 100644 --- a/core/res/res/values/styles.xml +++ b/core/res/res/values/styles.xml @@ -85,10 +85,8 @@ @animator/fragment_open_exit @animator/fragment_close_enter @animator/fragment_close_exit - @animator/fragment_next_enter - @animator/fragment_next_exit - @animator/fragment_prev_enter - @animator/fragment_prev_exit + @animator/fragment_fade_enter + @animator/fragment_fade_exit diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/ShirtPocket.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/ShirtPocket.java index e864577b97c6e..a67f9157459f2 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/ShirtPocket.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/ShirtPocket.java @@ -120,7 +120,7 @@ public class ShirtPocket extends ImageView { mAltText.setVisibility(View.VISIBLE); if (mClipping.getItemCount() > 0) { // TODO: figure out how to visualize every kind of ClipData! - mAltText.setText(mClipping.getItem(0).coerceToText(getContext())); + mAltText.setText(mClipping.getItemAt(0).coerceToText(getContext())); } } } diff --git a/services/java/com/android/server/ClipboardService.java b/services/java/com/android/server/ClipboardService.java index bec35d162abf0..062ab74ff406d 100644 --- a/services/java/com/android/server/ClipboardService.java +++ b/services/java/com/android/server/ClipboardService.java @@ -140,7 +140,7 @@ public class ClipboardService extends IClipboard.Stub { public boolean hasClipboardText() { synchronized (this) { if (mPrimaryClip != null) { - CharSequence text = mPrimaryClip.getItem(0).getText(); + CharSequence text = mPrimaryClip.getItemAt(0).getText(); return text != null && text.length() > 0; } return false; @@ -175,7 +175,7 @@ public class ClipboardService extends IClipboard.Stub { private final void checkDataOwnerLocked(ClipData data, int uid) { final int N = data.getItemCount(); for (int i=0; i