Re-arrange various things to ensure that the search dialog is told about system windows being
closed before it is told about the navigation back to home.
this way search can't dismiss itself. can't use the constant because it is
in policy. would rather leave it this way instead of moving constants for
system dialog dismissal to framework.
Previously, the global actions menu was closed when the keyguard was shown, but
when the menu was shown from within the keyguard, it wasn't closed ever again
when the screen goes off. That had the result that if your pocket managed to
bring up the dialog, the menu would likely never go away on its own, and
eventually do something awful like go into airplane mode.
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.
its shown. this lets the window manager to hide or unhide the keyguard based on activities that specify if they want to be displayed
inspite of the keyguard being shown or not.
#1748954 (New status bar fades into all white background): FrameLayout wasn't updating its foreground drawable when its padding changed, which would happen as the status bar is shown and hidden. To fix this I also ended up fixing a problem in the view debug stuff where we couldn't get a bitmap for a view that is the full screen size because it is too big... actually I just went ahead and added another function to snapshot the view hierarchy which works a lot better for us anyway.
#1737952 (Home screen icons overlap with the notification bar after exiting any camera app): Originally I punted this because it only happened in rare situations, but now that home is always portrait it happens a lot more so it is more important to fix. This involved a few things to clean up hiding/showing the status bar:
- We now determine when to hide and show it during layout, which allows us to do this at the time it is actually needed rather than during animation after we can actually catch it for the initial display of a window. This required tweaking the layout API so the policy can request a second layout pass if needed.
- When doing layout, we are now much more aggressive about skipping the layout of windows. Basically anything that we know will be hidden in the near future is ignored for layout, so that it doesn't glitch as it is transfered out of the screen. The theory being that it is better to leave it as it was originally placed while we are transitioning it out, than to switch it to something slightly more correct.
Original author: hackbod
Merged from: //branches/cupcake/...
Automated import of CL 143899
Also do most of the work for issue #1732012 (Only show screen rotation animation when triggered by sensor). This just needs to be hooked up to the surface flinger API when that appears.
Original author: hackbod
Merged from: //branches/cupcake/...
Automated import of CL 143169