613 Commits

Author SHA1 Message Date
Dianne Hackborn
dacea8ce50 Start work on simulating landscape/portrait when orientation is locked.
Not yet working, so turned off.

Also fix a bug where the display size configuration became inconsistent
after a configuration change -- we now figure out everything about the
display size when computing a new configuration.
2011-04-22 11:23:13 -07:00
Dianne Hackborn
9d13264f6b Fix bug in deciding which rotation to use for an orientation.
Change-Id: Icc928c2188a5865035cafcdab2efd5bae3132b1f
2011-04-21 17:27:42 -07:00
Adam Powell
696cba573e Refactor menu internals.
In the old world, MenuBuilder and MenuItemImpl were responsible for
generating views for any presentation of a menu. MenuBuilder needed to
know any types and resources involved, and the implied caching
semantics did not work well for menus presented within AdapterViews.

In the new world, the MenuPresenter interface takes over the
responsibility of generating views or adapters for menu
items. MenuBuilder/MenuItemImpl still provide extra metadata tracking
used by these presenters. Mutiple presenters may be active for a
single menu at a time. All of this remains internal framework
implementation details.

BaseMenuPresenter provides a simple base for presenters that treats
the host MenuView more like an AdapterView. This allows for less
rebuilding of views when items are added/removed.

Callbacks have been restructured. Calls that relate to the menu itself
are still handled by MenuBuilder.Callback, but calls related to a
specific presentation of a menu are handled by MenuPresenter.Callback
objects attached to a MenuPresenter.

Also add API to programmatically set divider options for LinearLayout
and hidden API so that ActionBarView can have finer-grained control
over divider placement.

Change-Id: I2265b86a084279822908021aec20dfbadc1bb56b
2011-04-19 13:49:39 -07:00
Jim Miller
da3ae8fba8 Use system IME for LockScreen password mode.
Change-Id: I16c4d26fd2aeac2fe1647145b70dfde9d8d26af9
2011-04-14 15:24:40 -07:00
Joe Onorato
43a17654cf Remove the deprecated things from Config.java. These haven't been working since before 1.0.
Change-Id: Ic2e8fa68797ea9d486f4117f3d82c98233cdab1e
2011-04-07 19:23:05 -07:00
Jeff Brown
fbfb3dafd9 Merge "Minor Alt-TAB / Recent Apps Dialog improvements." 2011-04-06 15:57:21 -07:00
Jeff Brown
5487500cf3 Minor Alt-TAB / Recent Apps Dialog improvements.
Alt-TAB should have different semantics from the APP_SWITCH key
or long-press on HOME.  Accordingly, remove the fallback action
for Alt-TAB and initiate the task switching behavior directly
in the policy.

Modified RecentApplicationsDialog to be more precise about the
initial modifiers that it considers to be holding the dialog.

The dialog is now dismissed by a second press on the APP_SWITCH
key or by a second long press on HOME.

Change-Id: Idf4d803f51103819057cb655ff3b770b7729e4be
2011-04-06 15:38:05 -07:00
Joe Onorato
ea495d4c1f Move around the HDMI switch detection so we don't try to get the status if we can't listen to it.
Change-Id: I46f4e92923ba010f68109b6d043c817e25dfe650
2011-04-06 11:41:11 -07:00
Jeff Brown
8c769cb9cc Support primitive ALT-TAB style navigation using Recent Apps.
Change-Id: I6dc774326c971826d160c82126fb39acb5b9124b
2011-03-29 17:26:44 -07:00
Jeff Brown
da3d5a91b6 Support chorded fallback keys.
Also be more careful about canceling fallback keys during focus
transitions, when the application handles the key, or when the
policy decides to do something different.

Fixed a crash due to JNI CallObjectMethod returning an undefined
value (not null) when an exception is thrown.

Fixed a crash due to the policy trying to create a Dialog for
recent apps on the dispatcher thread.  It should happen on the
policy's Looper instead.

Bug: 4187302
Change-Id: I659a3fd1bd2325ed36d965f9beb75dacb89790c9
2011-03-29 16:16:55 -07:00
Adam Powell
25ef3030a7 Fix bug 4136005 - Extended menus do not work
Fix for extended panel menus on small-screen devices.

