Fix the settings crash when SimDialogActivity is null am: d786b64ff6
am: a800c05ac7
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2063565 Change-Id: Id6de8ec6e269fc6720c57ee04bd2e26d90293ec6 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -84,10 +84,11 @@ public class PreferredSimDialogFragment extends SimDialogFragment implements
|
|||||||
private void updateDialog(AlertDialog dialog) {
|
private void updateDialog(AlertDialog dialog) {
|
||||||
Log.d(TAG, "Dialog updated, dismiss status: " + mWasDismissed);
|
Log.d(TAG, "Dialog updated, dismiss status: " + mWasDismissed);
|
||||||
|
|
||||||
final SubscriptionInfo info = getPreferredSubscription();
|
|
||||||
if (mWasDismissed) {
|
if (mWasDismissed) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final SubscriptionInfo info = getPreferredSubscription();
|
||||||
if (info == null) {
|
if (info == null) {
|
||||||
dismiss();
|
dismiss();
|
||||||
return;
|
return;
|
||||||
|
@@ -83,6 +83,12 @@ public abstract class SimDialogFragment extends InstrumentedDialogFragment imple
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void dismiss() {
|
||||||
|
mChangeListener.stop();
|
||||||
|
super.dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
public abstract void updateDialog();
|
public abstract void updateDialog();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -128,12 +128,13 @@ public class SimListDialogFragment extends SimDialogFragment {
|
|||||||
@Override
|
@Override
|
||||||
public void updateDialog() {
|
public void updateDialog() {
|
||||||
Log.d(TAG, "Dialog updated, dismiss status: " + mWasDismissed);
|
Log.d(TAG, "Dialog updated, dismiss status: " + mWasDismissed);
|
||||||
|
if (mWasDismissed) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
List<SubscriptionInfo> currentSubscriptions = getCurrentSubscriptions();
|
List<SubscriptionInfo> currentSubscriptions = getCurrentSubscriptions();
|
||||||
if (currentSubscriptions == null) {
|
if (currentSubscriptions == null) {
|
||||||
if (!mWasDismissed) {
|
|
||||||
dismiss();
|
dismiss();
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
boolean includeAskEveryTime = getArguments().getBoolean(KEY_INCLUDE_ASK_EVERY_TIME);
|
boolean includeAskEveryTime = getArguments().getBoolean(KEY_INCLUDE_ASK_EVERY_TIME);
|
||||||
|
Reference in New Issue
Block a user