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

Commit 1b48b467 authored by Gaurav Bhola's avatar Gaurav Bhola
Browse files

Disable the trustedOverlay flag for taskview

- TaskView is meant to contain app activities which shouldn't have
  trusted overlay set even when itself placed in a window which is
  trusted.

Fix: 339701674
Fix: 342050101
Bug: 320410671
Test: atest WindowUntrustedTouchTest
Change-Id: Ib9e3c73516aba7f407e8bcbf8cb9cd7477f40fa8
parent 2dc7b8b3
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -30,6 +30,7 @@ import android.content.Intent;
import android.content.pm.LauncherApps;
import android.content.pm.LauncherApps;
import android.content.pm.ShortcutInfo;
import android.content.pm.ShortcutInfo;
import android.graphics.Rect;
import android.graphics.Rect;
import android.gui.TrustedOverlay;
import android.os.Binder;
import android.os.Binder;
import android.util.CloseGuard;
import android.util.CloseGuard;
import android.util.Slog;
import android.util.Slog;
@@ -448,6 +449,14 @@ public class TaskViewTaskController implements ShellTaskOrganizer.TaskListener {
        mSurfaceCreated = true;
        mSurfaceCreated = true;
        mIsInitialized = true;
        mIsInitialized = true;
        mSurfaceControl = surfaceControl;
        mSurfaceControl = surfaceControl;
        // SurfaceControl is expected to be null only in the case of unit tests. Guard against it
        // to avoid runtime exception in SurfaceControl.Transaction.
        if (surfaceControl != null) {
            // TaskView is meant to contain app activities which shouldn't have trusted overlays
            // flag set even when itself reparented in a window which is trusted.
            mTransaction.setTrustedOverlay(surfaceControl, TrustedOverlay.DISABLED)
                    .apply();
        }
        notifyInitialized();
        notifyInitialized();
        mShellExecutor.execute(() -> {
        mShellExecutor.execute(() -> {
            if (mTaskToken == null) {
            if (mTaskToken == null) {