Oh, you mean AppWindowManager.getActiveApp();?
Please have LayoutManager listen to searchopened/searchclosed and fire hidewindow with screenshot = true to let AppWindowManager to hide the current app.
https://github.com/mozilla-b2g/gaia/blob/master/apps/system/js/visibility_manager.js#L81
https://github.com/mozilla-b2g/gaia/blob/master/apps/system/js/app_window_manager.js#L410