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
This commit is contained in:
Kedar Chitnis
2022-08-18 05:17:06 +00:00
parent 18c444523d
commit ba69f26dae
3 changed files with 53 additions and 114 deletions

View File

@@ -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");
}

View File

@@ -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;

View File

@@ -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();
}
}
}