This is a cherry-pick of https://googleplex-android-review.git.corp.google.com/#/c/399886/
Instead of storing a kb layout per device descriptor (which is expected
to be unique), store it for each vendor/product. This way we can keep
a consistent layout between identical but physically different keyboards.
There are some corner cases this is expected to fail on, namely devices
that incorrectly have the same vendor/product id. Devices that don't
define a vendor/product id will continue to use the descriptor to store
layout files.
Change-Id: I1f2508561992080459310d5a644dad65a9c24f1a
Cherry pick from https://googleplex-android-review.git.corp.google.com/#/c/398226/
This adds an integer to the descriptor of devices without uniqely
identifying information. It will reuse values that are no longer
in use, so if you remove a single device and attach a different
identical device it will appear to be the same device.
TODO: Derive uniqueness from USB port when possible. This version
will generate different descriptors for each half of a USB keyboard
that shows up twice.
Change-Id: Ie628f19c01469f6ec2d354cd00000898ac6432fa
Some devices have joystick axes or DPad keys, but no gamepad buttons
(or vice versa). We shouldn't count these as gamepads since games
can't really be expected to work with this setup in the general case.
Instead, require that a device has a movement mechanism (joystick
axes or DPad buttons), as well as at least one gamepad button before
considering it a controller.
Bug: 13432364
Change-Id: Ia113c8441557d4c858c1e5740a3e1c7e0e9fdcdd
Under certain circumstances, the power manager might continue to
hold the display wakelock long after the display had been turned
off due to the mDisplayReady flag having an incorrect value.
1. An inverted conditional caused DisplayPowerState to incorrectly
signal the screen on ready state.
2. The DisplayPowerController failed to clear the block screen on
flag in the case where the screen was turned off before it became
unblocked from turning on. This could happen when the display was
rapidly turned on-off-on-off.
Bug: 13248135
Change-Id: I8faa3034695c83c8cd35613d81acccf40d22128d
The window manager and view hierarchy currently disable all drawing
when PowerManager.isScreenOn() returns false so no drawing occurs
while dozing. This will be fixed in a future patch to take the
display blanking state into account correctly.
This patch is a workaround to unblock development in the meantime.
Bug: 13133142
Change-Id: I2dc0b422c77285e657d73adca2606aa68264d987
Fixed a bug that cause Context.createPackageContext() to discard
display information. Likewise also fixes issues where the
activity token, override configuration, user handle, and
restriction state might be discarded.
As part of this change, reworked how Contexts are created to make
initialization easier to understand and less error-prone.
The init() methods have been removed and most of the state is
now stored in final variables.
Bug: 12015587
Change-Id: If795851f1cd078bef889b76a52e00d9b3c06ab11
Fix possible invalid pointer index in swipe dismiss: exit out if the pointer
index is -1. Also allow user to cancel this if in swipe mode.
Change-Id: I0f623ced0287679be8dd5c93ab6c67504b82fe9b
Extract the size from the MeasureSpec value before adding the
delta. The opposite order could result in a negative delta causing
overflow into size from the EXACTLY mode, creating a very large size
value in the resulting MeasureSpec.
Don't reapply optical bounds insets after pulling a value from the
measurement cache. (The insets will have already been applied before
insertion into the cache.)
Change-Id: Ib0154f4d6c3a7c31e7fee24fd7d5d10cc5dc71a1
Now that overflow menus and the PhoneWindow-level ListMenuPresenter
can coexist, make sure that ListMenuPresenter handles submenus spawned
by itself. Introduce an internal API for menus to prefer a specific
presenter when performing item actions.
Bug 11979407
Change-Id: Id0b8fcbb8b310cbb3a63a1e5ea7a89de5d53f86f