333 Commits

Author SHA1 Message Date
Jeff Brown
eb9f7a01b0 Fix policy issues when screen is off. (DO NOT MERGE)
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
2010-12-22 16:00:21 -08:00
Dianne Hackborn
e4a5951925 Fix issue #3154576: battery stats checkin should include UID -> packages+ map
Includes some other small fixes to battery collection and a few
other things.

Output of package info looks like this:

5,0,i,uid,1000,com.android.settings
5,0,i,uid,1000,com.android.providers.subscribedfeeds
5,0,i,uid,1000,com.android.providers.settings
5,0,i,uid,1000,com.android.server.vpn
5,0,i,uid,1000,android
5,0,i,uid,1000,com.android.systemui
5,0,i,uid,1000,com.google.android.backup
5,0,i,uid,1001,com.android.phone
5,0,i,uid,1001,com.android.providers.telephony
5,0,i,uid,1022,com.android.nfc
5,0,i,uid,10021,com.google.android.location
5,0,i,uid,10021,com.google.android.syncadapters.calendar
5,0,i,uid,10021,com.google.android.gsf
5,0,i,uid,10021,com.google.android.syncadapters.contacts
5,0,i,uid,10026,com.android.providers.downloads.ui
5,0,i,uid,10026,com.android.providers.media
5,0,i,uid,10026,com.android.providers.drm
5,0,i,uid,10026,com.android.providers.downloads
5,0,i,uid,10032,com.android.launcher
5,0,i,uid,10039,com.google.android.gm
5,0,i,uid,10041,com.google.android.gallery3d
5,0,i,uid,10049,com.android.providers.calendar

Change-Id: I9e38f254eef146339113ad270f5c6e8b60fb7a1d
2010-12-13 14:31:40 -08:00
Mathias Agopian
f9ce879e5c Revert "allow all 4 orientations"
This reverts commit 1d8d0159e72556ea20aba325fb27d8470282e1ba.

Change-Id: Iffd8cbad98ff7e498032df1d226f4fbc7cde95b1
2010-11-13 22:02:13 -08:00
Mathias Agopian
1d8d0159e7 allow all 4 orientations
Change-Id: Ia01b234d7d4e55cd4d8776e2a003ecf0cbd7d06f
2010-11-04 19:45:16 -07:00
Joe Onorato
431bb22695 Reduce logging.
Remember, the system and main logs are
    - Shared resources
    - Primarily for recording problems
    - To be used only for large grained events during normal operation

Bug: 3104855
Change-Id: I136fbd101917dcbc8ebc3f96f276426b48bde7b7
2010-10-19 15:08:05 -04:00
Jeff Brown
2d3f159aa9 Add support for secure system overlays. (DO NOT MERGE)
This change adds a new window type for secure system overlays
created by the system itself from non-secure system overlays that
might be created by applications that have the system alert permission.
Secure views ignore the presence of secure system overlays.

Bug: 3098519
Change-Id: I8f8398f4fdeb0469e5d71124c21bedf121bd8c07
2010-10-15 16:03:35 -07:00
Jeff Brown
3122e4488a Improve the input policy handling a bit.
Fixed some issues with Monkeys turning off their own screens.  Ook ook!
Added some more comments to explain what's going on.

Change-Id: Id2bc0466161a642a73ef7ef97725d1c81e984b12
2010-10-12 00:16:14 -07:00
Jeff Brown
b931a1b418 Fix an event injection bug when the policy is bypassed.
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
2010-10-11 16:26:13 -07:00
Dianne Hackborn
e5439f228f Fix issue #3041660: Camera image flips upside down when rotating device
Apps now must explicitly opt in to having their rotation changed while
forcing landscape mode.  Also add some new orientation constants for other
things apps may want to do.

Change-Id: If64d84b5ef54793ee717ebda9b4c76408efc9bfd
2010-10-04 14:01:39 -07:00
Dianne Hackborn
6493e64c2a Fix issue #3037083: Problem report for Pinball
The app was toggling between hiding and showing the status bar, because
the dialog was large enough to fill the screen but didn't set to hide
the status bar.

It turns out that the code to determine the top fullscreen window is
intrinsically unstable, since it relies on comparing a window's frame
with the screen, yet the window frame can change as a result of changes
such as hiding the status bar.

