Only dispatch window visibility aggregation for targetSdk >= N am: 64e1ba4398

am: 02abbe8d4c

Change-Id: I66f8610e52f2aaf06b02fa8d369692fc2f89ee17
This commit is contained in:
Adam Powell
2016-08-23 15:33:49 +00:00
committed by android-build-merger

View File

@@ -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();