summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorAndroid Build Merger (Role) <android-build-merger@google.com>2016-08-23 00:20:34 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2016-08-23 00:20:36 +0000
commit998ff1c7beeeeccccc250cd458cdb2341c18dafa (patch)
treed36462ba43e5e92e04bdd9fe692f1297e069f3a6 /core/java/android
parentf14ba4c10f261a3c68885b2777955e9d4a933cb1 (diff)
parent02abbe8d4cfcd0cbb1446f52e81f0901d1e9a596 (diff)
Merge "Only dispatch window visibility aggregation for targetSdk >= N am: 64e1ba4398" into nyc-mr1-dev
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/view/ViewRootImpl.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 4dc1009fe446..7494b94ce713 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -52,6 +52,7 @@ import android.hardware.input.InputManager;
import android.media.AudioManager;
import android.os.Binder;
import android.os.Build;
+import android.os.Build.VERSION_CODES;
import android.os.Bundle;
import android.os.Debug;
import android.os.Handler;
@@ -1540,7 +1541,15 @@ public final class ViewRootImpl implements ViewParent,
if (viewVisibilityChanged) {
mAttachInfo.mWindowVisibility = viewVisibility;
host.dispatchWindowVisibilityChanged(viewVisibility);
- host.dispatchVisibilityAggregated(viewVisibility == View.VISIBLE);
+
+ // Prior to N we didn't have dispatchVisibilityAggregated to give a more accurate
+ // view into when views are visible to the user or not. ImageView never dealt with
+ // telling its drawable about window visibility, among other things. Some apps cause
+ // an additional crossfade animation when windows become visible if they get this
+ // additional call, so only send it to new apps to avoid new visual jank.
+ if (host.getContext().getApplicationInfo().targetSdkVersion >= VERSION_CODES.N) {
+ host.dispatchVisibilityAggregated(viewVisibility == View.VISIBLE);
+ }
if (viewVisibility != View.VISIBLE || mNewSurfaceNeeded) {
endDragResizing();
destroyHardwareResources();