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

Commit 63c61476 authored by Hawkwood Glazier's avatar Hawkwood Glazier
Browse files

Remove User Switched Announcement

Bug: 386713655
Flag: NONE Accessibility Bugfix
Test: Manually confirmed announcement removed
Change-Id: I2e44fdf696c237c863bbfef36c4e8f659ac8c053
parent c26379f2
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -5060,8 +5060,6 @@
    <!-- Notification action button. Click it will open the bluetooth device details page for this hearing device. It will be shown when making a phone call with the hearing device. [CHAR LIMIT=none] -->
    <string name="hearing_device_notification_settings_button">Settings</string>
    <!-- Text spoken when the current user is switched if accessibility is enabled. [CHAR LIMIT=none] -->
    <string name="user_switched">Current user <xliff:g id="name" example="Bob">%1$s</xliff:g>.</string>
    <!-- Message shown when switching to a user [CHAR LIMIT=none] -->
    <string name="user_switching_message">Switching to <xliff:g id="name" example="Bob">%1$s</xliff:g>\u2026</string>
    <!-- Message when logging out a user on a split user system -->
+0 −24
Original line number Diff line number Diff line
@@ -2148,9 +2148,6 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
                        this, 0, oldUserState.mUserId));
            }

            // Announce user changes only if more than one exist.
            final boolean announceNewUser = mUserManager.getUsers().size() > 1;

            // The user changed.
            mCurrentUserId = userId;
            AccessibilityUserState userState = getCurrentUserStateLocked();
@@ -2177,13 +2174,6 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
            // As an initialization step, update the shortcuts for the current user.
            updateShortcutsForCurrentNavigationMode();

            if (announceNewUser) {
                // Schedule announcement of the current user if needed.
                mMainHandler.sendMessageDelayed(
                        obtainMessage(AccessibilityManagerService::announceNewUserIfNeeded, this),
                        WAIT_FOR_USER_STATE_FULLY_INITIALIZED_MILLIS);
            }

            for (IUserInitializationCompleteCallback callback
                    : mUserInitializationCompleteCallbacks) {
                try {
@@ -2197,20 +2187,6 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
        }
    }

    private void announceNewUserIfNeeded() {
        synchronized (mLock) {
            AccessibilityUserState userState = getCurrentUserStateLocked();
            if (userState.isHandlingAccessibilityEventsLocked()) {
                String message = mContext.getString(R.string.user_switched,
                        mUserManager.getUserInfo(mCurrentUserId).name);
                AccessibilityEvent event = AccessibilityEvent.obtain(
                        AccessibilityEvent.TYPE_ANNOUNCEMENT);
                event.getText().add(message);
                sendAccessibilityEventLocked(event, mCurrentUserId);
            }
        }
    }

    private void unlockUser(int userId) {
        synchronized (mLock) {
            int parentUserId = mSecurityPolicy.resolveProfileParentLocked(userId);