Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f4bb9184 authored by kaiyiz's avatar kaiyiz
Browse files

Dialer: Fix NullPointerException and IllegalStateException

Add null judgement, and using commitAllowingStateLoss() instead of
commit() to avoid IllegalStateException.

CRs-Fixed: 775520

Change-Id: Ifcd86f68e4f1134c892226eef552986379df50e3
parent 14003ff1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1017,7 +1017,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
        fragment.setHasOptionsMenu(false);
        fragment.setShowEmptyListForNullQuery(true);
        fragment.setQueryString(query, false /* delaySelection */);
        transaction.commit();
        transaction.commitAllowingStateLoss();

        mListsFragment.getView().animate().alpha(0).withLayer();
    }
+2 −2
Original line number Diff line number Diff line
@@ -149,8 +149,8 @@ public class SearchFragment extends PhoneNumberPickerFragment {

        // Check if actual number had + sign as the first character and query string does not, then
        // return a number with a + sign prefixed to the query string. That will be the dial string.
        if ((actualNumber != null) && actualNumber.startsWith("+") &&
                !(getQueryString().startsWith("+"))) {
        if ((actualNumber != null) && actualNumber.startsWith("+") && (getQueryString() != null)
                && !(getQueryString().startsWith("+"))) {
            number.append('+');
        }
        number.append(getQueryString());