Change-Id: I7788563019648867872d88ac974bfacdce8af385
2011-03-18 16:14:33 -07:00
Jim Miller
3fa8a454f6 Fix 3201849: Enable hardware acceleration in LockScreen WaveView
Change-Id: Id64e82fe2e09ac231736d7867cd47b504d79b81b
2011-03-09 19:47:56 -08:00
Patrick Dubroy
8620d9533a Remove guard preventing onDetachedFromWindow() from being called
This was the cause of 3510699: Launcher has leaked IntentReceiver.

Change-Id: I7d0e4662314d657f6ac06a9a9d37861f8d8ee975
2011-03-07 11:07:26 -08:00
Jeff Brown
56194ebec6 Wake screen from external HID peripherals.
Added some plumbing to enable the policy to intercept motion
events when the screen is off to handle wakeup if needed.

Added a basic concept of an external device to limit the scope
of the wakeup policy to external devices only.  The wakeup policy
for internal devices should be based on explicit rules such as
policy flags in key layout files.

Moved isTouchEvent to native.

Ensure the dispatcher sends the right event type to userActivity
for non-touch pointer events like HOVER_MOVE and SCROLL.

Bug: 3193114
Change-Id: I15dbd48a16810dfaf226ff7ad117d46908ca4f86
2011-03-02 19:57:07 -08:00
Dianne Hackborn
039e634f61 am 4b8c9b74: am 7fff2d19: am 1de4a2ca: am 62619392: Merge "Fix leak when keylock is recreated."
* commit '4b8c9b740528301d3ca60fe3b4b861fcd85ceb0a':
  Fix leak when keylock is recreated.
2011-03-02 12:52:56 -08:00
Dianne Hackborn
d20d5523c7 Merge "Fix issue #3387676 com.android.browser: java.lang.NullPointerException..." 2011-03-01 18:34:01 -08:00
Jim Miller
c13c8d82ae Merge "Fix 3463772: Bring back alarm icon on LockScreen" 2011-03-01 18:17:06 -08:00
Jim Miller
599351e93d Fix 3463772: Bring back alarm icon on LockScreen
Change-Id: Icdf948c774d280e22da84e9241b345244a56befd
2011-03-01 18:14:48 -08:00
Dianne Hackborn
b66ad57ca0 Fix issue #3387676 com.android.browser: java.lang.NullPointerException...
Unable to destroy activity {com.android.browser/com.android.browser.BrowserActivity}:
java.lang.NullPointerException at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:2809)

Add a bunch of guards to not call on to the window callback after the
window is destroyed.

Change-Id: I66ca0705f421bafdfe953d03654c8f78d9e68249
2011-03-01 17:11:08 -08:00
Dianne Hackborn
4b8c9b7405 am 7fff2d19: am 1de4a2ca: am 62619392: Merge "Fix leak when keylock is recreated."
* commit '7fff2d19a24f9f9b669676864dc5652ab179d2fc':
  Fix leak when keylock is recreated.
2011-03-01 11:13:14 -08:00
Adam Powell
d3c9704d3e Fix bug 3497307 - Fix issues with FEATURE_ACTION_MODE_OVERLAY
Properly close down overlay windows when decor is detached. Delay
opening popup overlays to prevent issues when restoring instance
state.

Change-Id: I7ff44ce65e78c0172a12a9ddfe11460c885593ca
2011-02-28 21:40:26 -08:00
Dianne Hackborn
1de4a2ca58 am 62619392: Merge "Fix leak when keylock is recreated."
* commit '626193926df0b3c7236e5c244f30d797d9192e0d':
  Fix leak when keylock is recreated.
