From: Bjorn Bringert Date: Mon, 8 Jun 2009 22:20:15 +0000 (+0100) Subject: Don't enforce that search dialog is a singleton. X-Git-Tag: android-x86-1.6~12^2~7 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=6e09858c0bd13a321ed716b670b361e62b1536e4;p=android-x86%2Fframeworks-policies-base.git Don't enforce that search dialog is a singleton. 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. --- diff --git a/phone/com/android/internal/policy/impl/PhoneWindowManager.java b/phone/com/android/internal/policy/impl/PhoneWindowManager.java index 6c66b3f..afad7bb 100644 --- a/phone/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/phone/com/android/internal/policy/impl/PhoneWindowManager.java @@ -160,7 +160,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { boolean mSafeMode; WindowState mStatusBar = null; - WindowState mSearchBar = null; WindowState mKeyguard = null; KeyguardViewMediator mKeyguardMediator; GlobalActions mGlobalActions; @@ -702,7 +701,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { * Currently enforces that three window types are singletons: * * @@ -719,12 +717,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { } 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; @@ -740,9 +732,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { if (mStatusBar == win) { mStatusBar = null; } - else if (mSearchBar == win) { - mSearchBar = null; - } else if (mKeyguard == win) { mKeyguard = null; }