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

Commit 247fe74c authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Implement issue # 3255887 could CursorLoader offer...

...to throttle contentobserver-based requeries

Why yes, I guess it could.

This also reworks AsyncTaskLoader to not generate multiple
concurrent tasks if it is getting change notifications before
the last background task is complete.

And removes some of the old APIs that had been deprecated but
need to be gone for final release.

And fixes a few little problems with applying the wrong theme
in system code.

Change-Id: Ic7a665b666d0fb9d348e5f23595532191065884f
parent f600780b
Loading
Loading
Loading
Loading
+42 −55
Original line number Diff line number Diff line
@@ -22817,32 +22817,6 @@
<parameter name="args" type="java.lang.String[]">
</parameter>
</method>
<method name="findFragmentById"
 return="android.app.Fragment"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="deprecated"
 visibility="public"
>
<parameter name="id" type="int">
</parameter>
</method>
<method name="findFragmentByTag"
 return="android.app.Fragment"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="deprecated"
 visibility="public"
>
<parameter name="tag" type="java.lang.String">
</parameter>
</method>
<method name="findViewById"
 return="android.view.View"
 abstract="false"
@@ -24065,17 +24039,6 @@
<parameter name="view" type="android.view.View">
</parameter>
</method>
<method name="openFragmentTransaction"
 return="android.app.FragmentTransaction"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="deprecated"
 visibility="public"
>
</method>
<method name="openOptionsMenu"
 return="void"
 abstract="false"
@@ -43623,6 +43586,30 @@
<parameter name="data" type="D">
</parameter>
</method>
<method name="onLoadInBackground"
 return="D"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="protected"
>
</method>
<method name="setUpdateThrottle"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="delayMS" type="long">
</parameter>
</method>
<method name="waitForLoader"
 return="void"
 abstract="false"
@@ -50212,21 +50199,6 @@
<parameter name="cursor" type="android.database.Cursor">
</parameter>
</method>
<method name="registerContentObserver"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="cursor" type="android.database.Cursor">
</parameter>
<parameter name="observer" type="android.database.ContentObserver">
</parameter>
</method>
<method name="setProjection"
 return="void"
 abstract="false"
@@ -55453,7 +55425,7 @@
 native="false"
 synchronized="false"
 static="false"
 final="true"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
@@ -55578,7 +55550,7 @@
 native="false"
 synchronized="false"
 static="false"
 final="true"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
@@ -55600,7 +55572,7 @@
 native="false"
 synchronized="false"
 static="false"
 final="true"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
@@ -68017,6 +67989,21 @@
<parameter name="selectionArgs" type="java.lang.String[]">
</parameter>
</method>
<method name="concatenateWhere"
 return="java.lang.String"
 abstract="false"
 native="false"
 synchronized="false"
 static="true"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="a" type="java.lang.String">
</parameter>
<parameter name="b" type="java.lang.String">
</parameter>
</method>
<method name="createDbFromSqlStatements"
 return="void"
 abstract="false"
+0 −36
Original line number Diff line number Diff line
@@ -73,13 +73,11 @@ import android.view.Window;
import android.view.WindowManager;
import android.view.accessibility.AccessibilityEvent;
import android.widget.AdapterView;
import android.widget.FrameLayout;

import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * An activity is a single, focused thing that the user can do.  Almost all
@@ -1579,16 +1577,6 @@ public class Activity extends ContextThemeWrapper
        return mFragments;
    }

    /**
     * Start a series of edit operations on the Fragments associated with
     * this activity.
     * @deprecated use {@link #getFragmentManager}.
     */
    @Deprecated
    public FragmentTransaction openFragmentTransaction() {
        return mFragments.openTransaction();
    }
    
    void invalidateFragmentIndex(int index) {
        //Log.v(TAG, "invalidateFragmentIndex: index=" + index);
        if (mAllLoaderManagers != null) {
@@ -1769,30 +1757,6 @@ public class Activity extends ContextThemeWrapper
        mActionBar = new ActionBarImpl(this);
    }
    
    /**
     * Finds a fragment that was identified by the given id either when inflated
     * from XML or as the container ID when added in a transaction.  This only
     * returns fragments that are currently added to the activity's content.
     * @return The fragment if found or null otherwise.
     * @deprecated use {@link #getFragmentManager}.
     */
    @Deprecated
    public Fragment findFragmentById(int id) {
        return mFragments.findFragmentById(id);
    }
    
    /**
     * Finds a fragment that was identified by the given tag either when inflated
     * from XML or as supplied when added in a transaction.  This only
     * returns fragments that are currently added to the activity's content.
     * @return The fragment if found or null otherwise.
     * @deprecated use {@link #getFragmentManager}.
     */
    @Deprecated
    public Fragment findFragmentByTag(String tag) {
        return mFragments.findFragmentByTag(tag);
    }
    
    /**
     * Set the activity content from a layout resource.  The resource will be
     * inflated, adding all top-level views to the activity.
+5 −0
Original line number Diff line number Diff line
@@ -484,6 +484,11 @@ class ContextImpl extends Context {
        mThemeResource = resid;
    }

    @Override
    public int getThemeResId() {
        return mThemeResource;
    }

    @Override
    public Resources.Theme getTheme() {
        if (mTheme == null) {
+1 −1
Original line number Diff line number Diff line
@@ -211,7 +211,7 @@ public class DialogFragment extends Fragment
     */
    @Deprecated
    public void show(Activity activity, String tag) {
        FragmentTransaction ft = activity.openFragmentTransaction();
        FragmentTransaction ft = activity.getFragmentManager().openTransaction();
        ft.add(this, tag);
        ft.commit();
    }
+4 −4
Original line number Diff line number Diff line
@@ -24,8 +24,8 @@ public abstract class FragmentTransaction {
     * @param fragment The fragment to be added.  This fragment must not already
     * be added to the activity.
     * @param tag Optional tag name for the fragment, to later retrieve the
     * fragment with {@link Activity#findFragmentByTag(String)
     * Activity.findFragmentByTag(String)}.
     * fragment with {@link FragmentManager#findFragmentByTag(String)
     * FragmentManager.findFragmentByTag(String)}.
     * 
     * @return Returns the same FragmentTransaction instance.
     */
@@ -47,8 +47,8 @@ public abstract class FragmentTransaction {
     * to be replaced.
     * @param fragment The new fragment to place in the container.
     * @param tag Optional tag name for the fragment, to later retrieve the
     * fragment with {@link Activity#findFragmentByTag(String)
     * Activity.findFragmentByTag(String)}.
     * fragment with {@link FragmentManager#findFragmentByTag(String)
     * FragmentManager.findFragmentByTag(String)}.
     * 
     * @return Returns the same FragmentTransaction instance.
     */
Loading