diff options
author | Yorke Lee <yorkelee@google.com> | 2015-07-02 00:58:26 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-07-02 00:58:26 +0000 |
commit | ac330ca173b76e7167ee2dae9bb086c698ef00f4 (patch) | |
tree | 5a2b7eee2c55bbb4ca138aaaa32f53a40e18cbe0 | |
parent | 6ac8f65affabae0dcc20d1bab0097fbd9d987ae2 (diff) | |
parent | 9a8b98d1dbeaa348de9324271601e919b60858dc (diff) |
am 9a8b98d1: am 33cca17c: Merge "Fix dialer monkey NPEs" into mnc-dev
* commit '9a8b98d1dbeaa348de9324271601e919b60858dc':
Fix dialer monkey NPEs
-rw-r--r-- | src/com/android/dialer/DialtactsActivity.java | 6 | ||||
-rw-r--r-- | src/com/android/dialer/list/DialerPhoneNumberListAdapter.java | 11 | ||||
-rw-r--r-- | src/com/android/dialer/list/SearchFragment.java | 4 |
3 files changed, 15 insertions, 6 deletions
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java index ba1b8d163..546a64666 100644 --- a/src/com/android/dialer/DialtactsActivity.java +++ b/src/com/android/dialer/DialtactsActivity.java @@ -911,6 +911,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O @Override public void onNewIntent(Intent newIntent) { setIntent(newIntent); + mStateSaved = false; displayFragment(newIntent); @@ -1218,6 +1219,11 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O @Override public void onCallNumberDirectly(String phoneNumber, boolean isVideoCall) { + if (phoneNumber == null) { + // Invalid phone number, but let the call go through so that InCallUI can show + // an error message. + phoneNumber = ""; + } Intent intent = isVideoCall ? IntentUtil.getVideoCallIntent(phoneNumber, getCallOrigin()) : IntentUtil.getCallIntent(phoneNumber, getCallOrigin()); diff --git a/src/com/android/dialer/list/DialerPhoneNumberListAdapter.java b/src/com/android/dialer/list/DialerPhoneNumberListAdapter.java index 6c0ecf72b..401b0b641 100644 --- a/src/com/android/dialer/list/DialerPhoneNumberListAdapter.java +++ b/src/com/android/dialer/list/DialerPhoneNumberListAdapter.java @@ -44,11 +44,6 @@ public class DialerPhoneNumberListAdapter extends PhoneNumberListAdapter { super(context); mCountryIso = GeoUtil.getCurrentCountryIso(context); - - // Enable all shortcuts by default - for (int i = 0; i < mShortcutEnabled.length; i++) { - mShortcutEnabled[i] = true; - } } @Override @@ -67,6 +62,12 @@ public class DialerPhoneNumberListAdapter extends PhoneNumberListAdapter { return count; } + public void disableAllShortcuts() { + for (int i = 0; i < mShortcutEnabled.length; i++) { + mShortcutEnabled[i] = false; + } + } + @Override public int getItemViewType(int position) { final int shortcut = getShortcutTypeFromPosition(position); diff --git a/src/com/android/dialer/list/SearchFragment.java b/src/com/android/dialer/list/SearchFragment.java index 1f33d5b75..106545eaf 100644 --- a/src/com/android/dialer/list/SearchFragment.java +++ b/src/com/android/dialer/list/SearchFragment.java @@ -345,7 +345,9 @@ public class SearchFragment extends PhoneNumberPickerFragment { super.startLoading(); } else if (TextUtils.isEmpty(getQueryString())) { // Clear out any existing call shortcuts. - getAdapter().setQueryString(null); + final DialerPhoneNumberListAdapter adapter = + (DialerPhoneNumberListAdapter) getAdapter(); + adapter.disableAllShortcuts(); } } |