summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Mount <mount@google.com>2015-07-14 10:03:06 -0700
committerGeorge Mount <mount@google.com>2015-07-14 10:03:06 -0700
commit80141d1c8b799cf7669a29b8837037cf3934ddb9 (patch)
tree851af9f9812a61ee1c52be1dbf5578ee7e3f2a95
parent8af7432ca3fc1ce3539997d24439954f0e64134c (diff)
downloadframeworks_base-80141d1c8b799cf7669a29b8837037cf3934ddb9.zip
frameworks_base-80141d1c8b799cf7669a29b8837037cf3934ddb9.tar.gz
frameworks_base-80141d1c8b799cf7669a29b8837037cf3934ddb9.tar.bz2
Fix input pause without resume.
Bug 22455206 Previously, when an exit activity transition was created, the input would be paused. This worked fine as long as the transition was run. However, sometimes that transition wasn't run and this would cause the input to fail to be started again. This fix moves the input pause to when the transition is started. Change-Id: I738d5471f7932f00b50897f87a8f8a71ecbc57e2
-rw-r--r--core/java/android/app/ActivityTransitionCoordinator.java13
-rw-r--r--core/java/android/app/EnterTransitionCoordinator.java1
-rw-r--r--core/java/android/app/ExitTransitionCoordinator.java2
3 files changed, 11 insertions, 5 deletions
diff --git a/core/java/android/app/ActivityTransitionCoordinator.java b/core/java/android/app/ActivityTransitionCoordinator.java
index fa81412..e28fb20 100644
--- a/core/java/android/app/ActivityTransitionCoordinator.java
+++ b/core/java/android/app/ActivityTransitionCoordinator.java
@@ -217,11 +217,6 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver {
}
protected void viewsReady(ArrayMap<String, View> sharedElements) {
- final View decor = getDecor();
- final ViewRootImpl viewRoot = decor == null ? null : decor.getViewRootImpl();
- if (viewRoot != null) {
- viewRoot.setPausedForTransition(true);
- }
sharedElements.retainAll(mAllSharedElementNames);
if (mListener != null) {
mListener.onMapSharedElements(mAllSharedElementNames, sharedElements);
@@ -905,6 +900,14 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver {
}
}
+ protected void pauseInput() {
+ final View decor = getDecor();
+ final ViewRootImpl viewRoot = decor == null ? null : decor.getViewRootImpl();
+ if (viewRoot != null) {
+ viewRoot.setPausedForTransition(true);
+ }
+ }
+
protected void onTransitionsComplete() {}
protected class ContinueTransitionListener extends Transition.TransitionListenerAdapter {
diff --git a/core/java/android/app/EnterTransitionCoordinator.java b/core/java/android/app/EnterTransitionCoordinator.java
index 05cf1d4..0745537 100644
--- a/core/java/android/app/EnterTransitionCoordinator.java
+++ b/core/java/android/app/EnterTransitionCoordinator.java
@@ -333,6 +333,7 @@ class EnterTransitionCoordinator extends ActivityTransitionCoordinator {
boolean startSharedElementTransition = true;
setGhostVisibility(View.INVISIBLE);
scheduleGhostVisibilityChange(View.INVISIBLE);
+ pauseInput();
Transition transition = beginTransition(decorView, startEnterTransition,
startSharedElementTransition);
scheduleGhostVisibilityChange(View.VISIBLE);
diff --git a/core/java/android/app/ExitTransitionCoordinator.java b/core/java/android/app/ExitTransitionCoordinator.java
index 9ddebb0..ad104a4 100644
--- a/core/java/android/app/ExitTransitionCoordinator.java
+++ b/core/java/android/app/ExitTransitionCoordinator.java
@@ -203,6 +203,7 @@ class ExitTransitionCoordinator extends ActivityTransitionCoordinator {
public void startExit() {
if (!mIsExitStarted) {
mIsExitStarted = true;
+ pauseInput();
ViewGroup decorView = getDecor();
if (decorView != null) {
decorView.suppressLayout(true);
@@ -220,6 +221,7 @@ class ExitTransitionCoordinator extends ActivityTransitionCoordinator {
public void startExit(int resultCode, Intent data) {
if (!mIsExitStarted) {
mIsExitStarted = true;
+ pauseInput();
ViewGroup decorView = getDecor();
if (decorView != null) {
decorView.suppressLayout(true);