From 1dd46a5c676325d20b7a042d0d0d3c7d9365d0bd Mon Sep 17 00:00:00 2001 From: Yorke Lee Date: Mon, 10 Jun 2013 10:21:57 -0700 Subject: Fix crash in Dialer in landscape mode Bug 9369806 Change-Id: I286ebb828c0f6ce7c005c541661b9aa67284847e --- src/com/android/dialer/dialpad/DialpadFragment.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/com/android/dialer/dialpad/DialpadFragment.java b/src/com/android/dialer/dialpad/DialpadFragment.java index 3d75e3983..5f70312ff 100644 --- a/src/com/android/dialer/dialpad/DialpadFragment.java +++ b/src/com/android/dialer/dialpad/DialpadFragment.java @@ -368,7 +368,8 @@ public class DialpadFragment extends Fragment mDialpadChooser = (ListView) fragmentView.findViewById(R.id.dialpadChooser); mDialpadChooser.setOnItemClickListener(this); - // Smart dial + // Smart dial container. This is null if in landscape mode since it is not present + // in the landscape dialer layout. mSmartDialContainer = (RelativeLayout) fragmentView.findViewById( R.id.dialpad_smartdial_container); @@ -556,7 +557,7 @@ public class DialpadFragment extends Fragment // retrieve dialpad autocomplete setting mSmartDialEnabled = Settings.Secure.getInt(contentResolver, - Settings.Secure.DIALPAD_AUTOCOMPLETE, 0) == 1; + Settings.Secure.DIALPAD_AUTOCOMPLETE, 0) == 1 && mSmartDialContainer != null; stopWatch.lap("dtwd"); @@ -1731,7 +1732,9 @@ public class DialpadFragment extends Fragment mSmartDialCache.cacheIfNeeded(true); } } else { - mSmartDialContainer.setVisibility(View.GONE); + if (mSmartDialContainer != null) { + mSmartDialContainer.setVisibility(View.GONE); + } mSmartDialCache = null; } } -- cgit v1.2.3