summaryrefslogtreecommitdiffstats
path: root/core/java/android/view/WindowManagerPolicy.java
Commit message (Collapse)AuthorAgeFilesLines
* Fix policy issues when screen is off. (DO NOT MERGE)Jeff Brown2010-12-221-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewrote interceptKeyBeforeQueueing to make the handling more systematic. Behavior should be identical except: - We never pass keys to applications when the screen is off and the keyguard is not showing (the proximity sensor turned off the screen). Previously we passed all non-wake keys through in this case which caused a bug on Crespo where the screen would come back on if a soft key was held at the time of power off because the resulting key up event would sneak in just before the keyguard was shown. It would then be passed through to the dispatcher which would poke user activity and wake up the screen. - We propagate the key flags when broadcasting media keys which ensures that recipients can tell when the key is canceled. - We ignore endcall or power if canceled (shouldn't happen anyways). Changed the input dispatcher to not poke user activity for canceled events since they are synthetic and should not wake the device. Changed the lock screen so that it does not poke the wake lock when the grab handle is released. This fixes a bug where the screen would come back on immediately if the power went off while the user was holding one of the grab handles because the sliding tab would receive an up event after screen turned off and release the grab handles. Bug: 3144874 Change-Id: Iebb91e10592b4ef2de4b1dd3a2e1e4254aacb697
* Fix an event injection bug when the policy is bypassed.Jeff Brown2010-10-111-0/+1
| | | | | | | | | | Added the concept of a "trusted" event to distinguish between events from attached input devices or trusted injectors vs. other applications. This change enables us to move certain policy decisions out of the dispatcher and into the policy itself where they can be handled more systematically. Change-Id: I4d56fdcdd31aaa675d452088af39a70c4e039970
* Added more robust tracking and cancelation of events.Jeff Brown2010-10-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | This change fixes several issues where events would be dropped in the input dispatch pipeline in such a way that the dispatcher could not accurately track the state of the input device. Given more robust tracking, we can now also provide robust cancelation of input events in cases where an application might otherwise become out of sync with the event stream due to ANR, app switch, policy decisions, or forced focus transitions. Pruned some of the input dispatcher log output. Moved the responsibility for calling intercept*BeforeQueueing into the input dispatcher instead of the input reader and added support for early interception of injected events for events coming from trusted sources. This enables behaviors like injection of media keys while the screen is off, haptic feedback of injected virtual keys, so injected events become more "first class" in a way. Change-Id: Iec6ff1dd21e5f3c7feb80ea4feb5382bd090dbd9
* Support haptic feedback for virtual keys defined in key layout.Jeff Brown2010-10-011-0/+1
| | | | Change-Id: I83e4108a87332692e03791dc066206becbc7941f
* Fix build.Dianne Hackborn2010-10-011-18/+0
| | | | Change-Id: I99d362e6673252ade4da29f29852eccaedbc9709
* Add support for secure views.Jeff Brown2010-09-081-0/+2
| | | | | | | | | | | | Added the MotionEvent.FLAG_WINDOW_IS_OBSCURED flag which is set by the input manager whenever another visible window is partly or wholly obscured the target of a touch event so that applications can filter touches accordingly. Added a "filterTouchesWhenObscured" attribute to View which can be used to enable filtering of touches when the view's window is obscured. Change-Id: I936d9c85013fd2d77fb296a600528d30a29027d2
* Add support for the PointerLocation overlay.Jeff Brown2010-08-111-5/+0
| | | | | | | | | | This change involves adding a new method to IWindowManager, monitorInput() that returns an InputChannel to receive a copy of all input that is dispatched to applications. The caller must have the READ_INPUT_STATE permission to make this request (similar to other window manager methods such as getKeycodeState). Change-Id: Icd14d810174a5b2928671ef16de73af88302aea0
* More native input dispatch work.Jeff Brown2010-07-031-111/+20
| | | | | | | | | | Removed old input dispatch code. Refactored the policy callbacks. Pushed a tiny bit of the power manager state down to native. Fixed long press on MENU. Made the virtual key detection and cancelation a bit more precise. Change-Id: I5d8c1062f7ea0ab3b54c6fadb058c4d5f5a9e02e
* Native input event dispatching.Jeff Brown2010-06-281-1/+1
| | | | | | | | | Target identification is now fully native. Fixed a couple of minor issues related to input injection. Native input enabled by default, can be disabled by setting WindowManagerPolicy.ENABLE_NATIVE_INPUT_DISPATCH to false. Change-Id: I7edf66ed3e987cc9306ad4743ac57a116af452ff
* Native input dispatch rewrite work in progress.Jeff Brown2010-06-131-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old dispatch mechanism has been left in place and continues to be used by default for now. To enable native input dispatch, edit the ENABLE_NATIVE_DISPATCH constant in WindowManagerPolicy. Includes part of the new input event NDK API. Some details TBD. To wire up input dispatch, as the ViewRoot adds a window to the window session it receives an InputChannel object as an output argument. The InputChannel encapsulates the file descriptors for a shared memory region and two pipe end-points. The ViewRoot then provides the InputChannel to the InputQueue. Behind the scenes, InputQueue simply attaches handlers to the native PollLoop object that underlies the MessageQueue. This way MessageQueue doesn't need to know anything about input dispatch per-se, it just exposes (in native code) a PollLoop that other components can use to monitor file descriptor state changes. There can be zero or more targets for any given input event. Each input target is specified by its input channel and some parameters including flags, an X/Y coordinate offset, and the dispatch timeout. An input target can request either synchronous dispatch (for foreground apps) or asynchronous dispatch (fire-and-forget for wallpapers and "outside" targets). Currently, finding the appropriate input targets for an event requires a call back into the WindowManagerServer from native code. In the future this will be refactored to avoid most of these callbacks except as required to handle pending focus transitions. End-to-end event dispatch mostly works! To do: event injection, rate limiting, ANRs, testing, optimization, etc. Change-Id: I8c36b2b9e0a2d27392040ecda0f51b636456de25
* Further improvements to window management!Dianne Hackborn2010-03-101-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | Fix issue #2493497: Stuck in the Emergency dialer - Home/Back keys doesn't work This was another case of not updating the window focus when needed, this time when the lock screen was hidden. Also re-arrange the layout/animate flow to address issues where you would see a flicker of whatever was behind the lock screen when showing a new activity that hides the lock screen. This was because we were deciding to hide the lock screen during the layout phase, which meant we had to do it without considering whether it had drawn. So we could hide the lock screen before the window is shown for the first time after being drawn. Now we can do this in the policy during animate, so we can wait until the window is drawn and actually being shown. The flow in perform layout is thus significantly changed, where the layout and animate loops are both under the same repeating loop. The actual flow from this should be the same, but it now allows the policy to request a new layout after the animation loop is done. This actually cleans up a number of things in this code as the complexity has increased. Finally this includes a change to the ui mode manager when switching modes, to do the resource configuration switch at a different time. This makes transitions between modes much cleaner (though not yet perfect). Change-Id: I5d9e75c1e79df1106108dd522f8ffed6058ef82b
* Add Pointer Location to the window manager.Dianne Hackborn2010-02-121-0/+5
| | | | | The window manager now has pointer location built into it. Viva la touch!
* Support for triggering the lockscreen while the screen is on:Mike Lockwood2010-01-291-0/+6
| | | | | | | | | | | Add new ALLOW_LOCK_WHILE_SCREEN_ON window manager flag, which when set causes the window manager to put up the lockscreen after the normal screen timeout has elapsed. Add plumbing to pass PowerManager.userActivity() to the window manager policy. Change-Id: I05adc52bad39c56031a08e8ec3cbcf5c2d9b9827 Signed-off-by: Mike Lockwood <lockwood@android.com>
* More device admin.Dianne Hackborn2010-01-281-3/+8
| | | | | - Clean up device policy manager APIs. - Implement lockNow(). For now this just turns the screen off to lock the device.
* Don't perform app transition of the app is not currently visible.Dianne Hackborn2009-12-211-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | Yet more special casing for the window manager... try really hard, if we are performing an activity transition that is behind an opaque window (like say the lock screen or status bar) to just not do it. And, just as important, do a reasonable transition away from whatever is on top. Examples: - If the lock screen is up, and you get a call or press the emergency dialer button, we fade from the lock screen to the new UI, instead of fading to the animation going on between the old and new. - If you are in something hiding the lock screen, like the in-call screen, and that is hidden, then fade back to the lock screen. - If you select an item from the status bar, then have the new item displayed behind it as the status bar rolls up rather than seeing a second animation. (In fact this can't always be done because we may not start the transition to the new thing until the status bar is already going away. But for most cases we can do this with just one anim.)
* am 678c2e35: Merge change I9ef88863 into eclairMike Lockwood2009-12-031-0/+2
|\ | | | | | | | | | | | | Merge commit '678c2e35768a5426b4ad8f67c836008e7751a353' into eclair-mr2 * commit '678c2e35768a5426b4ad8f67c836008e7751a353': Add WindowManagerPolicy.OFF_BECAUSE_OF_PROX_SENSOR to indicate screen was turned off by the proximity sensor.
| * Add WindowManagerPolicy.OFF_BECAUSE_OF_PROX_SENSOR to indicate screen was ↵Mike Lockwood2009-12-031-0/+2
| | | | | | | | | | | | | | | | | | turned off by the proximity sensor. Part of a fix for bug b/2300622 (Proximity sensor always blows up the lock screen while in call) Change-Id: I9ef888638b19540a78a34507d52ff522f505102f Signed-off-by: Mike Lockwood <lockwood@android.com>
* | Remove some unused window manager methods.Mike Lockwood2009-11-281-24/+0
|/ | | | | Change-Id: I1c28150416b92b96b9f434270652c4be2613434c Signed-off-by: Mike Lockwood <lockwood@android.com>
* Add WindowManagerPolicy.allowKeyRepeat() method for disabling key repeats.Mike Lockwood2009-10-211-0/+5
| | | | | | | Part of a fix for bug b/2198537 Change-Id: I99dc64772fa7644b12432d5549603025196ea3e2 Signed-off-by: Mike Lockwood <lockwood@android.com>
* More fix #2163209: alarm clock rings but is hidden behind lock screenDianne Hackborn2009-10-071-0/+7
| | | | | | | | There was another way we could ignore the application windows flags while the lock screen was displayed. This is the infrastructure to deal with that. Change-Id: Id8c9cb2f7081df6757ccb797a7cde618e82f7b38
* Fix issue #2149145: Safe Mode does not work on Sholes deviceDianne Hackborn2009-09-281-1/+1
| | | | | | | | | | | | | | | The APIs for checking whether keys are held down now also look at virtual keys. However it turns out there is less than a second between the time we start the input thread and check for safe mode, so there is not enough time to actually open all of the devices and get the data from them about the finger being down to determine if a virtual key is down. So now you can also hold DPAD center, trackball center, or s to enter safe mode. Also give some vibrator feedback. Change-Id: I55edce63bc0c375813bd3751766b8070beeb0153
* A variety of work on animations.Dianne Hackborn2009-09-251-15/+45
| | | | | | | | | | | | | | | - The lock screen now fades in and out. - Fixed a bug where we would accidentally freeze the screen when switching to an activity with a different orientation than the current (but the screen itself is in the current orientation). This would mess up the animations on the car dock. - New API to force a particular animation for an activity transition (untested). - New wallpaper animations. - Resources now uses the next API version when in a development build, to help applications being developed against such builds. Change-Id: I2d9998f8400967ff09a04d693dc4ce55f0dbef5b
* Various fixes and improvements to window, activity.Dianne Hackborn2009-09-221-3/+10
| | | | | | | | | | | | | | | | | | | - New meta-data you can add to a dock activity to have it launched by the home key when the device is in that dock. - Fix a deadlock involving ActivityThread's internal content provider lock. - New window flag to have a non-secure keyguard entirely dismissed when a window is displayed. - New WindowManagerPolicy APIs to allow the policy to tell the system when a change it makes during layout may cause the wall paper or overall configuration to change. - Fix a bug where an application token removed while one of its windows is animating could cause the animating window to get stuck on screen. Change-Id: I6d33fd39edd796bb9bdfd9dd7e077b84ca62ea08
* Turn animations on by default.Dianne Hackborn2009-09-211-1/+3
| | | | | | | | | | | | | | | Add API to skip the animation for a particular start activity, so that a latter better one can be used. Fix Theme.NoDisplay to actually work. Fiddle with various animations: don't do a different animation for task switching, try a scale animation for switching in/out of the wallpaper. Adjust the animation duration so that at normal speed we have something more like the slower animation option (so slow is now the default). Change-Id: Ieba9f3db0bd9a762a19b327a3ecccbc7b547893d
* Show the live wallpaper on the lock screen.Dianne Hackborn2009-09-181-0/+6
| | | | | | | | | | This also takes care of the problem of system dialogs like the crash dialog causing the status bar to dim behind the lock screen. On the down side, the fade transition from the lock screen is now gone, and I'm not sure how likely it is for it to return. Change-Id: I7f9e6d0f3510a1fdbbe6ad252d986bd85a16475d
* Revert "Don't activate keyguard if screen is turned off while proximity ↵Mike Lockwood2009-09-171-2/+0
| | | | | | sensor is active." This reverts commit ddfe879b783ad72603308e28e8f683454464684e.
* Wallpapers: new transitions, hiding when not visible, other cleanup.Dianne Hackborn2009-09-041-2/+8
| | | | | | | | | | | | | | | | | | This is work on the transitions with wallpapers. There are now new animations specifically for leaving the wallpaper and returning to it, which allow us to have a consistent animation when entering home and returning to it. I also renamed the existing animations across wallpapers, and cleaned up some junk in the various interpolators. This also now hides the wallpaper surface when it is not visible, to get rid of the wallpaper flickers people complained about albeit in a somewhat brutal way. :) (Though really returning us to the previous behavior with the same previous bugs and name back to them not being very visible, yay!) There is are also some bug fixes here and there about managing the wallpaper visibility that this change revealed. Change-Id: I913990a9a81651728122ed2e1101b75ed2c36fcb
* Don't activate keyguard if screen is turned off while proximity sensor is ↵Mike Lockwood2009-08-271-0/+2
| | | | | | active. Signed-off-by: Mike Lockwood <lockwood@android.com>
* Add wallpaper transition animations.Dianne Hackborn2009-08-191-0/+6
| | | | | | | The window manager now detects when a transition between two wallpaper activities is happening, and switches to a new set of animations for that. The animations I defined here are just an arbitrary something that can work in this case.
* Add support for power keys, improve behavior of virtual keys.Dianne Hackborn2009-07-241-2/+10
| | | | | | | | | | | The platform now knows how to deal with a platform key, which at this point is "just like end call, but don't end a call." Also improve the handling of virtual keys, to allow for canceling when sliding off into the display and providing haptic feedback. Finally fixes a bug where the raw x and y in motion event were not always set which caused the status bar to not work.
* AI 143901: am: CL 143899 am: CL 143896 Fix issue #1748954 and #1737952:Dianne Hackborn2009-03-311-1/+4
| | | | | | | | | | | | | #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/... Original author: android-build Merged from: //branches/donutburger/... Automated import of CL 143901
* auto import from //branches/cupcake/...@137873The Android Open Source Project2009-03-111-5/+5
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-0/+796
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-796/+0
|
* auto import from //branches/cupcake/...@132569The Android Open Source Project2009-02-201-3/+14
|
* auto import from //branches/cupcake/...@131421The Android Open Source Project2009-02-131-0/+11
|
* auto import from //branches/cupcake/...@130745The Android Open Source Project2009-02-101-4/+13
|
* auto import from //branches/cupcake/...@127436The Android Open Source Project2009-01-221-2/+10
|
* Code drop from //branches/cupcake/...@124589The Android Open Source Project2008-12-171-44/+84
|
* Initial ContributionThe Android Open Source Project2008-10-211-0/+717