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

Commit fedfa791 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "SurfaceView reports setSecure in AssistStructure" into main

parents 7bf5872d 7eacb90e
Loading
Loading
Loading
Loading
+12 −0
Original line number Original line Diff line number Diff line
@@ -23,6 +23,18 @@ flag {
    bug: "371065456"
    bug: "371065456"
}
}



flag {
  name: "report_secure_surfaces_in_assist_structure"
  namespace: "windowing_frontend"
  description: "SurfaceView reports when the surface is using a SECURE flag."
  bug: "390504528"
  metadata {
    purpose: PURPOSE_BUGFIX
  }
}


flag {
flag {
    name: "contextual_search_prevent_self_capture"
    name: "contextual_search_prevent_self_capture"
    namespace: "sysui_integrations"
    namespace: "sysui_integrations"
+21 −0
Original line number Original line Diff line number Diff line
@@ -2247,6 +2247,27 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
        t.reparent(sc, mBlastSurfaceControl).show(sc);
        t.reparent(sc, mBlastSurfaceControl).show(sc);
    }
    }


    /**
     * Populates a {@link ViewStructure} for content capture.
     *
     * <p>If {@link #setSecure(boolean)} has been enabled, will add a property to the
     * {@link android.app.assist.AssistStructure.ViewNode} to indicate that content will not
     * be available for this part of the screen.
     *
     * @hide
     */
    @Override
    protected void onProvideStructure(@NonNull ViewStructure structure,
            @ViewStructureType int viewFor, int flags) {
        super.onProvideStructure(structure, viewFor, flags);
        if (android.app.contextualsearch.flags.Flags.reportSecureSurfacesInAssistStructure()) {
            if ((mSurfaceFlags & SurfaceControl.SECURE) != 0) {
                structure.getExtras().putBoolean(
                        ViewStructure.EXTRA_CONTAINS_SECURE_LAYERS, true);
            }
        }
    }

    /** @hide */
    /** @hide */
    @Override
    @Override
    public void onInitializeAccessibilityNodeInfoInternal(AccessibilityNodeInfo info) {
    public void onInitializeAccessibilityNodeInfoInternal(AccessibilityNodeInfo info) {
+13 −0
Original line number Original line Diff line number Diff line
@@ -76,6 +76,19 @@ public abstract class ViewStructure {
    public static final String EXTRA_FIRST_ACTIVE_POSITION =
    public static final String EXTRA_FIRST_ACTIVE_POSITION =
            "android.view.ViewStructure.extra.FIRST_ACTIVE_POSITION";
            "android.view.ViewStructure.extra.FIRST_ACTIVE_POSITION";


    /**
     * Key used for confirming whether the view draws graphics containing secure layers.
     *
     * <p>Secure layers cannot be read back into main memory and will show up as blank regions
     * in assist screenshots.
     *
     * @see android.view.SurfaceControl#SECURE
     *
     * @hide
     */
    public static final String EXTRA_CONTAINS_SECURE_LAYERS =
            "android.view.ViewStructure.extra.CONTAINS_SECURE_LAYERS";

    /**
    /**
     * Key used for writing the type of the view that generated the virtual structure of its
     * Key used for writing the type of the view that generated the virtual structure of its
     * children.
     * children.