Merge "CredentialFragment anti-pocket dialing measures."

This commit is contained in:
TreeHugger Robot
2017-02-14 11:13:59 +00:00
committed by Android (Google) Code Review

View File

@@ -366,13 +366,22 @@ public abstract class ConfirmDeviceCredentialBaseFragment extends OptionsMenuFra
}
}
/**
* Dialog setup.
* <p>
* To make it less likely that the dialog is dismissed accidentally, for example if the
* device is malfunctioning or if the device is in a pocket, we set
* {@code setCanceledOnTouchOutside(false)}.
*/
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
return new AlertDialog.Builder(getActivity())
Dialog dialog = new AlertDialog.Builder(getActivity())
.setTitle(getArguments().getString(ARG_TITLE))
.setMessage(getArguments().getInt(ARG_MESSAGE))
.setPositiveButton(getArguments().getInt(ARG_BUTTON), null)
.create();
dialog.setCanceledOnTouchOutside(false);
return dialog;
}
@Override