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

Commit 16c8d8a5 authored by Winson Chung's avatar Winson Chung
Browse files

Re-enabling queued unbinding of services after requests to the service. (3394210)

- Fix for crash when detaching from window
- Potential fix for occasional IllegalStateException when updating List based widgets

Change-Id: I3d3f2bb691552a1136111043db686c4926b510c6
parent 5dcc9bd7
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -238822,7 +238822,7 @@
>
</method>
<method name="onRemoteAdapterConnected"
 return="void"
 return="boolean"
 abstract="false"
 native="false"
 synchronized="false"
@@ -240800,7 +240800,7 @@
>
</method>
<method name="onRemoteAdapterConnected"
 return="void"
 return="boolean"
 abstract="false"
 native="false"
 synchronized="false"
@@ -260418,7 +260418,7 @@
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="arg0" type="T">
<parameter name="t" type="T">
</parameter>
</method>
</interface>
+3 −3
Original line number Diff line number Diff line
@@ -238833,7 +238833,7 @@
>
</method>
<method name="onRemoteAdapterConnected"
 return="void"
 return="boolean"
 abstract="false"
 native="false"
 synchronized="false"
@@ -240811,7 +240811,7 @@
>
</method>
<method name="onRemoteAdapterConnected"
 return="void"
 return="boolean"
 abstract="false"
 native="false"
 synchronized="false"
@@ -260429,7 +260429,7 @@
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="arg0" type="T">
<parameter name="t" type="T">
</parameter>
</method>
</interface>
+4 −1
Original line number Diff line number Diff line
@@ -5289,12 +5289,15 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
    /**
     * Called back when the adapter connects to the RemoteViewsService.
     */
    public void onRemoteAdapterConnected() {
    public boolean onRemoteAdapterConnected() {
        if (mRemoteAdapter != mAdapter) {
            setAdapter(mRemoteAdapter);
            return false;
        } else if (mRemoteAdapter != null) {
            mRemoteAdapter.superNotifyDataSetChanged();
            return true;
        }
        return false;
    }

    /**
+26 −3
Original line number Diff line number Diff line
@@ -53,6 +53,12 @@ public abstract class AdapterViewAnimator extends AdapterView<Adapter>
     */
    int mWhichChild = 0;

    /**
     * The index of the child to restore after the asynchronous connection from the
     * RemoteViewsAdapter has been.
     */
    private int mRestoreWhichChild = -1;

    /**
     * Whether or not the first view(s) should be animated in
     */
@@ -780,8 +786,16 @@ public abstract class AdapterViewAnimator extends AdapterView<Adapter>
        // set mWhichChild
        mWhichChild = ss.whichChild;

        // When using RemoteAdapters, the async connection process can lead to
        // onRestoreInstanceState to be called before setAdapter(), so we need to save the previous
        // values to restore the list position after we connect, and can skip setting the displayed
        // child until then.
        if (mRemoteViewsAdapter != null && mAdapter == null) {
            mRestoreWhichChild = mWhichChild;
        } else {
            setDisplayedChild(mWhichChild);
        }
    }

    /**
     * Shows only the specified child. The other displays Views exit the screen
@@ -956,12 +970,21 @@ public abstract class AdapterViewAnimator extends AdapterView<Adapter>
    /**
     * Called back when the adapter connects to the RemoteViewsService.
     */
    public void onRemoteAdapterConnected() {
    public boolean onRemoteAdapterConnected() {
        if (mRemoteViewsAdapter != mAdapter) {
            setAdapter(mRemoteViewsAdapter);

            // Restore the previous position (see onRestoreInstanceState)
            if (mRestoreWhichChild > -1) {
                setDisplayedChild(mRestoreWhichChild);
                mRestoreWhichChild = -1;
            }
            return false;
        } else if (mRemoteViewsAdapter != null) {
            mRemoteViewsAdapter.superNotifyDataSetChanged();
            return true;
        }
        return false;
    }

    /**
@@ -994,7 +1017,7 @@ public abstract class AdapterViewAnimator extends AdapterView<Adapter>

    @Override
    protected void onDetachedFromWindow() {
        mAdapter = null;
        setAdapter(null);
        super.onDetachedFromWindow();
    }
}
+306 −197

File changed.

Preview size limit exceeded, changes collapsed.

Loading