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

Commit f9dd34f4 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

DO NOT MERGE: Integrate from main - Deprecate a bunch of APIs.

And clean up some documentation.

Change-Id: I8f06e2fc3bb6c552581b64657e82ba690d524232
parent 738c5e60
Loading
Loading
Loading
Loading
+12 −12
Original line number Diff line number Diff line
@@ -22707,7 +22707,7 @@
 synchronized="false"
 static="false"
 final="true"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
<parameter name="id" type="int">
@@ -22981,7 +22981,7 @@
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
</method>
@@ -23434,7 +23434,7 @@
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="protected"
>
<parameter name="id" type="int">
@@ -23798,7 +23798,7 @@
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="protected"
>
<parameter name="id" type="int">
@@ -23880,7 +23880,7 @@
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
</method>
@@ -24102,7 +24102,7 @@
 synchronized="false"
 static="false"
 final="true"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
<parameter name="id" type="int">
@@ -24452,7 +24452,7 @@
 synchronized="false"
 static="false"
 final="true"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
<parameter name="id" type="int">
@@ -24465,7 +24465,7 @@
 synchronized="false"
 static="false"
 final="true"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
<parameter name="id" type="int">
@@ -32664,7 +32664,7 @@
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
<parameter name="callback" type="android.app.KeyguardManager.OnKeyguardExitResult">
@@ -32688,7 +32688,7 @@
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
<parameter name="tag" type="java.lang.String">
@@ -32700,7 +32700,7 @@
 abstract="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
<method name="disableKeyguard"
@@ -150831,7 +150831,7 @@
 value="10"
 static="true"
 final="true"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
</field>
+47 −4
Original line number Diff line number Diff line
@@ -1438,6 +1438,10 @@ public class Activity extends ContextThemeWrapper
    }
    
    /**
     * @deprecated Use the new {@link Fragment} API
     * {@link Fragment#setRetainInstance(boolean)} instead; this is also
     * available on older platforms through the Android compatibility package.
     *
     * Retrieve the non-configuration instance data that was previously
     * returned by {@link #onRetainNonConfigurationInstance()}.  This will
     * be available from the initial {@link #onCreate} and
@@ -1454,12 +1458,17 @@ public class Activity extends ContextThemeWrapper
     * @return Returns the object previously returned by
     * {@link #onRetainNonConfigurationInstance()}.
     */
    @Deprecated
    public Object getLastNonConfigurationInstance() {
        return mLastNonConfigurationInstances != null
                ? mLastNonConfigurationInstances.activity : null;
    }
    
    /**
     * @deprecated Use the new {@link Fragment} API
     * {@link Fragment#setRetainInstance(boolean)} instead; this is also
     * available on older platforms through the Android compatibility package.
     *
     * Called by the system, as part of destroying an
     * activity due to a configuration change, when it is known that a new
     * instance will immediately be created for the new configuration.  You
@@ -1675,6 +1684,10 @@ public class Activity extends ContextThemeWrapper
    }

    /**
     * @deprecated Use the new {@link android.content.CursorLoader} class with
     * {@link LoaderManager} instead; this is also
     * available on older platforms through the Android compatibility package.
     *
     * This method allows the activity to take care of managing the given
     * {@link Cursor}'s lifecycle for you based on the activity's lifecycle.
     * That is, when the activity is stopped it will automatically call
@@ -1690,8 +1703,6 @@ public class Activity extends ContextThemeWrapper
     * 
     * @see #managedQuery(android.net.Uri , String[], String, String[], String)
     * @see #stopManagingCursor
     *
     * @deprecated Use {@link CursorLoader} instead.
     */
    @Deprecated
    public void startManagingCursor(Cursor c) {
@@ -1701,6 +1712,10 @@ public class Activity extends ContextThemeWrapper
    }

    /**
     * @deprecated Use the new {@link android.content.CursorLoader} class with
     * {@link LoaderManager} instead; this is also
     * available on older platforms through the Android compatibility package.
     *
     * Given a Cursor that was previously given to
     * {@link #startManagingCursor}, stop the activity's management of that
     * cursor.
@@ -1708,8 +1723,6 @@ public class Activity extends ContextThemeWrapper
     * @param c The Cursor that was being managed.
     * 
     * @see #startManagingCursor
     *
     * @deprecated Use {@link CursorLoader} instead.
     */
    @Deprecated
    public void stopManagingCursor(Cursor c) {
@@ -2720,6 +2733,10 @@ public class Activity extends ContextThemeWrapper
    }

    /**
     * @deprecated Use the new {@link DialogFragment} class with
     * {@link FragmentManager} instead; this is also
     * available on older platforms through the Android compatibility package.
     *
     * Callback for creating dialogs that are managed (saved and restored) for you
     * by the activity.  The default implementation calls through to
     * {@link #onCreateDialog(int)} for compatibility.
@@ -2748,6 +2765,7 @@ public class Activity extends ContextThemeWrapper
     * @see #dismissDialog(int)
     * @see #removeDialog(int)
     */
    @Deprecated
    protected Dialog onCreateDialog(int id, Bundle args) {
        return onCreateDialog(id);
    }
