diff options
5 files changed, 29 insertions, 13 deletions
diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java index aba00b036..bb20a1306 100644 --- a/src/com/android/dialer/calllog/CallLogAdapter.java +++ b/src/com/android/dialer/calllog/CallLogAdapter.java @@ -22,6 +22,7 @@ import android.content.Intent; import android.content.Loader; import android.content.res.Resources; import android.database.Cursor; +import android.database.sqlite.SQLiteFullException; import android.net.Uri; import android.os.Handler; import android.os.Message; @@ -31,6 +32,7 @@ import android.provider.ContactsContract.PhoneLookup; import android.telecom.PhoneAccountHandle; import android.telephony.PhoneNumberUtils; import android.text.TextUtils; +import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.View.AccessibilityDelegate; @@ -69,6 +71,7 @@ import java.util.LinkedList; */ public class CallLogAdapter extends GroupingListAdapter implements ViewTreeObserver.OnPreDrawListener, CallLogGroupBuilder.GroupCreator { + private static final String TAG = CallLogAdapter.class.getSimpleName(); private static final int VOICEMAIL_TRANSCRIPTION_MAX_LINES = 10; @@ -1183,14 +1186,18 @@ public class CallLogAdapter extends GroupingListAdapter if (!needsUpdate) return; - if (countryIso == null) { - mContext.getContentResolver().update(Calls.CONTENT_URI_WITH_VOICEMAIL, values, - Calls.NUMBER + " = ? AND " + Calls.COUNTRY_ISO + " IS NULL", - new String[]{ number }); - } else { - mContext.getContentResolver().update(Calls.CONTENT_URI_WITH_VOICEMAIL, values, - Calls.NUMBER + " = ? AND " + Calls.COUNTRY_ISO + " = ?", - new String[]{ number, countryIso }); + try { + if (countryIso == null) { + mContext.getContentResolver().update(Calls.CONTENT_URI_WITH_VOICEMAIL, values, + Calls.NUMBER + " = ? AND " + Calls.COUNTRY_ISO + " IS NULL", + new String[]{ number }); + } else { + mContext.getContentResolver().update(Calls.CONTENT_URI_WITH_VOICEMAIL, values, + Calls.NUMBER + " = ? AND " + Calls.COUNTRY_ISO + " = ?", + new String[]{ number, countryIso }); + } + } catch (SQLiteFullException e) { + Log.e(TAG, "Unable to update contact info in call log db", e); } } diff --git a/src/com/android/dialer/calllog/ClearCallLogDialog.java b/src/com/android/dialer/calllog/ClearCallLogDialog.java index e6b4ce29c..f4c75d10d 100644 --- a/src/com/android/dialer/calllog/ClearCallLogDialog.java +++ b/src/com/android/dialer/calllog/ClearCallLogDialog.java @@ -67,7 +67,13 @@ public class ClearCallLogDialog extends DialogFragment { } @Override protected void onPostExecute(Void result) { - progressDialog.dismiss(); + if (getActivity() == null || getActivity().isDestroyed()) { + return; + } + + if (progressDialog != null && progressDialog.isShowing()) { + progressDialog.dismiss(); + } } }; // TODO: Once we have the API, we should configure this ProgressDialog diff --git a/src/com/android/dialer/list/ShortcutCardsAdapter.java b/src/com/android/dialer/list/ShortcutCardsAdapter.java index 78647882c..6410eabf6 100644 --- a/src/com/android/dialer/list/ShortcutCardsAdapter.java +++ b/src/com/android/dialer/list/ShortcutCardsAdapter.java @@ -202,6 +202,7 @@ public class ShortcutCardsAdapter extends BaseAdapter { wrapper.removeAllViews(); wrapper.prepareChildView(view); wrapper.addView(view); + wrapper.setVisibility(View.VISIBLE); return wrapper; } diff --git a/src/com/android/dialer/list/SpeedDialFragment.java b/src/com/android/dialer/list/SpeedDialFragment.java index 2ca16b701..a42031677 100644 --- a/src/com/android/dialer/list/SpeedDialFragment.java +++ b/src/com/android/dialer/list/SpeedDialFragment.java @@ -235,14 +235,16 @@ public class SpeedDialFragment extends Fragment implements OnItemClickListener, /* package */ void setEmptyViewVisibility(final boolean visible) { final int previousVisibility = mEmptyView.getVisibility(); - final int newVisibility = visible ? View.VISIBLE : View.GONE; + final int emptyViewVisibility = visible ? View.VISIBLE : View.GONE; + final int listViewVisibility = visible ? View.GONE : View.VISIBLE; - if (previousVisibility != newVisibility) { + if (previousVisibility != emptyViewVisibility) { final RelativeLayout.LayoutParams params = (LayoutParams) mContactTileFrame .getLayoutParams(); params.height = visible ? LayoutParams.WRAP_CONTENT : LayoutParams.MATCH_PARENT; mContactTileFrame.setLayoutParams(params); - mEmptyView.setVisibility(newVisibility); + mEmptyView.setVisibility(emptyViewVisibility); + mListView.setVisibility(listViewVisibility); } } diff --git a/src/com/android/dialer/util/DialerUtils.java b/src/com/android/dialer/util/DialerUtils.java index 153f762e7..d59deb4ef 100644 --- a/src/com/android/dialer/util/DialerUtils.java +++ b/src/com/android/dialer/util/DialerUtils.java @@ -125,7 +125,7 @@ public class DialerUtils { (ImageView) emptyListView.findViewById(R.id.emptyListViewImage); emptyListViewImage.setImageDrawable(res.getDrawable(imageResId)); - emptyListViewImage.setContentDescription(res.getString(strResId)); + emptyListViewImage.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO); TextView emptyListViewMessage = (TextView) emptyListView.findViewById(R.id.emptyListViewMessage); |