Redesigned how ViewRootImpl delivers input events to views,
the IME and to native activities to fix several issues.
The prior change to make IME input event delegation use
InputChannels failed to take into account that InputMethodManager
is a singleton attached to the main looper whereas UI may be
attached to any looper. Consequently interactions with the
InputChannel might occur on the wrong thread. Fixed this
problem by checking the current thread and posting input
events or callbacks to the correct looper when necessary.
NativeActivity has also been broken for a while because the
default event handling logic for joysticks and touch navigation
was unable to dispatch events back into the native activity.
In particular, this meant that DPad synthesis from touch navigation
would not work in any native activity. The plan is to fix
this problem by passing all events through ViewRootImpl as usual
then forwarding them to native activity as needed. This should
greatly simplify IME pre-dispatch and system key handling
and make everything more robust overall.
Fixed issues related to when input events are synthesized.
In particular, added a more robust mechanism to ensure that
synthetic events are canceled appropriately when we discover
that events are no longer being resynthesized (because the
application or IME is handling or dropping them).
The new design is structured as a pipeline with a chain of
responsibility consisting of InputStage objects. Each InputStage
is responsible for some part of handling each input event
such as dispatching to the view hierarchy or to the IME.
As a stage processes an input event, it has the option of
finishing the event, forwarding the event to the next stage
or handling the event asynchronously. Some queueing logic
takes care to ensure that events are forwarded downstream in
the correct order even if they are handled out of order
by a given stage.
Cleaned up the InputMethodManager singleton initialization logic
to make it clearer that it must be attached to the main looper.
We don't actually need to pass this looper around.
Deleted the LatencyTimer class since no one uses it and we have
better ways of measuring latency these days using systrace.
Added a hidden helper to Looper to determine whether the current
thread is the indicated Looper thread.
Note: NativeActivity's IME dispatch is broken by this patch.
This will be fixed later in another patch.
Bug: 8473020
Change-Id: Iac2a1277545195a7a0137bbbdf04514c29165c60
Fixes the KEYCODE_HOME case, awakes when home is
started for any reason.
Also awaken when toggling recents (and not locked).
Bug:8557212
Change-Id: I6578ae3971740a03c27596b838d27a5ab9b03752
This is the best and only way for apps to listen for
notifications: create a NotificationListenerService, wait
for the NoMan to bind to you (as a result of the user
checking a box somewhere in Settings and agreeing to a
scary dialog box), and you'll start receiving notification
posted and dismissed callbacks. Your service, while enabled,
will also be able to clear one or all notifications.
Use this power wisely.
This change moves StatusBarNotification out of
com.android.internal into android.service.notification.
[Internal customers, including System UI and early users of
the system-only listener binder API, will need to be
updated.]
Bug: 8199624
Change-Id: I1be46f823d4b3ddc901109ec1e085cd6deb740c2
Make sure that apps that have access to restricted accounts can see them.
If they don't have access, they shouldn't be able to add a new account either.
Show an error message in the account picker if the user/app is not authorized.
Change-Id: I117c0b14d7d06c5ac4e66506df156b174567f5f3
Created constants for these in UserManager and current.txt. Also created
an accessor for individual user restrictions that takes the restriction key
(removing individual methods for particular restrictions).
Change-Id: Ibb5517cbcdffadd3925f52cbe67d7d525813faa9
Supports both age and count based constraints. Added light docs and
tests to verify behavior.
Bug: 8387555
Change-Id: If4d0dac8bc54ce705c2a339bc09a60ea748728b8
A previous fix made initializing GL work better by calling eglMakeCurrent()
prior to querying the max texture size. However, that fix worked by creating an eglSurface
earlier than we did before, which for some reason causes problems later if wallpaper creation
fails and we back off to a software solution.
This new fix creates a temporary pbuffer surface instead, which still allows us to make the
call to eglMakeCurrent() prior to querying the max texture size, but does not result in the
later canvas lock failure if the wallpaper creation fails anyway.
Issue #8319960 sluggish yakju animations over launcher
Change-Id: I394d672549260a354f03ad9fd1b9e1f9a161a371
ImageWallpaper was sometimes querying GL for a max texture size too early
(before the first call to eglMakeCurrent()). This problem caused the wallpaper
to then get created in software, resulting in noticeably slower performance
when the wallpaper was visible.
This fix ensures that the
makeCurrent happens before the query, ensuring that wallpapers of the right
size actually get created instead of failing due to this error at creation time.
Issue #8319960 sluggish yakju animations over launcher
Change-Id: I12a3eba9f1818bdf544691e0727fe12f7e820651
Show notification when a bugreport is finished, letting the user
launch a SEND_MULTIPLE intent to share them. Add dialog that warns
user about contents before sharing. Since bugreports are now stored
in private app data of the Shell app, use FileProvider to build Uris
that we can grant others access to.
Define BUGREPORT_FINISHED as being a protected broadcast. Delete
older bugreports automatically to reclaim disk space. Migrate any
Intent extras to ClipData when building PendingIntents.
Add --receiver-permission support to am shell command.
Bug: 7005318
Change-Id: If6c607dbcf137362d5887eac482ff7391563890f
"[+>" more icon was never show in status bar because
the member variable for this icon was not initialized
from resources. This fix enables "[+>" icon to appear
in status bar when the number of indications in status
bar becomes large.
Bug: 8368569
Change-Id: Ieb3412eed831052d69c0cf63c9b4230c38171e4a
OBB backup/ restore is no longer handled within the target app
process. This is done to avoid having to require that OBB-using
apps have full read/write permission for external storage.
The new OBB backup service is a new component running in the
same app as the already-existing shared storage backup agent.
The backup infrastructure delegates backup/restore of apps'
OBB contents to this component (because the system process
may not itself read/write external storage).
From the command line, OBB backup is enabled by using new
-obb / -noobb flags with adb backup. The default is noobb.
Finally, a couple of nit fixes:
- buffer-size mismatch between the writer and reader of chunked
file data has been corrected; now the reading side won't be
issuing an extra pipe read per chunk.
- bu now explicitly closes the transport socket fd after
adopting it. This was benign but triggered a logged
warning about leaked fds.
(Cherrypicked)
Change-Id: I471f6348abcccb7bf1e1710b7beda9f23de53e14
The normal LTR Recents interface in landscape
actually scrolls/behaves like a RTL interface,
so we hardcode the layout to stay the same in both
modes
Change-Id: I57e5e76de3260c6de1dd9e939797b7e1c23cca03
Once these get into the Animators, they freeze up and
disable the whole notification panel. Not cool.
Bug: 7686690
Change-Id: I04567417b3840a82d9cfe071c601e3078b2e3fe3
When calculating directory sizes of data living on emulated external
storage, translate the path to use the internal backing data, which
avoids going through the emulation layer. It carefully retreats to
the original path when it runs into trouble.
Testing with a hierarchy of 10 directories deep and 2 directories
and 10 files wide at each level, this change improves performance
from 5900ms before to 250ms after; over 20 times faster (!).
Bug: 8172425
Change-Id: Ia7365416f091e102bf7345a49f7d7209a22580a9
Bug #8230579
If the wallpaper fails to render with OpenGL, fall back to software
rendering instead of throwing an exception and crashing the wallpaper.
Change-Id: I40ed6056e6ea09b92b6cd441f16101dcc296fb8e