OSDN Git Service

DO NOT MERGE Fix android:noHistory for Wear
authorNed Burns <pixel@google.com>
Tue, 6 Dec 2016 20:52:01 +0000 (15:52 -0500)
committerNed Burns <pixel@google.com>
Wed, 7 Dec 2016 20:05:25 +0000 (15:05 -0500)
commitd7a313fb118fb6f5e5eaae6acff253038a85da4b
tree1f776b7af533a8d823b076f3fead9b1ed25e1263
parent647166e852e361d9c91e939950d3038d373a4b58
DO NOT MERGE Fix android:noHistory for Wear

Modifies swipe-to-close activities to be opaque by default (instead
of translucent by default). Previously, android:noHistory properties
on most activities in Wear were being ignored because they were
usually transitioning to a swipe-to-close activity that was marked
as translucent. This meant that the noHistory activity was still
technically visible, and so would never be culled from the task
history.

Now, we convert a swiped activity to translucent as soon as a swipe
begins, and convert it back after the swipe finishes. The previous
version of SDL tries to do this, but fails in the case where the
context is a ContextWrapper.

This approach is hacky and isn't merge-able into master. We leave
it DO NOT MERGE and will do a long-term fix after the holidays.

Test: Built a test app to verify that noHistory is now being
correctly respected. Manually verified that new activities start
out opaque and not translucent. Manually verified that Home
correctly starts/stops when it's revealed from underneath a
partially swiped activity. Tested general swipe behavior on Settings,
Contacts, Flashlight, Fit.

Bug: 33252029

Change-Id: Ib2e7f21ea1e0d52db03e78d25676501e5f73b31f
core/java/com/android/internal/widget/SwipeDismissLayout.java
services/core/java/com/android/server/am/ActivityRecord.java