summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2015-07-01 21:40:36 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-07-01 21:40:37 +0000
commit33cca17c91bb64147725d1d84eed92845fe572b7 (patch)
treece3968035941f213afa12e574d0f3cd24e1bf9c8
parentb3bd721b4bd7c6a88e258fe5eb01b88ded46c2f2 (diff)
parent24d034f92998a52868c10039e9c728f9ab5a44aa (diff)
Merge "Fix dialer monkey NPEs" into mnc-dev
-rw-r--r--src/com/android/dialer/DialtactsActivity.java6
-rw-r--r--src/com/android/dialer/list/DialerPhoneNumberListAdapter.java11
-rw-r--r--src/com/android/dialer/list/SearchFragment.java4
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();
}
}