Instead, we now simplify all of this to just say that the top fillxfill
window gets to control the status bar.

Change-Id: I22913adf7235fe0d52612f6738c7c94351274e38
2010-10-01 13:06:30 -07:00
Steve Howard
a7bfe6ad76 Support "seascape" rotation for "landscape-only" apps
Change-Id: Ibbbd850dc2bfb741b39c04c982fbdd98f3fa4a67
2010-09-23 17:46:41 -07:00
Jeff Brown
93ed4e3052 Enforce serial ordering of MotionEvents.
This change modifies ViewRoot to wait until the MotionEvent has been
delivered before telling the input dispatcher that it is finished.
The serial ordering guarantee will be required by new features that
may need to transfer touch focus from one window to another.

Change-Id: I0a64d1f0c8bc3f08846f213d6e28ce48b1d48e58
2010-09-23 13:56:30 -07:00
Jeff Brown
8b7a982d29 Don't play a sound if a volume key press is canceled.
Change-Id: I8e45af20ec83a81565e10be3648b95686fa897af
2010-09-12 18:09:11 -07:00
Steve Howard
5eb49583e2 Improve orientation sensing when waking up while flat.
This change makes the window manager pass the currently displayed
orientation to the WindowOrientationListener each time to calls to get
the currently sensed orientation.  Now, when the
WindowOrientationListener doesn't know for sure what the orientation
of the device should be (for example, if the sensed orientation is
flat on a table), then it trusts the already-displayed orientation,
rather than trusting whatever sensors reading it most recently
received.

The main use case this addresses is:
* user uses device in portrait
* user turns off device, puts it in pocket
* while in pocket, screen gets turned on, activating orientaiton
  sensor, which senses landscape orientation
* screen timed out
* user takes device out, places it on a table (or looks down at it,
  holding it flat), and unlocks it

Previously, when the device was unlocked, the
WindowOrientationListener would return landscape orientation based on
its previous sensor readings.  Now, it will override those previous
readings because it knows they never actually took effect and the
device is presently flat.

This change also slightly modifies the way we handle flat orientation,
now completely ignoring data when the tilt distrust is nonzero (even
if the current sensor reading shows non-tilted).

Change-Id: Ia4950a41827f8c53a80487d0c2e83b556df781b9
2010-08-18 14:22:19 -07:00
Jeff Brown
a41ca77fab Add support for the PointerLocation overlay.
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
2010-08-11 14:46:32 -07:00
Dianne Hackborn
d76b67c340 IME events are now dispatched to native applications.
And also:

- APIs to show and hide the IME, and control its interaction with the app.
- APIs to tell the app when its window resizes and needs to be redrawn.
- API to tell the app the content rectangle of its window (to layout
  around the IME or status bar).

There is still a problem with IME interaction -- we need a way for the
app to deliver events to the IME before it handles them, so that for
example the back key will close the IME instead of finishing the app.

Change-Id: I37b75fc2ec533750ef36ca3aedd2f0cc0b5813cd
2010-07-13 18:36:46 -07:00
Jeff Brown
00fa7bdd69 More native input dispatch work.
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
2010-07-03 19:23:01 -07:00
Dianne Hackborn
1e4b9f3936 Remove InputConsumer, replacing with InputQueue.
Change-Id: Ib06907278457aaee842b123adc072840ca3602d8
2010-06-23 14:37:30 -07:00
Dianne Hackborn
a95e4cb62f First stab at attaching native event dispatching.
Provides the basic infrastructure for a
NativeActivity's native code to get an object representing
its event stream that can be used to read input events.

Still work to do, probably some API changes, and reasonable
default key handling (so that for example back will still
work).

Change-Id: I6db891bc35dc9683181d7708eaed552b955a077e
2010-06-22 11:21:50 -07:00
Brett Chabot
be81f4f15d Move out all framework-tests classes.
Previously tests/framework-tests contained a quarantined set of test classes
that needed access to package-private framework api. Running these tests
normally would cause the dalvik verifier to throw errors.

runtest now has support for turning off the dalvik verifier for frameworks
tests, so move this tests into their recommended location, close to the source
being tested.

Also move policy source into a 'src' folder to accommodate the tests move.