2011-02-28 18:03:12 -08:00
Kenneth Andersson
1e0c7ae184 Fix leak when keylock is recreated.
DigitalClock could sometimes leak when the keylock was recreated.
This happened because onDetachedFromWindow() was called BEFORE
onAttachedFromWindow().
This is the flow that causes the memory leak:
1) The LockPatternKeyGuardView is created and added. This will start
a loop dispatching onAttachedToWindow() to all views involved.
2) PatternUnlockScreen.onAttachedToWindow() is called
3) If the configuration has changed since creation, recreateMe() in
LockPatternKeyguardView.java is called.
4) recreateScreens() is called
5) PatternUnlockScreen is removed (to be re-added later) in
LockPatternKeyguardView.recreateUnlockScreen()
6) Since DigitalClock is a part of PatternUnlockScreen, its
onDetachedFromWindow() will be called.
7) The loop started in 1) will continue to dispatch
onAttachedToWindow() - and will eventually call
DigitalClock.onAttachedToWindow()
8) DigitalClock.onAttachedToWindow() registers a receiver that is
normally unregistered in onDetachedFromWindow(). But since
onDetachedFromWindow was already called in 6), it will not be called
again.
9) The receiver has leaked, and it has a reference to DigitalClock,
so that will leak as well, together with its parents e.g.
PatternUnlockScreen and LockPatternKeyguardView

The fix is to wait with the recreation of the screens (in 4) until
the loop (in 1) is finished. This is done by posting this as an event
instead of calling recreateScreens() immediately.

It is possible that this a fix for the root cause mentioned in
"Fix 3106227: use WeakReferences for receivers in DigitalClock class"
8b886fab5496b0b1f5193f21855220176deddc37 by Jim Miller
<jaggies@google.com>.

Change-Id: I6a5f6f49a565d459bf4e285f34f053cc1022286f
2011-02-28 14:09:08 +01:00
Mike Lockwood
6aea1154ba DO NOT MERGE: KeyguardManager: Add isKeyguardLocked() and isKeyguardSecure()
BUG: 3402847

Change-Id: I7cb199763e8d5386914b4c2173c9e1579b08674c
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-02-26 14:32:00 -05:00
Jeff Brown
33bbfd2232 Add support for mouse hover and scroll wheel.
Dispatch ACTION_HOVER_MOVE and ACTION_SCROLL through the View
hierarchy as onGenericTouchEvent.  Pointer events dispatched
this way are delivered to the view under the pointer.  Non-pointer
events continue to be delivered to the focused view.

Added scroll wheel support to AbsListView, ScrollView,
HorizontalScrollView and WebView.  Shift+VSCROLL is translated
to HSCROLL as appropriate.

Added logging of new pointer events in PointerLocationView.

Fixed a problem in EventHub when a USB device is removed that
resulted in a long stream of ENODEV errors being logged until INotify
noticed the device was gone.

Note that the new events are not supported by wallpapers at this time
because the wallpaper engine only delivers touch events.

Make all mouse buttons behave identically.  (Effectively we only
support one button.)

Change-Id: I9ab445ffb63c813fcb07db6693987b02475f3756
2011-02-25 17:06:07 -08:00
Patrick Dubroy
ece945291e Fix 3272590: Long-press on home & menu should be same as click
Change-Id: I151571900f4bb63910ccfb77fc64c8be9676a224
2011-02-24 10:03:23 -08:00
Daniel Sandler
ad788884de Merge "Rotation lock fix for sensor{Landscape,Portrait} activities." 2011-02-23 06:43:16 -08:00
Jeff Brown
1815c0275e Merge "Be more precise about tracking fallback keys." 2011-02-22 16:37:50 -08:00
Jeff Brown
bfaf3b9170 Be more precise about tracking fallback keys.
Only initiate fallback key handling if the first key down was
not handled and there is no other fallback key already in progress.
This prevents spurious fallbacks from being generated when
applications handle the initial down but not repeated downs or the up.

Change-Id: I8a513896cf96b16dc502cd72291926d5532aa2ab
2011-02-22 15:00:50 -08:00
Mike Lockwood
3c85a4e639 Merge "KeyguardManager: Add isKeyguardLocked() and isKeyguardSecure()" 2011-02-22 13:11:11 -08:00
Daniel Sandler
e7e5ac250c Rotation lock fix for sensor{Landscape,Portrait} activities.
E.g. if an app is sensorLandscape and the device rotation is
locked to landscape, the activity should not be allowed to
flip to seascape even if the device is inverted.

