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

Commit f839b645 authored by Vishnu Nair's avatar Vishnu Nair
Browse files

Remove surface_trusted_overlay flag

Test: presubmit
Flag: EXEMPT flag cleanup
Bug: 439061338
Change-Id: I2ac8ac738ff79d35fde559883d2e78be54a64611
parent 1b105a76
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -16,8 +16,6 @@

package android.view;

import static com.android.window.flags.Flags.surfaceTrustedOverlay;

import android.annotation.IntDef;
import android.annotation.Nullable;
import android.graphics.Matrix;
@@ -298,10 +296,6 @@ public final class InputWindowHandle {

    public void setTrustedOverlay(SurfaceControl.Transaction t, SurfaceControl sc,
            boolean isTrusted) {
        if (surfaceTrustedOverlay()) {
        t.setTrustedOverlay(sc, isTrusted);
        } else if (isTrusted) {
            inputConfig |= InputConfig.TRUSTED_OVERLAY;
        }
    }
}
+0 −8
Original line number Diff line number Diff line
@@ -3,14 +3,6 @@ container: "system"

# Project link: https://gantry.corp.google.com/projects/android_platform_window_surfaces/changes

flag {
    namespace: "window_surfaces"
    name: "surface_trusted_overlay"
    description: "Whether to add trusted overlay flag on the SurfaceControl or the InputWindow"
    is_fixed_read_only: true
    bug: "292032926"
}

flag {
    namespace: "window_surfaces"
    name: "allow_disable_activity_record_input_sink"
+4 −14
Original line number Diff line number Diff line
@@ -182,7 +182,6 @@ import static com.android.server.wm.WindowStateAnimator.DRAW_PENDING;
import static com.android.server.wm.WindowStateAnimator.HAS_DRAWN;
import static com.android.server.wm.WindowStateAnimator.PRESERVED_SURFACE_LAYER;
import static com.android.server.wm.WindowStateAnimator.READY_TO_SHOW;
import static com.android.window.flags.Flags.surfaceTrustedOverlay;

import android.annotation.CallSuper;
import android.annotation.NonNull;
@@ -1077,9 +1076,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        mInputWindowHandle.setName(getName());
        mInputWindowHandle.setPackageName(mAttrs.packageName);
        mInputWindowHandle.setLayoutParamsType(mAttrs.type);
        if (!surfaceTrustedOverlay()) {
            mInputWindowHandle.setTrustedOverlay(isWindowTrustedOverlay());
        }
        if (DEBUG) {
            Slog.v(TAG, "Window " + this + " client=" + c.asBinder()
                            + " token=" + token + " (" + mAttrs.token + ")" + " params=" + a);
@@ -1142,9 +1138,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
    @Override
    void setInitialSurfaceControlProperties(SurfaceControl.Builder b) {
        super.setInitialSurfaceControlProperties(b);
        if (surfaceTrustedOverlay() && isWindowTrustedOverlay()) {
            getPendingTransaction().setTrustedOverlay(mSurfaceControl, true);
        }
        getPendingTransaction().setTrustedOverlay(mSurfaceControl, isWindowTrustedOverlay());
        getPendingTransaction().setSecure(mSurfaceControl, isSecureLocked());
        // All apps should be considered as occluding when computing TrustedPresentation Thresholds.
        final boolean canOccludePresentation = !mSession.mCanAddInternalSystemWindow;
@@ -6060,13 +6054,9 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
    }

    boolean isTrustedOverlay() {
        if (surfaceTrustedOverlay()) {
        WindowState parentWindow = getParentWindow();
        return isWindowTrustedOverlay() || (parentWindow != null
                && parentWindow.isWindowTrustedOverlay());
        } else {
            return mInputWindowHandle.isTrustedOverlay();
        }
    }

    public boolean receiveFocusFromTapOutside() {
+0 −10
Original line number Diff line number Diff line
@@ -27,8 +27,6 @@ import android.app.Activity;
import android.app.Instrumentation;
import android.os.IBinder;
import android.platform.test.annotations.Presubmit;
import android.platform.test.annotations.RequiresFlagsDisabled;
import android.platform.test.annotations.RequiresFlagsEnabled;
import android.platform.test.flag.junit.CheckFlagsRule;
import android.platform.test.flag.junit.DeviceFlagsValueProvider;
import android.server.wm.BuildUtils;
@@ -41,7 +39,6 @@ import androidx.test.ext.junit.rules.ActivityScenarioRule;
import androidx.test.platform.app.InstrumentationRegistry;

import com.android.server.wm.utils.CommonUtils;
import com.android.window.flags.Flags;

import org.junit.After;
import org.junit.Before;
@@ -85,14 +82,7 @@ public class TrustedOverlayTests {
        CommonUtils.waitUntilActivityRemoved(mActivity);
    }

    @RequiresFlagsDisabled(Flags.FLAG_SURFACE_TRUSTED_OVERLAY)
    @Test
    public void setTrustedOverlayInputWindow() throws InterruptedException {
        testTrustedOverlayChildHelper(false);
    }

    @Test
    @RequiresFlagsEnabled(Flags.FLAG_SURFACE_TRUSTED_OVERLAY)
    public void setTrustedOverlayChildLayer() throws InterruptedException {
        testTrustedOverlayChildHelper(true);
    }