Change-Id: I62f839da185a55bc553b653bf583fd99da438512
2010-06-14 17:23:08 -07:00
Jeff Brown
46b9ac0ae2 Native input dispatch rewrite work in progress.
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
2010-06-13 17:42:16 -07:00
Joe Onorato
8bc6c51419 Require the STATUS_BAR_SERVICE permission for something to be the status bar.
Change-Id: I57b2d296e0d0cef0d256ae6697fffc47188d14df
2010-06-09 14:33:23 -07:00
Joe Onorato
4762c2d75a Add expand and collapse.
Change-Id: I58ad95c59b2c46d3f25349e137d5624aefc6c6cd
2010-06-02 14:48:42 -07:00
Joe Onorato
f3f0e053f0 Make disable() work.
Change-Id: I93fea37e777b3e04fe7f9171d5b84821587c24f5
2010-06-02 14:48:42 -07:00
Joe Onorato
0cbda99f87 The status bar draws its icons now. 2010-06-02 14:48:41 -07:00
Joe Onorato
25f95f9200 Rename IStatusBar to IStatusBarService.
Change-Id: Icfec2a830f037b21f6afaa796bf49da610567e7b
2010-06-02 14:48:40 -07:00
Dianne Hackborn
dc8a7f69d7 Add new API to take over a window's Surface.
Change-Id: Iad6245faadc95f19ea63c8e229a1c02e9188f69e
2010-05-18 10:46:33 -07:00
Jim Miller
1d587e3d5d Manual integration of I32a7b5 from froyo
Fix 2662816: Move UI update from async callback to ui thread.

This fixes a bug where the view hierarchy in AccountUnlockScreen was being
modified by the async callback thread from AccountManager.

Change-Id: I5f1b4e04a7e4af68a5705545765f294cdbd0f17b
2010-05-06 16:31:34 -07:00
Dianne Hackborn
867ab64714 Integrate a bunch of stuff from Froyo:
Fix issue #2574016: Preferred activity setting is not persistent 14/48014/1
author	Dianne Hackborn <hackbod@google.com>
Wed, 7 Apr 2010 03:24:15 +0000 (20:24 -0700)
committer	Dianne Hackborn <hackbod@google.com>
Wed, 7 Apr 2010 03:24:15 +0000 (20:24 -0700)
commit	3cce600614c2a2643ae9a38c6ed87c06c7bab0b6
tree	394f330634ab83a97b244fbd214d5edbbd44fa52	tree | snapshot
parent	7d8866f9ef026870d4735d6f2ede49525150e53e	commit | diff
Fix issue #2574016: Preferred activity setting is not persistent

The recent tasks UI was trying to retrieve the current home activity
in the wrong way, causing it to be a different match of activities and
thus clearing any preferred activity that was set.

In the future we should look at what the package manager is doing here
and make it more robust in how it clears the list...  but for now,
this is the safest thing.

Change-Id: Idc917dffa7d05d62671213414387e8bdb2e34bea

Fix issue #2555171: Switching to app immediately after unmounting SD card causes... 28/48128/1
author	Dianne Hackborn <hackbod@google.com>
Thu, 8 Apr 2010 01:15:32 +0000 (18:15 -0700)
committer	Dianne Hackborn <hackbod@google.com>
Thu, 8 Apr 2010 01:15:32 +0000 (18:15 -0700)
commit	31abd7f677190edfa67cb96fb4ddb166e974cb3e
tree	7cc1059c3c6689ba3f2af5161585b3e7241e0580	tree | snapshot
parent	3cce600614c2a2643ae9a38c6ed87c06c7bab0b6	commit | diff
Fix issue #2555171: Switching to app immediately after unmounting SD card causes reboot.

Change-Id: I509162e136dd721fecfaabc45a046537b2d19077

Fix issue #2586349: Accelerometer is enabled when in car mode 61/48361/1
author	Dianne Hackborn <hackbod@google.com>
Fri, 9 Apr 2010 23:40:33 +0000 (16:40 -0700)
committer	Dianne Hackborn <hackbod@google.com>
Fri, 9 Apr 2010 23:40:33 +0000 (16:40 -0700)
commit	b0d3a2371f92d19d01aa2ca8e4f382738273f2dd
tree	e134d055ce8efb4ef48a74c45da0325ed55852ea	tree | snapshot
parent	eeb2497f92b8d1466918990d536e2d31b5a85c07	commit | diff
Fix issue #2586349: Accelerometer is enabled when in car mode

