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

Commit 7c4e6931 authored by Andrey Kulikov's avatar Andrey Kulikov
Browse files

Restrict platform's GhostView and unhide a method needed for a backport

Bug: 117521193
Bug: 123768642
Test: added a cts test for the new method
Change-Id: If933dbe16e756bf4e32d1cf43d9d3ecc67e37174
parent d224e240
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -51722,6 +51722,7 @@ package android.view {
    method public android.view.View getChildAt(int);
    method public int getChildCount();
    method protected int getChildDrawingOrder(int, int);
    method public final int getChildDrawingOrder(int);
    method public static int getChildMeasureSpec(int, int, int);
    method protected boolean getChildStaticTransformation(android.view.View, android.view.animation.Transformation);
    method public boolean getChildVisibleRect(android.view.View, android.graphics.Rect, android.graphics.Point);
+3 −2
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.RecordingCanvas;
import android.graphics.RenderNode;
import android.os.Build;
import android.widget.FrameLayout;

import java.util.ArrayList;
@@ -135,12 +136,12 @@ public class GhostView extends View {
        return ghostView;
    }

    @UnsupportedAppUsage
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
    public static GhostView addGhost(View view, ViewGroup viewGroup) {
        return addGhost(view, viewGroup, null);
    }

    @UnsupportedAppUsage
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
    public static void removeGhost(View view) {
        GhostView ghostView = view.mGhostView;
        if (ghostView != null) {
+14 −0
Original line number Diff line number Diff line
@@ -4301,6 +4301,20 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
        return i;
    }

    /**
     * The public version of getChildDrawingOrder().
     *
     * Returns the index of the child to draw for this iteration.
     *
     * @param i The current iteration.
     * @return The index of the child to draw this iteration.
     *
     * @see #getChildDrawingOrder(int, int)}
     */
    public final int getChildDrawingOrder(int i) {
        return getChildDrawingOrder(getChildCount(), i);
    }

    private boolean hasChildWithZ() {
        for (int i = 0; i < mChildrenCount; i++) {
            if (mChildren[i].getZ() != 0) return true;