Skip to content

Commit e955121

Browse files
author
Jim Miller
committed
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
1 parent 4cce397 commit e955121

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -740,17 +740,12 @@ private void initializeTransportControl() {
740740
public void onListenerDetached() {
741741
int page = getWidgetPosition(R.id.keyguard_transport_control);
742742
if (page != -1) {
743-
if (page == mAppWidgetContainer.getCurrentPage()) {
744-
// Switch back to clock view if music was showing.
745-
mAppWidgetContainer
746-
.setCurrentPage(getWidgetPosition(R.id.keyguard_status_view));
747-
}
748743
mAppWidgetContainer.removeView(mTransportControl);
749-
// XXX keep view attached to hierarchy so we still get show/hide events
750-
// from AudioManager
744+
// XXX keep view attached so we still get show/hide events from AudioManager
751745
KeyguardHostView.this.addView(mTransportControl);
752746
mTransportControl.setVisibility(View.GONE);
753747
mTransportState = TRANSPORT_GONE;
748+
mTransportControl.post(mSwitchPageRunnable);
754749
}
755750
}
756751

0 commit comments

Comments
 (0)