Change-Id: Iab5ca4ea9f69bd54f815fc7463df808d81c61ffd

Fix issue #2555171: Switching to app immediately after unmounting... 65/48665/1 dalvik-dev froyo froyo-plus-aosp froyo-release stage-korg-froyo stage-korg-master
author	Dianne Hackborn <hackbod@google.com>
Tue, 13 Apr 2010 19:48:30 +0000 (12:48 -0700)
committer	Dianne Hackborn <hackbod@google.com>
Tue, 13 Apr 2010 19:52:10 +0000 (12:52 -0700)
commit	cddfd77b45662d7316aaed3d0159d0f42d284cfc
tree	c52d612ada1f85d3d38b3e776bc520b7a0b22256	tree | snapshot
parent	5fa04b55a94b5cd98f1e6e1197cc4e6ef26a7061	commit | diff
Fix issue #2555171: Switching to app immediately after unmounting...

...SD card causes reboot.

Deal with unavailable apps in recent tasks UI.

Change-Id: Ib85b773c5c6df7afb12db551b6cef63edbc6df64
2010-04-29 16:50:14 -07:00
Jim Miller
318249e467 Merge "Manual merge of Ida6a4cdd3abcbcab7e2fe8450a25c0dc36765f04" into kraken 2010-04-15 17:55:18 -07:00
Jim Miller
5169fc57e3 Manual merge of Ida6a4cdd3abcbcab7e2fe8450a25c0dc36765f04
Fix 2572446: Also watch keyboard changes in PIN/Password unlock.

The PIN/Password unlock screen was monitoring orientation changes.
However, while docked, this isn't useful since orientation remains
fixed. This change makes PasswordUnlockScreen also looks for
changes to config.hardKeyboardHidden.

Tested:
WVGA device while docked and opening/closing the keyboard.

Change-Id: Iaadb277028f2dd1f85fd0f627a686a86ac51a2ed
2010-04-15 17:53:23 -07:00
Jim Miller
ecaced9a78 Manual merge of Idf6bb25438336616e6453e7afe0e79f227af98d3
Fix 2575838: Update emergency button in AccountUnlockScreen DO NOT MERGE

AccountUnlockScreen wasn't registered to receive updates from
UpdateMonitor. It now correctly updates the Emergency call button
to allow the user to return to the call in progress (InCallScreen).

Tested on WVGA device with keyboard:
- hitting Home during call, observing state, and pressing button to return to call.
- hitting Home while not in call to ensure it still invokes EmergencyDialer.
- above in various keyboard states.

Change-Id: Ic4480ff69ff4479557ddb7f76c751b005b1c60bf
2010-04-15 17:39:17 -07:00
Daniel Sandler
e82ca2dec0 Manually integrating froyo lockscreen fixes:
I6872c3ad135bc34348adafa76e08a3878f1b506f
	"Add emergency call button to PUK'd lockscreen."
	Bug: 2568732

	I5ad8745443fc97225af9efb938e4640cfc29b5d7
	"Restore text field used by sliding tab to give ringer
	mode feedback."
	Bug: 2587358

Change-Id: Ide3ad839aaf029930c0bf7ba4b9f6587efbd811d
2010-04-13 14:47:25 -04:00
Joe Onorato
a5c51373d4 Finish moving the policies out of frameworks/policies/base and into frameworks/base.
Change-Id: Id3a0c06202b0f6f2206acf490c8655d340ee0556
2010-04-06 20:21:30 -05:00
Jean-Baptiste Queru
6e251d7d66 de-activate makefile
Change-Id: I6def51dea7aab002f7dbbe1e2573f52a2caa94fe
2010-04-06 15:43:25 -07:00
Joe Onorato
e6b6f42eff am 7d8866f9: Redo the look of the recent apps switcher.
Merge commit '7d8866f9ef026870d4735d6f2ede49525150e53e' into kraken

* commit '7d8866f9ef026870d4735d6f2ede49525150e53e':
  Redo the look of the recent apps switcher.
