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

Commit b37d44e2 authored by sergeyv's avatar sergeyv
Browse files

Hide children in ViewGroup.createSnaphost via internal flag and add test for

it.

bug:27747923
Change-Id: I079b52b176b920bfa4c6749be31fbcd96a4dc42c
parent 12bf75f3
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -16235,8 +16235,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
    /**
     * Create a snapshot of the view into a bitmap.  We should probably make
     * some form of this public, but should think about the API.
     *
     * @hide
     */
    Bitmap createSnapshot(Bitmap.Config quality, int backgroundColor, boolean skipChildren) {
    public Bitmap createSnapshot(Bitmap.Config quality, int backgroundColor, boolean skipChildren) {
        int width = mRight - mLeft;
        int height = mBottom - mTop;
+9 −3
Original line number Diff line number Diff line
@@ -3251,8 +3251,11 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
        }
    }

    /**
     * @hide
     */
    @Override
    Bitmap createSnapshot(Bitmap.Config quality, int backgroundColor, boolean skipChildren) {
    public Bitmap createSnapshot(Bitmap.Config quality, int backgroundColor, boolean skipChildren) {
        int count = mChildrenCount;
        int[] visibilities = null;

@@ -3262,7 +3265,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
                View child = getChildAt(i);
                visibilities[i] = child.getVisibility();
                if (visibilities[i] == View.VISIBLE) {
                    child.setVisibility(INVISIBLE);
                    child.mViewFlags = (child.mViewFlags & ~View.VISIBILITY_MASK)
                            | (View.INVISIBLE & View.VISIBILITY_MASK);
                }
            }
        }
@@ -3271,7 +3275,9 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager

        if (skipChildren) {
            for (int i = 0; i < count; i++) {
                getChildAt(i).setVisibility(visibilities[i]);
                View child = getChildAt(i);
                child.mViewFlags = (child.mViewFlags & ~View.VISIBILITY_MASK)
                        | (visibilities[i] & View.VISIBILITY_MASK);
            }
        }

+6 −1
Original line number Diff line number Diff line
@@ -1093,7 +1093,12 @@
            </intent-filter>
        </activity>


        <activity android:name="android.view.ViewCaptureTestActivity" android:label="ViewCaptureTestActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
            </intent-filter>
        </activity>

        <!-- Activity-level metadata -->
        <meta-data android:name="com.android.frameworks.coretests.isApp" android:value="true" />
+329 B
Loading image diff...
+343 B
Loading image diff...
Loading