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

Commit ba69f26d authored by Kedar Chitnis's avatar Kedar Chitnis
Browse files

Remove feature flag SETTINGS_GUEST_MODE_UX_CHANGES

Bug b/214031645 has all IC reviews approved and the feature has been
merged and tested for more than 3 months. Hence removing the feature
flag.

Bug: 214031645
Test: SettingsTest, SystemUITests
Change-Id: I12b4d60ffc76c20e0964d8e222b13907009b0cd7
Merged-In: I12b4d60ffc76c20e0964d8e222b13907009b0cd7
parent 18c44452
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -83,11 +83,6 @@ public class FeatureFlagUtils {
    public static final String SETTINGS_HIDE_SECOND_LAYER_PAGE_NAVIGATE_UP_BUTTON_IN_TWO_PANE =
            "settings_hide_second_layer_page_navigate_up_button_in_two_pane";

    /** 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
     */
@@ -120,7 +115,6 @@ public class FeatureFlagUtils {
        DEFAULT_FLAGS.put(SETTINGS_ENABLE_MONITOR_PHANTOM_PROCS, "true");
        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_GUEST_MODE_UX_CHANGES, "true");
        DEFAULT_FLAGS.put(SETTINGS_ENABLE_CLEAR_CALLING, "false");
    }

+2 −5
Original line number Diff line number Diff line
@@ -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;
+50 −102
Original line number Diff line number Diff line
@@ -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,18 +544,10 @@ 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;
        }
            }
        }

        if (dialogShower != null) {
            // If we haven't morphed into another dialog, it means we have just switched users.
@@ -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);
                    }
                } 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);
                            }
                        }
                    }
                }
@@ -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;
                }
            } else if (item.isGuest) {
                iconRes = R.drawable.ic_account_circle;
            } else if (item.isAddSupervisedUser) {
@@ -1289,7 +1261,6 @@ 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));
@@ -1318,19 +1289,6 @@ public class UserSwitcherController implements Dumpable {
                            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));
                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),
                        this);
            }
            SystemUIDialog.setWindowOnTop(this, mKeyguardStateController.isShowing());
            setCanceledOnTouchOutside(false);
            mGuestId = guestId;
@@ -1345,7 +1303,6 @@ public class UserSwitcherController implements Dumpable {
            if (mFalsingManager.isFalseTap(penalty)) {
                return;
            }
            if (isEnableGuestModeUxChanges(getContext())) {
            if (mIsGuestEphemeral) {
                if (which == DialogInterface.BUTTON_POSITIVE) {
                    mDialogLaunchAnimator.dismissStack(this);
@@ -1371,15 +1328,6 @@ public class UserSwitcherController implements Dumpable {
                    cancel();
                }
            }
            } else {
                if (which == BUTTON_NEUTRAL) {
                    cancel();
                } else {
                    mUiEventLogger.log(QSUserSwitcherEvent.QS_USER_GUEST_REMOVE);
                    mDialogLaunchAnimator.dismissStack(this);
                    removeGuestUser(mGuestId, mTargetId);
                }
            }
        }
    }