Switch to system process before modifying rotation.

Bug: 8218133
Change-Id: Ib44d64d48dbdf3095182c409dd2211f6a3b726ad
Begin switch over to task based history.

- Introduce the task history and add to and remove from it with
verification.

Change-Id: If97e74f5a13f85acdb1521fc6d0b066a7e8584ae
    Trying to unregister a semi connected accessibility service.

    When an accessibility service connects we get a callback in
    which we either add the service, if this service is in the list
    of connecting services (we still want the service to connect),
    or we unbind and clear the state, if the service is no longer in
    the list of connecting services (we do not want this service to
    connect because something change between the bind request and
    the connection callback).

    The problem is that when the service connects and it is not in
    the list of connecting services on service connected we called
    the clean up code before the connection was complete. However,
    the clean up code expects fully configured services. Now we
    fully connect the service and in case there is a problem -
    disconnect it.

    bug:8232627

Change-Id: I939e544e31ffc1406035265a012c180f2ca95d7c
Switch topRunning* and moveTaskTo*

- More of the Activity to Task changeover.
- Fix bug in validateAppTokens().
- Improved validation of changeover.
- Eliminated iterator classes.

Change-Id: I934a208eabfc9a2668e5a6162452e1406f2c8d3a
Fix crashing bug in validator.

Change-Id: I649bb7cfc2b42fbeda478edcaa3a56f3c23d4bc8
merge in jb-mr2-release history after reset to master
Add null check to setAppGroupId.

Fix bug 8217929.

Change-Id: I3bd54c32abcf6683c2fa75a85bf5025f47e09398
Update histories simultaneously.

In moveTaskToBackLocked calls that used mHistory were being made
between the times that mTaskHistory and mHistory were modified. This
caused an inconsistent state that led to Windows arranged out of
order. Updating both history stacks at the same time fixes this.

Fixes bug 8244261.

Change-Id: I50b675cbedf72f72e547919210187b7e30a4ccb8
Revert "Update histories simultaneously."

Moving to master where it can be cherry-picked.

This reverts commit ce361f5f88d19d192a3ec4a2c369a3050d53aaaa

Change-Id: I0880a28c6fa5588ff2cab7995c90528f36bffd2e
Update histories simultaneously.

In moveTaskToBackLocked calls that used mHistory were being made
between the times that mTaskHistory and mHistory were modified. This
caused an inconsistent state that led to Windows arranged out of
order. Updating both history stacks at the same time fixes this.

Fixes bug 8244261.

Change-Id: I9669762ad39b06ab6d401122702b74969d4dc658
merge in jb-mr2-release history after reset to master
Revert "Fix ListView is not scrolled properly with arrows"

This reverts commit db68fac12daa2cf4a7568308995e218aed92728a.
Revert ActivityManager changes for tasks. DO NOT MERGE

Keeping all activity=>task changes in master and removing them
from jb-mr2.

Revert "Update histories simultaneously."
Revert "Add null check to setAppGroupId."
Revert "Fix crashing bug in validator."
Revert "Switch topRunning* and moveTaskTo*"
Revert "Begin switch over to task based history."
Revert "Reset and reuse Iterators and don't new() one."
Revert "Remove AppWindowToken lists."
Revert "Fix build."
Revert "Remove unused App methods."
Revert "Stop using AppToken movement and start using Task."
Revert "Replace access to mAppTokens with AppTokenIterator"
Revert "Refactor setAppOpVisibility implementation."
Revert "Add AppWindowTokens to TaskList."
Revert "Make ActivityStack.mHistory private."
Revert "Migrate AppWindowToken lists into DisplayContent."

Change-Id: I5722c9a4956dccb52864207e2967690bc58e4ebb
merge in jb-mr2-release history after reset to jb-mr2-dev
merge in jb-mr2-release history after reset to jb-mr2-dev
merge in jb-mr2-release history after reset to jb-mr2-dev
fix issue when replacement bitmap is larger than original.

getTotalClip() returns the canvas bounds even if no explicit clip
was set. This CL fixes that issue by only transfering clips that
were explicitly set to the new canvas.

bug: 8255582
Change-Id: I0144d430e7718151ad93d988fcf20b412f74b256
Account for text alignment in Op bounds calculation

bug:8243821

Previously this wasn't done for deferred clipping + reordering, so
non-left-aligned text would be clipped at defer time, when it wouldn't
have been at draw time (in OpenGLRenderer::quickReject())

Change-Id: Ic96949c2dca4378f284606b37d9411ed42f8d203
Support 3D rotations when drawing text

If a perspective transform is set on the Canvas, drawText() should
not attempt to rasterize glyphs in screen space. This change uses
the old behavior instead (i.e. rasterize the glyphs at the native
font size and apply the transform on the resulting mesh.)

This change also adds an optimization: empty glyphs (spaces) do
not generate vertices anymore. This saves a lot of vertices in text
heavy applications such as Gmail.

Change-Id: Ib531384163f5165b5785501612a7b1474f3ff599
Restore the ability to track native Surface changes
Bug #8230990

ViewRootImpl needs to know when the native Surface objects changes
to recreate the EGL surface. A recent refactoring in Surface broke
the behavior of getGenerationId(). This simply restores the old
behavior (every change increments the generation ID by 1.)

Change-Id: Ife1df1ffb2ee7a373b8ebf2431192702ba10f344