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
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
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
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
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
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
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
Prevent the usual menu pipeline from trying to open the action bar
overflow menu when the action bar is not visible.
Change-Id: I0708d142ad271368baa79351b97aad1533636fe7
* 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.
* 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.
This fixes a bug in StatusView believed to be caused by
seeing "invalid charger" update from BatteryService.
The code normally relies on "interesting events", as determined
by KeyguardUpdateMonitor. I believe something else is
triggering an update (perhaps a SimStateChanged event) that updates
the status without also updating StatusView.mShowingBatteryInfo
and mPluggedIn.
The safer way to do this is to explicitly check the battery
level before telling the user the device needs to be charged.
Change-Id: Ic39ed86c78a157dc9fbdef4d76a9c3db39ccafca
When invoking a registered shortcut for which the activity was not
found, the startActivity throws ActivityNotFoundException. If this
exception is not caught and handled, then the shortcut key is
dispatched to the application instead of being suppressed as it
should have been.
Found while fixing Bug: 3396233
Change-Id: I0e8e9e3ba09dd403a901d5eae12839734be467ed
* commit 'a4a5ec5e748f99c40301c9c422b3d36cb44c6081':
Expose the window flags for lights out mode.
Make TabletStatusBar call into StatusBarManagerService when it goes out of lights out mode on its own.
Make FLAG_FULLSCREEN not go into lights out mode anymore.
* commit '1aadb2108d7614d9d1ff61b41c6c31cb8d211ab9':
Expose the window flags for lights out mode.
Make TabletStatusBar call into StatusBarManagerService when it goes out of lights out mode on its own.
Make FLAG_FULLSCREEN not go into lights out mode anymore.
I hadn't wanted to do this, but it makes porting the FLAG_FULLSCREEN
stuff over to this simpler because you don't have to go find a view
to proxy through.
This change also clears the flag everywhere when the window manager
notifies the views that the change has come back.
Change-Id: I48392c7550925bcca50c5bb9e1f263e99de6c7bc
The SurfaceHolder provided by the wallpaper service was not reporting
the correct size in getSurfaceFrame(). This broke an optimization in
the ImageWallpaper. The old code happened to work because calling
lockCanvas on the SurfaceHolder with a null dirty rectangle happened
to have the side-effect of updating the SurfaceHolder's surface frame
size field because it passed mSurfaceFrame as the dirty rect, causing
mSurfaceFrame to be set to the size of the region to be drawn.
However, relying on this side-effect is wrong. Among other things,
the dirty region could actually be smaller than the surface frame.
This patch fixes WallpaperService, SurfaceView and ViewRoot to ensure
that the surface frame size is always set explicitly and is not modified
by calls to lockCanvas.
Change-Id: I10948f5ec269409ceaf0f7d32b3f6731e9499ebc
The objective in this listener is to be more careful about the
signal processing to prevent spurious orientation changes
and to make all of the tweakable factors physically meaningful.
The calibration is defined in terms of time constants and
does not assume a particular discrete sampling rate. This is
useful because it allows us to change the accelerometer sampling
interval if desired without having to change the calibration.
Moreover, the accelerometer sampling interval can vary +/- 20ms
from one sample to the next even in normal circumstances.
Proposed orientation changes are weighted by confidence factors
that vary exponentially in relation to how close the device
is to the ideal orientation change posture (screen is vertical,
angle is exactly at the midpoint of the orientation quadrant,
and no external acceleration beside gravity). When not in an ideal
posture, the device takes proportionally longer to settle into a
new orientation state.
Added a little tool to plot the log output of the
WindowOrientationListener. Check the README for more information
about how to use it.
Change-Id: I787f02d03582ff26367df65eda8d9ce85c5cb343
1. Views may setSystemUiVisibility() to recommend that
the system chrome (status bar or other UI) show or hide
itself. (This functionality was previously available only
via the FLAG_FULLSCREEN window flag for some SystemUI
implementations.)
2. Views may register a OnSystemUiVisibilityChangedListener
on a view, and find out when the system UI actually
appears or disappears, allowing apps to coordinate the
appearance of their own UI if desired.
Bug: 3241144
Change-Id: Ia1758d94099182d49a1e3688ea2738ae4995b829