Merge "Prevents scroll capture from targetting secure windows" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
7ee0307aed
@@ -61,6 +61,7 @@ import static android.view.WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW;
|
|||||||
import static android.view.WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
|
import static android.view.WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
|
||||||
import static android.view.WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE;
|
import static android.view.WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE;
|
||||||
import static android.view.WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL;
|
import static android.view.WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL;
|
||||||
|
import static android.view.WindowManager.LayoutParams.FLAG_SECURE;
|
||||||
import static android.view.WindowManager.LayoutParams.FLAG_SPLIT_TOUCH;
|
import static android.view.WindowManager.LayoutParams.FLAG_SPLIT_TOUCH;
|
||||||
import static android.view.WindowManager.LayoutParams.LAST_APPLICATION_WINDOW;
|
import static android.view.WindowManager.LayoutParams.LAST_APPLICATION_WINDOW;
|
||||||
import static android.view.WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN;
|
import static android.view.WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN;
|
||||||
@@ -5829,7 +5830,9 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
|
|||||||
return false; /* continue */
|
return false; /* continue */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (nextWindow.isSecureLocked()) {
|
||||||
|
return false; /* continue */
|
||||||
|
}
|
||||||
return true; /* stop, match found */
|
return true; /* stop, match found */
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ import static android.view.WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_B
|
|||||||
import static android.view.WindowManager.LayoutParams.FIRST_SUB_WINDOW;
|
import static android.view.WindowManager.LayoutParams.FIRST_SUB_WINDOW;
|
||||||
import static android.view.WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR;
|
import static android.view.WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR;
|
||||||
import static android.view.WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN;
|
import static android.view.WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN;
|
||||||
|
import static android.view.WindowManager.LayoutParams.FLAG_SECURE;
|
||||||
import static android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
|
import static android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
|
||||||
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_NO_MOVE_ANIMATION;
|
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_NO_MOVE_ANIMATION;
|
||||||
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
|
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
|
||||||
@@ -1745,6 +1746,31 @@ public class DisplayContentTests extends WindowTestsBase {
|
|||||||
assertEquals(activityWindow, result);
|
assertEquals(activityWindow, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testFindScrollCaptureTargetWindow_secure() {
|
||||||
|
DisplayContent display = createNewDisplay();
|
||||||
|
Task rootTask = createTask(display);
|
||||||
|
Task task = createTaskInRootTask(rootTask, 0 /* userId */);
|
||||||
|
WindowState secureWindow = createWindow(null, TYPE_APPLICATION, "Secure Window");
|
||||||
|
secureWindow.mAttrs.flags |= FLAG_SECURE;
|
||||||
|
|
||||||
|
WindowState result = display.findScrollCaptureTargetWindow(null,
|
||||||
|
ActivityTaskManager.INVALID_TASK_ID);
|
||||||
|
assertNull(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testFindScrollCaptureTargetWindow_secureTaskId() {
|
||||||
|
DisplayContent display = createNewDisplay();
|
||||||
|
Task rootTask = createTask(display);
|
||||||
|
Task task = createTaskInRootTask(rootTask, 0 /* userId */);
|
||||||
|
WindowState secureWindow = createWindow(null, TYPE_APPLICATION, "Secure Window");
|
||||||
|
secureWindow.mAttrs.flags |= FLAG_SECURE;
|
||||||
|
|
||||||
|
WindowState result = display.findScrollCaptureTargetWindow(null, task.mTaskId);
|
||||||
|
assertNull(result);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testFindScrollCaptureTargetWindow_taskId() {
|
public void testFindScrollCaptureTargetWindow_taskId() {
|
||||||
DisplayContent display = createNewDisplay();
|
DisplayContent display = createNewDisplay();
|
||||||
|
|||||||
Reference in New Issue
Block a user