If the rotation is locked 90° from the activity's
supported orientations, we must override the lock as before,
but we now suppress the sensor input (confining the activity
to one of its two orientations). This best preserves the
spirit of the rotation lock while still allowing the
activity to run in a supported configuration.

Bug: 3453407
Change-Id: I8ee255e0250ba7e4534f4622ac37b82d31cf9936
2011-02-22 16:10:23 -05:00
Daniel Sandler
2ed6ad6aec Fix the flipping orientation lock.
We were setting ACCELEROMETER_ROTATION to 0 before putting
in the proper USER_ROTATION value, and PhoneWindowManager's
content observer would eagerly rotate the screen to the last
locked orientation before re-rotating to the updated locked
rotation.

Now we set USER_ROTATION first. Additionally, the
content observer is now the only place we set
mUserRotation{,Mode} (previously we would race with it in
setUserRotationMode()).

Bug: 3425657
Change-Id: I04ba1a3631c6d985c2e406c4d148c39fb5c36216
2011-02-22 15:24:55 -05:00
Jeff Brown
cc0c159e9b Add new hover move action and scroll wheel plumbing.
Added support for tracking the mouse position even when the mouse button
is not pressed.  To avoid confusing existing applications, mouse movements
are reported using the new ACTION_HOVER_MOVE action when the mouse button
is not pressed.

Added some more plumbing for the scroll wheel axes.  The values are
reported to Views but they are not yet handled by the framework.

Change-Id: I1706be850d25cf34e5adf880bbed5cc3265cf4b1
2011-02-19 06:14:21 -08:00
Jeff Brown
6f2fba428c Add new axes for joysticks and mouse wheels.
Added API on InputDevice to query the set of axes available.
Added API on KeyEvent and MotionEvent to convert keycodes and axes
to symbolic name strings for diagnostic purposes.
Added API on KeyEvent to query if a given key code is a gamepad button.
Added a new "axis" element to key layout files to specify the
mapping between raw absolute axis values and motion axis ids.
Expanded the axis bitfield to 64bits to allow for future growth.
Modified the Makefile for keyboard prebuilts to run the keymap
validation tool during the build.
Added layouts for two game controllers.
Added default actions for game pad button keys.
Added more tests.
Fixed a bunch of bugs.

Change-Id: I73f9166c3b3c5bcf4970845b58088ad467525525
2011-02-19 05:23:10 -08:00
Mike Lockwood
520d8bc1d8 KeyguardManager: Add isKeyguardLocked() and isKeyguardSecure()
BUG: 3402847

Change-Id: I725838c9d96617dd4497f9c80417cd623eceb846
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-02-18 13:27:02 -05:00
Dianne Hackborn
a924dc0db9 Start window manager refactoring.
Move all of the pieces into a new com.android.server.wm package.

Change-Id: I942b7bcfb84ee0f843f47d58e55ffc5a93c0da94
2011-02-17 14:22:17 -08:00
Jim Miller
79a444a0cd Fix 3391330: Use BATTERY_STATUS_FULL as "Charged" state
Some devices that use LiPo batteries do not charge them to 100%
as a safety margin and to preserve battery longevity.  This change
allows KeyguardUpdateMonitor to determine when the battery state should be
reported as "Charged", provided the device sets BATTERY_STATUS_FULL in
that case.

Manual merge of Change-Id: Iac6cb78e24f9a696017459cc773c38ef7fe7779f

Change-Id: I15c316a17108c064bf2c7e657ca908f8767be936
2011-02-15 15:02:11 -08:00
Jim Miller
79628c6662 Fix 3409550: Fix crash caused when max pattern attempts met.
This fixes a bug introduced by a recent change in GB that
fixed a memory leak and subsequent OOM crash.  The code in
cleanUp() is now more aggressive about releasing unused
references because the view is expected to go away afterwards.

However, due to the immediate callback from reportFailedUnlockAttempt(),
the member variables are cleared before we reach the end of the
handler.  The fix is to postpone reporting the failed attempt
until after the rest of the logic has completed.

