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

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

Merge "Remove screen share protection on transaction commit" into main

parents e8a16c01 36e7e62c
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import static android.view.flags.Flags.FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY;
import static android.view.flags.Flags.FLAG_VIEW_VELOCITY_API;
import static android.view.flags.Flags.enableUseMeasureCacheDuringForceLayout;
import static android.view.flags.Flags.sensitiveContentAppProtection;
import static android.view.flags.Flags.sensitiveContentPrematureProtectionRemovedFix;
import static android.view.flags.Flags.toolkitFrameRateBySizeReadOnly;
import static android.view.flags.Flags.toolkitFrameRateDefaultNormalReadOnly;
import static android.view.flags.Flags.toolkitFrameRateSmallUsesPercentReadOnly;
@@ -32237,8 +32238,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        void decreaseSensitiveViewsCount() {
            mSensitiveViewsCount--;
            if (mSensitiveViewsCount == 0) {
                if (sensitiveContentPrematureProtectionRemovedFix()) {
                    mViewRootImpl.removeSensitiveContentProtectionOnTransactionCommit();
                } else {
                    mViewRootImpl.notifySensitiveContentAppProtection(false);
                }
            }
            if (mSensitiveViewsCount < 0) {
                Log.wtf(VIEW_LOG_TAG, "mSensitiveViewsCount is negative" + mSensitiveViewsCount);
                mSensitiveViewsCount = 0;
+23 −0
Original line number Diff line number Diff line
@@ -317,6 +317,7 @@ public final class ViewRootImpl implements ViewParent,
    private static final boolean DEBUG_SCROLL_CAPTURE = false || LOCAL_LOGV;
    private static final boolean DEBUG_TOUCH_NAVIGATION = false || LOCAL_LOGV;
    private static final boolean DEBUG_BLAST = false || LOCAL_LOGV;
    private static final boolean DEBUG_SENSITIVE_CONTENT = false || LOCAL_LOGV;
    private static final int LOGTAG_INPUT_FOCUS = 62001;
    private static final int LOGTAG_VIEWROOT_DRAW_EVENT = 60004;
@@ -4336,6 +4337,10 @@ public final class ViewRootImpl implements ViewParent,
            if (mSensitiveContentProtectionService == null) {
                return;
            }
            if (DEBUG_SENSITIVE_CONTENT) {
                Log.d(TAG, "Notify sensitive content, package=" + mContext.getPackageName()
                        + ", token=" + getWindowToken() + ", flag=" + showSensitiveContent);
            }
            // The window would be blocked during screen share if it shows sensitive content.
            mSensitiveContentProtectionService.setSensitiveContentProtection(
                    getWindowToken(), mContext.getPackageName(), showSensitiveContent);
@@ -4344,6 +4349,24 @@ public final class ViewRootImpl implements ViewParent,
        }
    }
    /**
     * Sensitive protection is removed on transaction commit to avoid prematurely removing
     * the protection.
     */
    void removeSensitiveContentProtectionOnTransactionCommit() {
        if (DEBUG_SENSITIVE_CONTENT) {
            Log.d(TAG, "Add transaction to remove sensitive content protection, package="
                    + mContext.getPackageName() + ", token=" + getWindowToken());
        }
        Transaction t = new Transaction();
        t.addTransactionCommittedListener(mExecutor, () -> {
            if (mAttachInfo.mSensitiveViewsCount == 0) {
                notifySensitiveContentAppProtection(false);
            }
        });
        applyTransactionOnDraw(t);
    }
    private void notifyContentCaptureEvents() {
        if (!isContentCaptureEnabled()) {
            if (DEBUG_CONTENT_CAPTURE) {
+12 −0
Original line number Diff line number Diff line
@@ -45,6 +45,18 @@ flag {
  is_fixed_read_only: true
}

flag {
  name: "sensitive_content_premature_protection_removed_fix"
  namespace: "permissions"
  description: "Bug fix where sensitive content protection is prematurely removed."
  bug: "336626172"
  # Referenced in WM where WM starts before DeviceConfig
  is_fixed_read_only: true
  metadata {
      purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "enable_arrow_icon_on_hover_when_clickable"
    namespace: "toolkit"