Merge "Fallback to old Window.Callback#onWindowStartingActionMode" into mnc-dev

This commit is contained in:
Clara Bayarri
2015-06-09 17:18:48 +00:00
committed by Android (Google) Code Review

View File

@@ -2741,7 +2741,14 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
try {
mode = getCallback().onWindowStartingActionMode(wrappedCallback, type);
} catch (AbstractMethodError ame) {
// Older apps might not implement this callback method.
// Older apps might not implement the typed version of this method.
if (type == ActionMode.TYPE_PRIMARY) {
try {
mode = getCallback().onWindowStartingActionMode(wrappedCallback);
} catch (AbstractMethodError ame2) {
// Older apps might not implement this callback method at all.
}
}
}
}
if (mode != null) {