diff --git a/core/java/android/util/FeatureFlagUtils.java b/core/java/android/util/FeatureFlagUtils.java index b73ff901052f0..0338cebf75c6b 100644 --- a/core/java/android/util/FeatureFlagUtils.java +++ b/core/java/android/util/FeatureFlagUtils.java @@ -97,10 +97,6 @@ public class FeatureFlagUtils { /** @hide */ public static final String SETTINGS_AUTO_TEXT_WRAPPING = "settings_auto_text_wrapping"; - /** Flag to enable/disable guest mode UX changes as mentioned in b/214031645 - * @hide - */ - public static final String SETTINGS_GUEST_MODE_UX_CHANGES = "settings_guest_mode_ux_changes"; /** Support Clear Calling feature. * @hide @@ -150,7 +146,6 @@ public class FeatureFlagUtils { DEFAULT_FLAGS.put(SETTINGS_APP_ALLOW_DARK_THEME_ACTIVATION_AT_BEDTIME, "true"); DEFAULT_FLAGS.put(SETTINGS_HIDE_SECOND_LAYER_PAGE_NAVIGATE_UP_BUTTON_IN_TWO_PANE, "true"); DEFAULT_FLAGS.put(SETTINGS_AUTO_TEXT_WRAPPING, "false"); - DEFAULT_FLAGS.put(SETTINGS_GUEST_MODE_UX_CHANGES, "true"); DEFAULT_FLAGS.put(SETTINGS_ENABLE_CLEAR_CALLING, "false"); DEFAULT_FLAGS.put(SETTINGS_ACCESSIBILITY_SIMPLE_CURSOR, "false"); DEFAULT_FLAGS.put(SETTINGS_NEW_KEYBOARD_UI, "false"); diff --git a/packages/SystemUI/src/com/android/systemui/GuestSessionNotification.java b/packages/SystemUI/src/com/android/systemui/GuestSessionNotification.java index b0eaab97c5ac0..fa9a83ec99138 100644 --- a/packages/SystemUI/src/com/android/systemui/GuestSessionNotification.java +++ b/packages/SystemUI/src/com/android/systemui/GuestSessionNotification.java @@ -25,7 +25,6 @@ import android.content.pm.UserInfo; import android.os.Bundle; import android.os.UserHandle; import android.provider.Settings; -import android.util.FeatureFlagUtils; import com.android.internal.messages.nano.SystemMessageProto; import com.android.systemui.util.NotificationChannels; @@ -59,10 +58,8 @@ public final class GuestSessionNotification { } void createPersistentNotification(UserInfo userInfo, boolean isGuestFirstLogin) { - if (!FeatureFlagUtils.isEnabled(mContext, - FeatureFlagUtils.SETTINGS_GUEST_MODE_UX_CHANGES) - || !userInfo.isGuest()) { - // we create a persistent notification only if enabled and only for guests + if (!userInfo.isGuest()) { + // we create a persistent notification only for guests return; } String contentText; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java index dfcdaefd8e030..836d57131fac6 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java @@ -45,7 +45,6 @@ import android.os.UserManager; import android.provider.Settings; import android.telephony.TelephonyCallback; import android.text.TextUtils; -import android.util.FeatureFlagUtils; import android.util.Log; import android.util.SparseArray; import android.util.SparseBooleanArray; @@ -287,10 +286,6 @@ public class UserSwitcherController implements Dumpable { refreshUsers(UserHandle.USER_NULL); } - private static boolean isEnableGuestModeUxChanges(Context context) { - return FeatureFlagUtils.isEnabled(context, FeatureFlagUtils.SETTINGS_GUEST_MODE_UX_CHANGES); - } - /** * Refreshes users from UserManager. * @@ -549,17 +544,9 @@ public class UserSwitcherController implements Dumpable { } if (currUserInfo != null && currUserInfo.isGuest()) { - if (isEnableGuestModeUxChanges(mContext)) { - showExitGuestDialog(currUserId, currUserInfo.isEphemeral(), - record.resolveId(), dialogShower); - return; - } else { - if (currUserInfo.isEphemeral()) { - showExitGuestDialog(currUserId, currUserInfo.isEphemeral(), - record.resolveId(), dialogShower); - return; - } - } + showExitGuestDialog(currUserId, currUserInfo.isEphemeral(), + record.resolveId(), dialogShower); + return; } if (dialogShower != null) { @@ -1056,14 +1043,8 @@ public class UserSwitcherController implements Dumpable { public String getName(Context context, UserRecord item) { if (item.isGuest) { if (item.isCurrent) { - if (isEnableGuestModeUxChanges(context)) { - return context.getString( - com.android.settingslib.R.string.guest_exit_quick_settings_button); - } else { - return context.getString(mController.mGuestUserAutoCreated - ? com.android.settingslib.R.string.guest_reset_guest - : com.android.settingslib.R.string.guest_exit_guest); - } + return context.getString( + com.android.settingslib.R.string.guest_exit_quick_settings_button); } else { if (item.info != null) { return context.getString(com.android.internal.R.string.guest_name); @@ -1080,13 +1061,8 @@ public class UserSwitcherController implements Dumpable { ? com.android.settingslib.R.string.guest_resetting : com.android.internal.R.string.guest_name); } else { - if (isEnableGuestModeUxChanges(context)) { - // we always show "guest" as string, instead of "add guest" - return context.getString(com.android.internal.R.string.guest_name); - } else { - return context.getString( - com.android.settingslib.R.string.guest_new_guest); - } + // we always show "guest" as string, instead of "add guest" + return context.getString(com.android.internal.R.string.guest_name); } } } @@ -1108,11 +1084,7 @@ public class UserSwitcherController implements Dumpable { protected static Drawable getIconDrawable(Context context, UserRecord item) { int iconRes; if (item.isAddUser) { - if (isEnableGuestModeUxChanges(context)) { - iconRes = R.drawable.ic_add; - } else { - iconRes = R.drawable.ic_account_circle_filled; - } + iconRes = R.drawable.ic_add; } else if (item.isGuest) { iconRes = R.drawable.ic_account_circle; } else if (item.isAddSupervisedUser) { @@ -1289,46 +1261,32 @@ public class UserSwitcherController implements Dumpable { ExitGuestDialog(Context context, int guestId, boolean isGuestEphemeral, int targetId) { super(context); - if (isEnableGuestModeUxChanges(context)) { - if (isGuestEphemeral) { - setTitle(context.getString( - com.android.settingslib.R.string.guest_exit_dialog_title)); - setMessage(context.getString( - com.android.settingslib.R.string.guest_exit_dialog_message)); - setButton(DialogInterface.BUTTON_NEUTRAL, - context.getString(android.R.string.cancel), this); - setButton(DialogInterface.BUTTON_POSITIVE, - context.getString( - com.android.settingslib.R.string.guest_exit_dialog_button), this); - } else { - setTitle(context.getString( - com.android.settingslib - .R.string.guest_exit_dialog_title_non_ephemeral)); - setMessage(context.getString( - com.android.settingslib - .R.string.guest_exit_dialog_message_non_ephemeral)); - setButton(DialogInterface.BUTTON_NEUTRAL, - context.getString(android.R.string.cancel), this); - setButton(DialogInterface.BUTTON_NEGATIVE, - context.getString( - com.android.settingslib.R.string.guest_exit_clear_data_button), - this); - setButton(DialogInterface.BUTTON_POSITIVE, - context.getString( - com.android.settingslib.R.string.guest_exit_save_data_button), - this); - } - } else { - setTitle(mGuestUserAutoCreated - ? com.android.settingslib.R.string.guest_reset_guest_dialog_title - : com.android.settingslib.R.string.guest_remove_guest_dialog_title); - setMessage(context.getString(R.string.guest_exit_guest_dialog_message)); + if (isGuestEphemeral) { + setTitle(context.getString( + com.android.settingslib.R.string.guest_exit_dialog_title)); + setMessage(context.getString( + com.android.settingslib.R.string.guest_exit_dialog_message)); setButton(DialogInterface.BUTTON_NEUTRAL, context.getString(android.R.string.cancel), this); setButton(DialogInterface.BUTTON_POSITIVE, - context.getString(mGuestUserAutoCreated - ? com.android.settingslib.R.string.guest_reset_guest_confirm_button - : com.android.settingslib.R.string.guest_remove_guest_confirm_button), + context.getString( + com.android.settingslib.R.string.guest_exit_dialog_button), this); + } else { + setTitle(context.getString( + com.android.settingslib + .R.string.guest_exit_dialog_title_non_ephemeral)); + setMessage(context.getString( + com.android.settingslib + .R.string.guest_exit_dialog_message_non_ephemeral)); + setButton(DialogInterface.BUTTON_NEUTRAL, + context.getString(android.R.string.cancel), this); + setButton(DialogInterface.BUTTON_NEGATIVE, + context.getString( + com.android.settingslib.R.string.guest_exit_clear_data_button), + this); + setButton(DialogInterface.BUTTON_POSITIVE, + context.getString( + com.android.settingslib.R.string.guest_exit_save_data_button), this); } SystemUIDialog.setWindowOnTop(this, mKeyguardStateController.isShowing()); @@ -1345,39 +1303,29 @@ public class UserSwitcherController implements Dumpable { if (mFalsingManager.isFalseTap(penalty)) { return; } - if (isEnableGuestModeUxChanges(getContext())) { - if (mIsGuestEphemeral) { - if (which == DialogInterface.BUTTON_POSITIVE) { - mDialogLaunchAnimator.dismissStack(this); - // Ephemeral guest: exit guest, guest is removed by the system - // on exit, since its marked ephemeral - exitGuestUser(mGuestId, mTargetId, false); - } else if (which == DialogInterface.BUTTON_NEGATIVE) { - // Cancel clicked, do nothing - cancel(); - } - } else { - if (which == DialogInterface.BUTTON_POSITIVE) { - mDialogLaunchAnimator.dismissStack(this); - // Non-ephemeral guest: exit guest, guest is not removed by the system - // on exit, since its marked non-ephemeral - exitGuestUser(mGuestId, mTargetId, false); - } else if (which == DialogInterface.BUTTON_NEGATIVE) { - mDialogLaunchAnimator.dismissStack(this); - // Non-ephemeral guest: remove guest and then exit - exitGuestUser(mGuestId, mTargetId, true); - } else if (which == DialogInterface.BUTTON_NEUTRAL) { - // Cancel clicked, do nothing - cancel(); - } + if (mIsGuestEphemeral) { + if (which == DialogInterface.BUTTON_POSITIVE) { + mDialogLaunchAnimator.dismissStack(this); + // Ephemeral guest: exit guest, guest is removed by the system + // on exit, since its marked ephemeral + exitGuestUser(mGuestId, mTargetId, false); + } else if (which == DialogInterface.BUTTON_NEGATIVE) { + // Cancel clicked, do nothing + cancel(); } } else { - if (which == BUTTON_NEUTRAL) { - cancel(); - } else { - mUiEventLogger.log(QSUserSwitcherEvent.QS_USER_GUEST_REMOVE); + if (which == DialogInterface.BUTTON_POSITIVE) { mDialogLaunchAnimator.dismissStack(this); - removeGuestUser(mGuestId, mTargetId); + // Non-ephemeral guest: exit guest, guest is not removed by the system + // on exit, since its marked non-ephemeral + exitGuestUser(mGuestId, mTargetId, false); + } else if (which == DialogInterface.BUTTON_NEGATIVE) { + mDialogLaunchAnimator.dismissStack(this); + // Non-ephemeral guest: remove guest and then exit + exitGuestUser(mGuestId, mTargetId, true); + } else if (which == DialogInterface.BUTTON_NEUTRAL) { + // Cancel clicked, do nothing + cancel(); } } }