Change-Id: Ic35eaf17e9921213c8793d00f9008d957a290b88
2011-02-14 16:18:49 -08:00
Adam Powell
ef5a440d0a Fix bug 2955651 - can open normal menu during action modes
Prevent the usual menu pipeline from trying to open the action bar
overflow menu when the action bar is not visible.

Change-Id: I0708d142ad271368baa79351b97aad1533636fe7
2011-02-10 17:57:48 -08:00
The Android Open Source Project
b2abd8c424 Mass merge from gingerbread - do not merge
Change-Id: I45dc3596bf4211d8f91c64f2d1d00588878df629
2011-01-30 12:40:38 -08:00
Jim Miller
f81a6f67b7 am 2e4b9985: am 6354dd0b: Merge "Fix 3403858: Remove lock icons from status1 area." into honeycomb
* commit '2e4b9985dba629eac5662c32a6684fb7b880aeff':
  Fix 3403858: Remove lock icons from status1 area.
2011-01-28 16:28:55 -08:00
Jim Miller
2e4b9985db am 6354dd0b: Merge "Fix 3403858: Remove lock icons from status1 area." into honeycomb
* commit '6354dd0b3e507b2afebc5ba41cd57866ade5ba94':
  Fix 3403858: Remove lock icons from status1 area.
2011-01-28 16:26:05 -08:00
Jim Miller
a6b4ffcc60 Fix 3403858: Remove lock icons from status1 area.
Change-Id: Ib311f7a9dd4c46965263b3cf72994aab5d2dfb0d
2011-01-28 15:54:49 -08:00
Joe Onorato
bafa3a31f5 am d6874a10: am cfd0bafd: Merge changes Iaa7bc042,Icc312fc9,I50ba06ed into honeycomb
* commit 'd6874a105ee584b1dc60aae2f2af7c78ee875114':
  Make keyguard also ask to turn the back button off, now that it is controlled separately.
  Allow independent control of the back and the other navigation buttons.
  Allow the status bar disable flags to be used as View's system ui visibility fields.
2011-01-28 13:45:51 -08:00
Joe Onorato
d6874a105e am cfd0bafd: Merge changes Iaa7bc042,Icc312fc9,I50ba06ed into honeycomb
* commit 'cfd0bafdebf1fccd3f5a0baed5cad8a539546e9b':
  Make keyguard also ask to turn the back button off, now that it is controlled separately.
  Allow independent control of the back and the other navigation buttons.
  Allow the status bar disable flags to be used as View's system ui visibility fields.
2011-01-28 13:43:22 -08:00
Joe Onorato
4671ce56cd Make keyguard also ask to turn the back button off, now that it is controlled separately.
Bug: 3363046
Change-Id: Iaa7bc0428ae4a8f0c133fd699b762e6c4f167d63
2011-01-27 21:41:34 -08:00
Jim Miller
226e57563c Merge "Fix 3391330: Use BATTERY_STATUS_FULL as "Charged" state [DO NOT MERGE]" into gingerbread 2011-01-27 18:22:14 -08:00
Jim Miller
c0a1387f0f Fix 3391330: Use BATTERY_STATUS_FULL as "Charged" state [DO NOT MERGE]
Some devices that use LiPo batteries do not charge them to 100%
as a safety margin and to preserve battery longevity.  This change
allows KeyguardUpdateMonitor to determine when the battery state should be
reported as "Charged", provided the device sets BATTERY_STATUS_FULL in
that case.

Change-Id: Iac6cb78e24f9a696017459cc773c38ef7fe7779f
2011-01-27 18:07:44 -08:00
Jeff Hamilton
992f75bcd0 resolved conflicts for merge of 6687ecb4 to honeycomb-merge
Change-Id: Id9677d2ef1c03191cf73a7d90e80b57ea686afec
2011-01-27 10:44:21 -06:00
Jeff Brown
32d35b2cfc am 9d925d2d: am da910fd5: Merge "Handle ActivityNotFoundException in the WM policy." into honeycomb
* commit '9d925d2dfdb2a0bd89ff081c1693129f3bf85e77':
  Handle ActivityNotFoundException in the WM policy.
2011-01-26 23:58:10 -08:00