Change user setup prompt dialog showing logic
- Extract user setup prompt dialog creation logic - Move user setup prompt dialog showing to UserDetailsSettings - Rename user click and creation related methods to improve readability - Set "disabled by admin" for switch pref when switch is disabled - Cleanup UserSettings and UserDetailsSettings onPreferenceClick - After a guest is created the details page opens instead of switching Test: Manual test and robo tests with this command: make -j64 RunSettingsRoboTests Demo: http://shortn/_ACYsnbIKO9 Bug: 156867277 Change-Id: Ifa0cdefcd49d5b865e940a7cc332136ed26ecf57
This commit is contained in:
@@ -138,4 +138,21 @@ public final class UserDialogs {
|
||||
.setNegativeButton(android.R.string.cancel, null)
|
||||
.create();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a dialog to confirm that the user is ok to start setting up a new user.
|
||||
*
|
||||
* @param onConfirmListener Callback object for positive action
|
||||
*/
|
||||
public static Dialog createSetupUserDialog(Context context,
|
||||
DialogInterface.OnClickListener onConfirmListener) {
|
||||
return new AlertDialog.Builder(context)
|
||||
.setTitle(com.android.settingslib.R.string.user_setup_dialog_title)
|
||||
.setMessage(com.android.settingslib.R.string.user_setup_dialog_message)
|
||||
.setPositiveButton(com.android.settingslib.R.string.user_setup_button_setup_now,
|
||||
onConfirmListener)
|
||||
.setNegativeButton(com.android.settingslib.R.string.user_setup_button_setup_later,
|
||||
null)
|
||||
.create();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user