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

Commit e955121d authored by Jim Miller's avatar Jim Miller
Browse files

Partial fix for blank widget page

The code really shouldn't select the page until after the view has been
removed and had a chance to measure itself.  The fix is to post a message
to select the correct widget page.

Bug 7334209

Change-Id: I5c2d59b00b3c502893da6000154ce6cdc79ecc1c
parent 4cce397c
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -740,17 +740,12 @@ public class KeyguardHostView extends KeyguardViewBase {
                public void onListenerDetached() {
                    int page = getWidgetPosition(R.id.keyguard_transport_control);
                    if (page != -1) {
                        if (page == mAppWidgetContainer.getCurrentPage()) {
                            // Switch back to clock view if music was showing.
                            mAppWidgetContainer
                                .setCurrentPage(getWidgetPosition(R.id.keyguard_status_view));
                        }
                        mAppWidgetContainer.removeView(mTransportControl);
                        // XXX keep view attached to hierarchy so we still get show/hide events
                        // from AudioManager
                        // XXX keep view attached so we still get show/hide events from AudioManager
                        KeyguardHostView.this.addView(mTransportControl);
                        mTransportControl.setVisibility(View.GONE);
                        mTransportState = TRANSPORT_GONE;
                        mTransportControl.post(mSwitchPageRunnable);
                    }
                }