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

Commit fdd04d42 authored by Adrian Roos's avatar Adrian Roos Committed by Android (Google) Code Review
Browse files

Merge changes Ibb63814e,I0322b1e6 into lmp-dev

* changes:
  Prevent full shade guesture from doing the wrong thing
  Add current user announce to MultiUserSwitch
parents d26a20fc aee70462
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -756,6 +756,9 @@
    <!-- Accessibility label for the button that opens the user switcher. -->
    <string name="accessibility_multi_user_switch_switcher">Switch user</string>

    <!-- Accessibility label for the button that opens the user switcher and announces the current user. -->
    <string name="accessibility_multi_user_switch_switcher_with_current">Switch user, current user <xliff:g id="current_user_name" example="John Doe">%s</xliff:g></string>

    <!-- Accessibility label for the button that opens the quick contact of the user. -->
    <string name="accessibility_multi_user_switch_quick_contact">Show profile</string>

+2 −0
Original line number Diff line number Diff line
@@ -558,6 +558,8 @@ public abstract class BaseStatusBar extends SystemUI implements
            // disable lockscreen notifications until user acts on the banner.
            Settings.Secure.putInt(mContext.getContentResolver(),
                    Settings.Secure.LOCK_SCREEN_SHOW_NOTIFICATIONS, 0);
            Settings.Secure.putInt(mContext.getContentResolver(),
                    Settings.Secure.LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, 0);

            final String packageName = mContext.getPackageName();
            PendingIntent cancelIntent = PendingIntent.getBroadcast(mContext, 0,
+16 −3
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import android.widget.FrameLayout;
import com.android.systemui.R;
import com.android.systemui.qs.QSPanel;
import com.android.systemui.statusbar.policy.KeyguardUserSwitcher;
import com.android.systemui.statusbar.policy.UserSwitcherController;

/**
 * Container for image of the multi user switcher (tappable).
@@ -90,9 +91,21 @@ public class MultiUserSwitch extends FrameLayout implements View.OnClickListener

        if (isClickable()) {
            final UserManager um = UserManager.get(getContext());
            String text = mContext.getString(um.isUserSwitcherEnabled()
                    ? R.string.accessibility_multi_user_switch_switcher
                    : R.string.accessibility_multi_user_switch_quick_contact);
            String text;
            if (um.isUserSwitcherEnabled()) {
                UserSwitcherController controller = mQsPanel.getHost()
                        .getUserSwitcherController();
                String currentUser = controller.getCurrentUserName(mContext);
                if (TextUtils.isEmpty(currentUser)) {
                    text = mContext.getString(R.string.accessibility_multi_user_switch_switcher);
                } else {
                    text = mContext.getString(
                            R.string.accessibility_multi_user_switch_switcher_with_current,
                            currentUser);
                }
            } else {
                text = mContext.getString(R.string.accessibility_multi_user_switch_quick_contact);
            }
            if (!TextUtils.isEmpty(text)) {
                event.getText().add(text);
            }
+3 −1
Original line number Diff line number Diff line
@@ -3774,7 +3774,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
            row = (ExpandableNotificationRow) expandView;
            row.setUserExpanded(true);
        }
        if (isLockscreenPublicMode() && !userAllowsPrivateNotificationsInPublic(mCurrentUserId)) {
        boolean fullShadeNeedsBouncer = !userAllowsPrivateNotificationsInPublic(mCurrentUserId)
                || !mShowLockscreenNotifications;
        if (isLockscreenPublicMode() && fullShadeNeedsBouncer) {
            mLeaveOpenOnKeyguardHide = true;
            showBouncer();
            mDraggedDownRow = row;
+8 −0
Original line number Diff line number Diff line
@@ -334,6 +334,14 @@ public class UserSwitcherController {
        }
    }

    public String getCurrentUserName(Context context) {
        if (mUsers.isEmpty()) return null;
        UserRecord item = mUsers.get(0);
        if (item == null || item.info == null) return null;
        if (item.isGuest) return context.getString(R.string.guest_nickname);
        return item.info.name;
    }

    public static abstract class BaseUserAdapter extends BaseAdapter {

        final UserSwitcherController mController;