2010-04-06 08:41:42 -07:00
Joe Onorato
e58d1c4e4a Redo the look of the recent apps switcher.
Change-Id: Icb523e2f5949c2b502aa8003aa14b7ac98a616f2
2010-04-05 16:16:40 -05:00
Jim Miller
fc8686b9ec am 876b0644: Fix 2555028: Restore showing tab unlock before PIN & password entry.
Merge commit '876b0644770d1790b21e4049bc7f40851045dc86' into kraken

* commit '876b0644770d1790b21e4049bc7f40851045dc86':
  Fix 2555028: Restore showing tab unlock before PIN & password entry.
2010-03-30 18:20:03 -07:00
Jim Miller
466d77617a Fix 2555028: Restore showing tab unlock before PIN & password entry.
This fixes a bug introduced in change 46594 that prevents showing
the tab unlock screen before PIN & password entry.

Change-Id: Ibd603921f6a22b603652c4751fa0f2f7d9129bb2
2010-03-29 19:31:26 -07:00
Romain Guy
7836b05105 am 71836f4c: Remove scroll barrier constant. Bug #2553595
Merge commit '71836f4cb6389042d839d2a26582f796c6e97c26' into kraken

* commit '71836f4cb6389042d839d2a26582f796c6e97c26':
  Remove scroll barrier constant.
2010-03-29 15:05:08 -07:00
Romain Guy
8154cd3bbc Remove scroll barrier constant.
Bug #2553595

Change-Id: Ie3bb31930b57ed1a658b79632786dfef9435ccf3
2010-03-29 14:41:15 -07:00
Daniel Sandler
d323995d31 Redesigned keyguard layout in the no-SIM case. DO NOT MERGE
The emergency call button has been removed (since the user
can disable the keyguard, open the phone app, and enter the
emergency number there).

This change also restores a number of the informational &
help messages that were previously removed from the lock
screen.

Bug: 2421380
Change-Id: I4dda16be5d54c1e0ab4e26914c63d1f5b922cfe8
2010-03-26 11:52:52 -04:00
Jim Miller
f7c5d0e46c Fix 2535700: Add support for enforcing password quality
Change-Id: I945eea1a3869f48d636ed0c1172063f7bc57e889
2010-03-25 19:55:23 -07:00
Fred Quintana
cd8aed8c50 change the account unlock enabling logic use async calls rather than
blocking calls

limit the account unlocks to google accounts

Change-Id: If412a7557716503f7d122ec3ff31375f47b624b9
http://b/issue?id=2544496
2010-03-25 14:50:20 -07:00
Adam Powell
00f4d986c6 Fix bug 2386867 - Phone DecorViews FOCUS_AFTER_DESCENDANTS
Change-Id: Iade2c2d8ea575fc452897dbfd3d8454b5b7972ed
2010-03-24 11:17:03 -07:00
Mike LeBeau
bfd25cacf8 Tell SearchManager to stopSearch on long-press of search. Also,
do the long-press haptic feedback first, to avoid any slowdown
in the responsiveness of that.

Fixes http://b/2526697

Change-Id: I607063b67bdde92303ee112663b76d6e4e9a369b
2010-03-22 17:40:35 -07:00
Dirk Balfanz
cf59a0b72d Instead of asking whether accounts are SAML accounts to figure out whether they can be used for screen unlocking, we ask directly whether they support confirmCredentials().
Change-Id: Ib83c89133b67661e2eb0827baecc32910b386f63
2010-03-19 11:31:33 -07:00
Dianne Hackborn
75787398fa Policy part of fixing issue #2519590: Lock screen stuck in landscape mode
Change-Id: Id7f3a7102a86f4fecb7f7ef40b1275b75e27dac4
2010-03-18 01:12:42 -07:00
Jim Miller
e78fab5a2e Merge "Fix 2520598: Disable password entry in keyguard while in lockout" 2010-03-18 00:50:07 -07:00
Jim Miller
f1818ffd82 Fix 2520598: Disable password entry in keyguard while in lockout
The password unlock wasn't abiding by the 30s lockout rule.
This change adds the necessary logic and countdown timer to
disable text entry while in lockout mode. After 30s, text entry
is re-enabled until the next lockout count is reached.

Change-Id: I4d860565cad91cb88c36615b40d1837a5d97fe21
2010-03-17 19:17:55 -07:00