Catch crash in mobile network ProgressDialog
When enabling "Automatically select network" in "Settings -> Network & internet -> Mobile network -> Advanced" and rotating the device while the dialog is showing there will be an IllegalArgumentException since the decorView isn't attached to the window when dismissing the dialog. Fixed by simply catching the exception since the dialog will be gone anyway. Bug: 146057372 Test: manual (see comment above) Change-Id: I15f1d6f505fdf33964ce973ece31d6aa0d8f3909
This commit is contained in:
committed by
Ed Savage-Jones
parent
e4ad103957
commit
9f74807e89
@@ -176,7 +176,11 @@ public class AutoSelectPreferenceController extends TelephonyTogglePreferenceCon
|
|||||||
|
|
||||||
private void dismissProgressBar() {
|
private void dismissProgressBar() {
|
||||||
if (mProgressDialog != null && mProgressDialog.isShowing()) {
|
if (mProgressDialog != null && mProgressDialog.isShowing()) {
|
||||||
mProgressDialog.dismiss();
|
try {
|
||||||
|
mProgressDialog.dismiss();
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
// Ignore exception since the dialog will be gone anyway.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user