Java crash - AID_SYSTEM_USER - SimListDialogFragment.updateDialog - java.lang.NullPointerException.

This error may be because onCreateDialog did not initialize mSubscriptions correctly, causing it to be null.
java.lang.RuntimeException: java.lang.NullPointerException at com.android.settings.sim.SimListDialogFragment.updateDialog.

Fix: 194175217
Test: Manual Test
Change-Id: I761fed847441c6061ea4690658f06b9c2021bcee
This commit is contained in:
Charlotte Lu
2023-08-17 14:43:25 +08:00
parent 12f8f5ac7a
commit 9540e60083

View File

@@ -56,7 +56,8 @@ public class SimListDialogFragment extends SimDialogFragment {
protected SelectSubscriptionAdapter mAdapter; protected SelectSubscriptionAdapter mAdapter;
@VisibleForTesting @VisibleForTesting
List<SubscriptionInfo> mSubscriptions; @NonNull
List<SubscriptionInfo> mSubscriptions = new ArrayList<>();
public static SimListDialogFragment newInstance(int dialogType, int titleResId, public static SimListDialogFragment newInstance(int dialogType, int titleResId,
boolean includeAskEveryTime, boolean isCancelItemShowed) { boolean includeAskEveryTime, boolean isCancelItemShowed) {
@@ -71,8 +72,6 @@ public class SimListDialogFragment extends SimDialogFragment {
@NonNull @NonNull
@Override @Override
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) { public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
mSubscriptions = new ArrayList<>();
final AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); final AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
View titleView = LayoutInflater.from(getContext()).inflate( View titleView = LayoutInflater.from(getContext()).inflate(
R.layout.sim_confirm_dialog_title_multiple_enabled_profiles_supported, null); R.layout.sim_confirm_dialog_title_multiple_enabled_profiles_supported, null);