There was code in PhoneWindowManager from last time when
the search dialog was a system dialog that caused an exception
if the search was added to the window manager twice.
Generally there should only be one search bar, but because
window manager calls are asynchronous and don't execute in order,
we can't be sure that a call to stopSearch() has removed the search
dialog before a subsequent call to startSearch() tries to add it again.
SearchManagerTest.testSearchManagerFastInvocations() crashed the system
process before this change.
boolean mSafeMode;
WindowState mStatusBar = null;
- WindowState mSearchBar = null;
WindowState mKeyguard = null;
KeyguardViewMediator mKeyguardMediator;
GlobalActions mGlobalActions;
* Currently enforces that three window types are singletons:
* <ul>
* <li>STATUS_BAR_TYPE</li>
- * <li>SEARCH_BAR_TYPE</li>
* <li>KEYGUARD_TYPE</li>
* </ul>
*
}
mStatusBar = win;
break;
- case TYPE_SEARCH_BAR:
- if (mSearchBar != null) {
- return WindowManagerImpl.ADD_MULTIPLE_SINGLETON;
- }
- mSearchBar = win;
- break;
case TYPE_KEYGUARD:
if (mKeyguard != null) {
return WindowManagerImpl.ADD_MULTIPLE_SINGLETON;
if (mStatusBar == win) {
mStatusBar = null;
}
- else if (mSearchBar == win) {
- mSearchBar = null;
- }
else if (mKeyguard == win) {
mKeyguard = null;
}