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

Commit 9790034e authored by Adam Powell's avatar Adam Powell
Browse files

Fix a search bug for wrapped Window.Callbacks

Guard a call to a new method for Window.Callback for apps that have
provided their own preexisting implementations of this interface. Fall
back to the older, 0-arg method if this is the case.

Bug 20254504

Change-Id: If8a731c36de43b333e63455d78376af32ccb86ea
parent cd1bbf29
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -4257,7 +4257,13 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
            if (deviceId != 0) {
                searchEvent = new SearchEvent(InputDevice.getDevice(deviceId));
            }
            try {
                result = cb.onSearchRequested(searchEvent);
            } catch (AbstractMethodError e) {
                Log.e(TAG, "WindowCallback " + cb.getClass().getName() + " does not implement"
                        + " method onSearchRequested(SearchEvent); fa", e);
                result = cb.onSearchRequested();
            }
        }
        if (!result && (getContext().getResources().getConfiguration().uiMode
                & Configuration.UI_MODE_TYPE_MASK) == Configuration.UI_MODE_TYPE_TELEVISION) {