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

Commit d60338ea authored by PETER LIANG's avatar PETER LIANG Committed by Automerger Merge Worker
Browse files

Merge "Fix the title of the HW "Edit shortcuts" menu is truncated when the...

Merge "Fix the title of the HW "Edit shortcuts" menu is truncated when the device is folded." into sc-v2-dev am: d596ae37

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15746905

Change-Id: I2f993d298f539259506d499a242baa4a24ad487b
parents cd32ccaa d596ae37
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -47,6 +47,8 @@ import java.util.List;
public class AccessibilityShortcutChooserActivity extends Activity {
    @ShortcutType
    private final int mShortcutType = ACCESSIBILITY_SHORTCUT_KEY;
    private static final String KEY_ACCESSIBILITY_SHORTCUT_MENU_MODE =
            "accessibility_shortcut_menu_mode";
    private final List<AccessibilityTarget> mTargets = new ArrayList<>();
    private AlertDialog mMenuDialog;
    private AlertDialog mPermissionDialog;
@@ -66,14 +68,30 @@ public class AccessibilityShortcutChooserActivity extends Activity {
        mMenuDialog = createMenuDialog();
        mMenuDialog.setOnShowListener(dialog -> updateDialogListeners());
        mMenuDialog.show();

        if (savedInstanceState != null) {
            final int restoreShortcutMenuMode =
                    savedInstanceState.getInt(KEY_ACCESSIBILITY_SHORTCUT_MENU_MODE,
                            ShortcutMenuMode.LAUNCH);
            if (restoreShortcutMenuMode == ShortcutMenuMode.EDIT) {
                onEditButtonClicked();
            }
        }
    }

    @Override
    protected void onDestroy() {
        mMenuDialog.setOnDismissListener(null);
        mMenuDialog.dismiss();
        super.onDestroy();
    }

    @Override
    protected void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        outState.putInt(KEY_ACCESSIBILITY_SHORTCUT_MENU_MODE, mTargetAdapter.getShortcutMenuMode());
    }

    private void onTargetSelected(AdapterView<?> parent, View view, int position, long id) {
        final AccessibilityTarget target = mTargets.get(position);
        target.onSelected();
+0 −1
Original line number Diff line number Diff line
@@ -5881,7 +5881,6 @@
                  android:excludeFromRecents="true"
                  android:documentLaunchMode="never"
                  android:relinquishTaskIdentity="true"
                  android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation|keyboard|keyboardHidden"
                  android:process=":ui"
                  android:visibleToInstantApps="true">
            <intent-filter>