Fix incorrect talkback announcement for app -> home

This change removes the talkback announcement for the background app LauncherState, which defaulted to "Recent apps".

Flag: EXEMPT bug fix
Fixes: 418854152
Test: attempted home/overview/quick switch gestures from home and app
Change-Id: I1f390902dfddd2e8576743dbbddce65121690f14
This commit is contained in:
Schneider Victor-Tulias committed 2025-06-06 15:03:51 -04:00
1 parent 3883ac96ff
commit 672c8a10e4
4 files changed
+18 -1

No files matched your search

@@ -35,6 +35,7 @@ import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_HOTSEAT
import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APPLICATION;
import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT;
import static com.android.launcher3.LauncherState.ALL_APPS;
import static com.android.launcher3.LauncherState.FLAG_SKIP_STATE_ANNOUNCEMENT;
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.LauncherState.NO_OFFSET;
import static com.android.launcher3.LauncherState.OVERVIEW;
@@ -671,6 +672,15 @@ public class QuickstepLauncher extends Launcher implements RecentsViewContainer,
}
}
@Override
protected void setTitle(@NonNull LauncherState state) {
if (state.hasFlag(FLAG_SKIP_STATE_ANNOUNCEMENT)) {
// Prevent accessibility title update announcement
getWindow().getAttributes().accessibilityTitle = getString(state.getTitle());
}
super.setTitle(state);
}
@Override
public TouchController[] createTouchControllers() {
NavigationMode mode = DisplayController.getNavigationMode(this);
@@ -35,7 +35,8 @@ import com.android.quickstep.views.RecentsView;
public class BackgroundAppState extends OverviewState {
private static final int STATE_FLAGS = FLAG_DISABLE_RESTORE | FLAG_RECENTS_VIEW_VISIBLE
| FLAG_WORKSPACE_INACCESSIBLE | FLAG_NON_INTERACTIVE | FLAG_CLOSE_POPUPS;
| FLAG_WORKSPACE_INACCESSIBLE | FLAG_NON_INTERACTIVE | FLAG_CLOSE_POPUPS
| FLAG_SKIP_STATE_ANNOUNCEMENT;
public BackgroundAppState(int id) {
this(id, LAUNCHER_STATE_BACKGROUND);
+3
View File
@@ -1172,7 +1172,10 @@ public class Launcher extends StatefulActivity<LauncherState>
getAllAppsExitEvent().ifPresent(getStatsLogManager().logger()::log);
mAllAppsSessionLogId = null;
}
setTitle(state);
}
protected void setTitle(@NonNull LauncherState state) {
// Set screen title for Talkback
setTitle(state.getTitle());
}
@@ -91,6 +91,9 @@ public abstract class LauncherState implements BaseState<LauncherState> {
// Flag indicating that hotseat and its contents are not accessible.
public static final int FLAG_HOTSEAT_INACCESSIBLE = BaseState.getFlag(7);
// Flag indicating that this state should not be announced by Talkback when reached
public static final int FLAG_SKIP_STATE_ANNOUNCEMENT = BaseState.getFlag(8);
public static final float NO_OFFSET = 0;
public static final float NO_SCALE = 1;