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

Commit d369c091 authored by jasonwshsu's avatar jasonwshsu Committed by Jason Hsu
Browse files

Hearing aids shortcut can not lead to expected page on tablet device

Root Cause: Tablet device use two panel mode to launch fragment

Solution: Add Intent.FLAG_ACTIVITY_CLEAR_TOP to clear each time

Bug: 263454905
Test: flash rom and verify shortcut behabior on tablet
Change-Id: I79004f07c5c1ee71f9cce61dad009cc4cb4a89d4
parent 76293757
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1881,7 +1881,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
    private void launchAccessibilitySubSettings(int displayId, ComponentName name) {
    private void launchAccessibilitySubSettings(int displayId, ComponentName name) {
        final Intent intent = new Intent(Settings.ACTION_ACCESSIBILITY_DETAILS_SETTINGS);
        final Intent intent = new Intent(Settings.ACTION_ACCESSIBILITY_DETAILS_SETTINGS);
        final Bundle bundle = ActivityOptions.makeBasic().setLaunchDisplayId(displayId).toBundle();
        final Bundle bundle = ActivityOptions.makeBasic().setLaunchDisplayId(displayId).toBundle();
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
        intent.putExtra(Intent.EXTRA_COMPONENT_NAME, name.flattenToString());
        intent.putExtra(Intent.EXTRA_COMPONENT_NAME, name.flattenToString());
        try {
        try {
            mContext.startActivityAsUser(intent, bundle, UserHandle.of(mCurrentUserId));
            mContext.startActivityAsUser(intent, bundle, UserHandle.of(mCurrentUserId));