Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 02abbe8d authored by Adam Powell's avatar Adam Powell Committed by android-build-merger
Browse files

Only dispatch window visibility aggregation for targetSdk >= N

am: 64e1ba43

Change-Id: Id2d00bc0ae66cdfca11e34b8f1465e4ce19243dc
parents 4a273d8b 64e1ba43
Loading
Loading
Loading
Loading
+10 −1
Original line number Original line Diff line number Diff line
@@ -52,6 +52,7 @@ import android.hardware.input.InputManager;
import android.media.AudioManager;
import android.media.AudioManager;
import android.os.Binder;
import android.os.Binder;
import android.os.Build;
import android.os.Build;
import android.os.Build.VERSION_CODES;
import android.os.Bundle;
import android.os.Bundle;
import android.os.Debug;
import android.os.Debug;
import android.os.Handler;
import android.os.Handler;
@@ -1540,7 +1541,15 @@ public final class ViewRootImpl implements ViewParent,
        if (viewVisibilityChanged) {
        if (viewVisibilityChanged) {
            mAttachInfo.mWindowVisibility = viewVisibility;
            mAttachInfo.mWindowVisibility = viewVisibility;
            host.dispatchWindowVisibilityChanged(viewVisibility);
            host.dispatchWindowVisibilityChanged(viewVisibility);

            // 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);
                host.dispatchVisibilityAggregated(viewVisibility == View.VISIBLE);
            }
            if (viewVisibility != View.VISIBLE || mNewSurfaceNeeded) {
            if (viewVisibility != View.VISIBLE || mNewSurfaceNeeded) {
                endDragResizing();
                endDragResizing();
                destroyHardwareResources();
                destroyHardwareResources();