diff options
author | Adam Powell <adamp@google.com> | 2010-11-15 22:16:50 -0800 |
---|---|---|
committer | Adam Powell <adamp@google.com> | 2010-11-15 22:16:50 -0800 |
commit | bf85f43e48d046fe214cdadfa553e85f909d2b76 (patch) | |
tree | 0c02fcc27c103e856f94aa48beab4690174326a0 /policy | |
parent | debf3bed9ea913ac55c80e1f9f7f33217054a943 (diff) | |
download | frameworks_base-bf85f43e48d046fe214cdadfa553e85f909d2b76.zip frameworks_base-bf85f43e48d046fe214cdadfa553e85f909d2b76.tar.gz frameworks_base-bf85f43e48d046fe214cdadfa553e85f909d2b76.tar.bz2 |
Add protection for ActionMode-related window callbacks that may not
implement new methods.
Change-Id: Id4463ee97366187ba43b0966f79aa8bd34f7fa1d
Diffstat (limited to 'policy')
-rw-r--r-- | policy/src/com/android/internal/policy/impl/PhoneWindow.java | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java index bb39c8f..18815f5 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java @@ -1832,7 +1832,12 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } final ActionMode.Callback wrappedCallback = new ActionModeCallbackWrapper(callback); - ActionMode mode = getCallback().onWindowStartingActionMode(wrappedCallback); + ActionMode mode = null; + try { + mode = getCallback().onWindowStartingActionMode(wrappedCallback); + } catch (AbstractMethodError ame) { + // Older apps might not implement this callback method. + } if (mode != null) { mActionMode = mode; } else { @@ -1877,7 +1882,11 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } } if (mActionMode != null) { - getCallback().onActionModeStarted(mActionMode); + try { + getCallback().onActionModeStarted(mActionMode); + } catch (AbstractMethodError ame) { + // Older apps might not implement this callback method. + } } return mActionMode; } @@ -2094,7 +2103,11 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { if (mActionModeView != null) { mActionModeView.removeAllViews(); } - getCallback().onActionModeFinished(mActionMode); + try { + getCallback().onActionModeFinished(mActionMode); + } catch (AbstractMethodError ame) { + // Older apps might not implement this callback method. + } mActionMode = null; } } |