@@ -2762,6 +2780,10 @@ public class Activity extends ContextThemeWrapper
    }

    /**
     * @deprecated Use the new {@link DialogFragment} class with
     * {@link FragmentManager} instead; this is also
     * available on older platforms through the Android compatibility package.
     *
     * Provides an opportunity to prepare a managed dialog before it is being
     * shown.  The default implementation calls through to
     * {@link #onPrepareDialog(int, Dialog)} for compatibility.
@@ -2781,20 +2803,30 @@ public class Activity extends ContextThemeWrapper
     * @see #dismissDialog(int)
     * @see #removeDialog(int)
     */
    @Deprecated
    protected void onPrepareDialog(int id, Dialog dialog, Bundle args) {
        onPrepareDialog(id, dialog);
    }

    /**
     * @deprecated Use the new {@link DialogFragment} class with
     * {@link FragmentManager} instead; this is also
     * available on older platforms through the Android compatibility package.
     *
     * Simple version of {@link #showDialog(int, Bundle)} that does not
     * take any arguments.  Simply calls {@link #showDialog(int, Bundle)}
     * with null arguments.
     */
    @Deprecated
    public final void showDialog(int id) {
        showDialog(id, null);
    }

    /**
     * @deprecated Use the new {@link DialogFragment} class with
     * {@link FragmentManager} instead; this is also
     * available on older platforms through the Android compatibility package.
     *
     * Show a dialog managed by this activity.  A call to {@link #onCreateDialog(int, Bundle)}
     * will be made with the same id the first time this is called for a given
     * id.  From thereafter, the dialog will be automatically saved and restored.
@@ -2820,6 +2852,7 @@ public class Activity extends ContextThemeWrapper
     * @see #dismissDialog(int)
     * @see #removeDialog(int)
     */
    @Deprecated
    public final boolean showDialog(int id, Bundle args) {
        if (mManagedDialogs == null) {
            mManagedDialogs = new SparseArray<ManagedDialog>();
@@ -2841,6 +2874,10 @@ public class Activity extends ContextThemeWrapper
    }

    /**
     * @deprecated Use the new {@link DialogFragment} class with
     * {@link FragmentManager} instead; this is also
     * available on older platforms through the Android compatibility package.
     *
     * Dismiss a dialog that was previously shown via {@link #showDialog(int)}.
     *
     * @param id The id of the managed dialog.
@@ -2853,6 +2890,7 @@ public class Activity extends ContextThemeWrapper
     * @see #showDialog(int)
     * @see #removeDialog(int)
     */
    @Deprecated
    public final void dismissDialog(int id) {
        if (mManagedDialogs == null) {
            throw missingDialog(id);
@@ -2875,6 +2913,10 @@ public class Activity extends ContextThemeWrapper
    }

    /**
     * @deprecated Use the new {@link DialogFragment} class with
     * {@link FragmentManager} instead; this is also
     * available on older platforms through the Android compatibility package.
     *
     * Removes any internal references to a dialog managed by this Activity.
     * If the dialog is showing, it will dismiss it as part of the clean up.
     *
@@ -2892,6 +2934,7 @@ public class Activity extends ContextThemeWrapper
     * @see #showDialog(int)
     * @see #dismissDialog(int)
     */
    @Deprecated
    public final void removeDialog(int id) {
        if (mManagedDialogs != null) {
            final ManagedDialog md = mManagedDialogs.get(id);
+10 −0
Original line number Diff line number Diff line
@@ -164,11 +164,21 @@ final class FragmentState implements Parcelable {
 *
 * <p>Topics covered here:
 * <ol>
 * <li><a href="#OlderPlatforms">Older Platforms</a>
 * <li><a href="#Lifecycle">Lifecycle</a>
 * <li><a href="#Layout">Layout</a>
 * <li><a href="#BackStack">Back Stack</a>
 * </ol>
 *
 * <a name="OlderPlatforms"></a>
 * <h3>Older Platforms</h3>
 *
 * While the Fragment API was introduced in
 * {@link android.os.Build.VERSION_CODES#HONEYCOMB}, a version of the API
 * is also available for use on older platforms.  See the blog post
 * <a href="http://android-developers.blogspot.com/2011/03/fragments-for-all.html">
 * Fragments For All</a> for more details.
 *
 * <a name="Lifecycle"></a>
 * <h3>Lifecycle</h3>
 *
+20 −0
Original line number Diff line number Diff line
@@ -35,6 +35,12 @@ public class KeyguardManager {
    private IWindowManager mWM;

    /**
     * @deprecated Use {@link android.view.WindowManager.LayoutParams#FLAG_DISMISS_KEYGUARD}
     * and/or {@link android.view.WindowManager.LayoutParams#FLAG_SHOW_WHEN_LOCKED}
     * instead; this allows you to seamlessly hide the keyguard as your application
     * moves in and out of the foreground and does not require that any special
     * permissions be requested.
     *
     * Handle returned by {@link KeyguardManager#newKeyguardLock} that allows
     * you to disable / reenable the keyguard.
     */
@@ -103,6 +109,12 @@ public class KeyguardManager {
    }

    /**
     * @deprecated Use {@link android.view.WindowManager.LayoutParams#FLAG_DISMISS_KEYGUARD}
     * and/or {@link android.view.WindowManager.LayoutParams#FLAG_SHOW_WHEN_LOCKED}
     * instead; this allows you to seamlessly hide the keyguard as your application
     * moves in and out of the foreground and does not require that any special
     * permissions be requested.
     *
     * Enables you to lock or unlock the keyboard. Get an instance of this class by
     * calling {@link android.content.Context#getSystemService(java.lang.String) Context.getSystemService()}. 
     * This class is wrapped by {@link android.app.KeyguardManager KeyguardManager}.
@@ -112,6 +124,7 @@ public class KeyguardManager {
     * @return A {@link KeyguardLock} handle to use to disable and reenable the
     *   keyguard.
     */
    @Deprecated
    public KeyguardLock newKeyguardLock(String tag) {
        return new KeyguardLock(tag);
    }
@@ -168,6 +181,12 @@ public class KeyguardManager {
    }

    /**
     * @deprecated Use {@link android.view.WindowManager.LayoutParams#FLAG_DISMISS_KEYGUARD}
     * and/or {@link android.view.WindowManager.LayoutParams#FLAG_SHOW_WHEN_LOCKED}
     * instead; this allows you to seamlessly hide the keyguard as your application
     * moves in and out of the foreground and does not require that any special
     * permissions be requested.
     *
     * Exit the keyguard securely.  The use case for this api is that, after
     * disabling the keyguard, your app, which was granted permission to
     * disable the keyguard and show a limited amount of information deemed
@@ -181,6 +200,7 @@ public class KeyguardManager {
     *   it is safe to launch anything that would normally be considered safe
     *   once the user has gotten past the keyguard.
     */
    @Deprecated
    public void exitKeyguardSecurely(final OnKeyguardExitResult callback) {
        try {
            mWM.exitKeyguardSecurely(new IOnKeyguardExitResult.Stub() {
+7 −1
Original line number Diff line number Diff line
@@ -34,12 +34,18 @@ import java.lang.reflect.Modifier;
 * {@link android.content.CursorLoader}, however applications are free to write
 * their own loaders for loading other types of data.
 *
 * While the LoaderManager API was introduced in
 * {@link android.os.Build.VERSION_CODES#HONEYCOMB}, a version of the API
 * is also available for use on older platforms.  See the blog post
 * <a href="http://android-developers.blogspot.com/2011/03/fragments-for-all.html">
 * Fragments For All</a> for more details.
 *
 * <p>As an example, here is the full implementation of a {@link Fragment}
 * that displays a {@link android.widget.ListView} containing the results of
 * a query against the contacts content provider.  It uses a
 * {@link android.content.CursorLoader} to manage the query on the provider.
 *
 * {@sample development/samples/ApiDemos/src/com/example/android/apis/app/FragmentListCursorLoader.java
 * {@sample development/samples/ApiDemos/src/com/example/android/apis/app/LoaderCursor.java
 *      fragment_cursor}
 */
public abstract class LoaderManager {
Loading