diff options
author | Adam Powell <adamp@google.com> | 2011-05-03 17:20:14 -0700 |
---|---|---|
committer | Adam Powell <adamp@google.com> | 2011-05-03 17:30:48 -0700 |
commit | d1f4207ba577e2ac3f39a719f8ee4bb9f4940dc1 (patch) | |
tree | e37c6cb708998c9dc95b57b0b6b28f2bdede6fe1 /policy/src | |
parent | 0d42f17f5ef034314ed65c3df47ed8ca24d38a12 (diff) | |
download | frameworks_base-d1f4207ba577e2ac3f39a719f8ee4bb9f4940dc1.zip frameworks_base-d1f4207ba577e2ac3f39a719f8ee4bb9f4940dc1.tar.gz frameworks_base-d1f4207ba577e2ac3f39a719f8ee4bb9f4940dc1.tar.bz2 |
Fix bug 4355335 - android.app.cts.DialogTest.testContextMenu failing on IRJ28
Change-Id: Icfcd8c2aadd0fb9e49296b8318858317407e1b7f
Diffstat (limited to 'policy/src')
-rw-r--r-- | policy/src/com/android/internal/policy/impl/PhoneWindow.java | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java index 6a800f0..5d20e6a 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java @@ -1962,8 +1962,13 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { mContextMenu.clearAll(); } - mContextMenuHelper = mContextMenu.show(originalView, originalView.getWindowToken()); - return mContextMenuHelper != null; + final MenuDialogHelper helper = mContextMenu.show(originalView, + originalView.getWindowToken()); + if (helper != null) { + helper.setPresenterCallback(mContextMenuCallback); + } + mContextMenuHelper = helper; + return helper != null; } @Override @@ -3171,7 +3176,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { * <li> Calls back to the callback's onMenuItemSelected when an item is * selected. */ - private final class DialogMenuCallback implements MenuBuilder.Callback { + private final class DialogMenuCallback implements MenuBuilder.Callback, MenuPresenter.Callback { private int mFeatureId; private MenuDialogHelper mSubMenuHelper; @@ -3180,6 +3185,10 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } public void onCloseMenu(MenuBuilder menu, boolean allMenusAreClosing) { + if (menu.getRootMenu() != menu) { + onCloseSubMenu(menu); + } + if (allMenusAreClosing) { Callback callback = getCallback(); if (callback != null && !isDestroyed()) { @@ -3198,7 +3207,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } } - public void onCloseSubMenu(SubMenuBuilder menu) { + public void onCloseSubMenu(MenuBuilder menu) { Callback callback = getCallback(); if (callback != null && !isDestroyed()) { callback.onPanelClosed(mFeatureId, menu.getRootMenu()); @@ -3214,7 +3223,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { public void onMenuModeChange(MenuBuilder menu) { } - public boolean onSubMenuSelected(SubMenuBuilder subMenu) { + public boolean onOpenSubMenu(MenuBuilder subMenu) { // Set a simple callback for the submenu subMenu.setCallback(this); |