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

Commit 6ad8fdff authored by Candice Lo's avatar Candice Lo
Browse files

Change the flag of magnification settings to TYPE_NAVIGATION_BAR_PANE

Change the flag of magnification settings panel to
TYPE_NAVIGATION_BAR_PANE to allow users to interact with the panel
through accessibility services.

Bug: 266499977
Test: manually - attach videos to the bug
Test: atest MagnificationSettingsControllerTest
WindowMagnificationSettingsTest

Change-Id: I58069c7f1d81487853cc7555508beb2d1aa2b2e8
parent 7220f21d
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.content.ComponentCallbacks;
import android.content.Context;
import android.content.res.Configuration;
import android.util.Range;
import android.view.WindowManager;

import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.graphics.SfVsyncFrameCallbackProvider;
@@ -68,14 +69,18 @@ public class MagnificationSettingsController implements ComponentCallbacks {
            @NonNull Callback settingsControllerCallback,
            SecureSettings secureSettings,
            WindowMagnificationSettings windowMagnificationSettings) {
        mContext = context;
        mContext = context.createWindowContext(
                context.getDisplay(),
                WindowManager.LayoutParams.TYPE_NAVIGATION_BAR_PANEL,
                null);
        mContext.setTheme(com.android.systemui.R.style.Theme_SystemUI);
        mDisplayId = mContext.getDisplayId();
        mConfiguration = new Configuration(context.getResources().getConfiguration());
        mConfiguration = new Configuration(mContext.getResources().getConfiguration());
        mSettingsControllerCallback = settingsControllerCallback;
        if (windowMagnificationSettings != null) {
            mWindowMagnificationSettings = windowMagnificationSettings;
        } else {
            mWindowMagnificationSettings = new WindowMagnificationSettings(context,
            mWindowMagnificationSettings = new WindowMagnificationSettings(mContext,
                    mWindowMagnificationSettingsCallback,
                    sfVsyncFrameProvider, secureSettings);
        }
+1 −1
Original line number Diff line number Diff line
@@ -559,7 +559,7 @@ class WindowMagnificationSettings implements MagnificationGestureDetector.OnGest
        final LayoutParams params = new LayoutParams(
                LayoutParams.WRAP_CONTENT,
                LayoutParams.WRAP_CONTENT,
                LayoutParams.TYPE_ACCESSIBILITY_MAGNIFICATION_OVERLAY,
                LayoutParams.TYPE_NAVIGATION_BAR_PANEL,
                LayoutParams.FLAG_NOT_FOCUSABLE,
                PixelFormat.TRANSPARENT);
        params.gravity = Gravity.TOP | Gravity.START;