Fix the layout flag for magnification settings

Adding the flag FLAG_NOT_FOCUSABLE to enable interaction with the
screen below the layer of settings panel. The logic of requesting focus
on the settings panel when it is opened is also removed since
requestFocus does not work on the view with the flag.

Bug: 241996711
Test: manually - attach videos to the bug
Test: atest WindowMagnificationSettingsTest
Change-Id: Ib0aac29a27de14b1fa35b87fa840dd56ae00be6b
This commit is contained in:
Candice Lo
2023-03-08 06:57:46 +00:00
parent 8b0a18473b
commit 394ad6dfd1
2 changed files with 1 additions and 12 deletions

View File

@@ -354,10 +354,6 @@ class WindowMagnificationSettings implements MagnificationGestureDetector.OnGest
}
mWindowManager.addView(mSettingView, mParams);
if (resetPosition) {
// Request focus on the settings panel when position of the panel is reset.
mSettingView.requestFocus();
}
// Exclude magnification switch button from system gesture area.
setSystemGestureExclusion();
@@ -536,7 +532,7 @@ class WindowMagnificationSettings implements MagnificationGestureDetector.OnGest
LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT,
LayoutParams.TYPE_ACCESSIBILITY_MAGNIFICATION_OVERLAY,
/* _flags= */ 0,
LayoutParams.FLAG_NOT_FOCUSABLE,
PixelFormat.TRANSPARENT);
params.gravity = Gravity.TOP | Gravity.START;
params.accessibilityTitle = getAccessibilityWindowTitle(context);

View File

@@ -201,13 +201,6 @@ public class WindowMagnificationSettingsTest extends SysuiTestCase {
assertThat(magnifierMediumButton.isSelected()).isTrue();
}
@Test
public void showSettingPanel_focusOnThePanel() {
mWindowMagnificationSettings.showSettingPanel();
assertThat(mSettingView.isFocused()).isTrue();
}
private <T extends View> T getInternalView(@IdRes int idRes) {
T view = mSettingView.findViewById(idRes);
assertNotNull(view);