Add dialog for enable auto data switch
When user activate multi-SIM and suitable to enable auto data switch, prompt the user when a dialog following choosing default data sub. UX: https://docs.google.com/presentation/d/1G6bcPoJUW-YcBzpQXAQLecY3nu69rLlCLQBfpAvVD7c/edit?resourcekey=0-qPkfUNLQ2Wfz2pq3V_6MZA#slide=id.g1c25e24318e_0_0 Test: manual verified the dialog buttons following simListDialog + specific dialog Bug: 260659244 Change-Id: Ib35f2d08093c2dd79036034bbfe0efaaa0be3162
This commit is contained in:
@@ -72,14 +72,31 @@ public class SelectSpecificDataSimDialogFragment extends SimDialogFragment imple
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int buttonClicked) {
|
||||
if (buttonClicked != DialogInterface.BUTTON_POSITIVE) {
|
||||
return;
|
||||
public void onDismiss(@NonNull DialogInterface dialog) {
|
||||
Log.d(TAG, "Dialog onDismiss, dismiss status: " + mWasDismissed);
|
||||
if (!mWasDismissed) {
|
||||
// This dialog might be called onDismiss twice due to first time called by onDismiss()
|
||||
// as a consequence of user action. We need this fragment alive so the activity
|
||||
// doesn't end, which allows the following dialog to attach. Upon the second dialog
|
||||
// dismiss, this fragment is removed from SimDialogActivity.onFragmentDismissed to
|
||||
// end the activity.
|
||||
mWasDismissed = true;
|
||||
final SimDialogActivity activity = (SimDialogActivity) getActivity();
|
||||
activity.showEnableAutoDataSwitchDialog();
|
||||
// Not using super.onDismiss because it will result in an immediate end of the activity,
|
||||
// before the second auto data switch dialog can attach.
|
||||
if (getDialog() != null) getDialog().dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int buttonClicked) {
|
||||
final SimDialogActivity activity = (SimDialogActivity) getActivity();
|
||||
final SubscriptionInfo info = getTargetSubscriptionInfo();
|
||||
if (info != null) {
|
||||
activity.onSubscriptionSelected(getDialogType(), info.getSubscriptionId());
|
||||
if (buttonClicked == DialogInterface.BUTTON_POSITIVE) {
|
||||
final SubscriptionInfo info = getTargetSubscriptionInfo();
|
||||
if (info != null) {
|
||||
activity.onSubscriptionSelected(getDialogType(), info.getSubscriptionId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user