From cce501cbde0ba0a53e1f458328bb96dff4dd6588 Mon Sep 17 00:00:00 2001 From: Yorke Lee Date: Fri, 8 Nov 2013 07:54:23 -0800 Subject: Fix bug where resuming CallDetailActivity loses the add contact intent getLoaderManager.initLoader() performs the onLoadFinish callback immediately if CallDetailActivity is being resumed from a previously paused state. This causes bindContactPhotoAction to be called with a null intent later on causing the add contact button to be no longer clickable. To fix this, if we know that we will receive a loader call back that correctly binds the intent later on (or immediately), we should skip the initial bind. Bug: 11588776 Change-Id: I9407a88ec8bbde303109eb14496e01cf6c347c8f --- src/com/android/dialer/CallDetailActivity.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/com/android') diff --git a/src/com/android/dialer/CallDetailActivity.java b/src/com/android/dialer/CallDetailActivity.java index 2b16a983b..a24940d73 100644 --- a/src/com/android/dialer/CallDetailActivity.java +++ b/src/com/android/dialer/CallDetailActivity.java @@ -489,6 +489,8 @@ public class CallDetailActivity extends Activity implements ProximitySensorAware nameOrNumber = firstDetails.number; } + boolean skipBind = false; + if (contactUri != null && !UriUtils.isEncodedContactUri(contactUri)) { mainActionIntent = new Intent(Intent.ACTION_VIEW, contactUri); // This will launch People's detail contact screen, so we probably want to @@ -505,6 +507,7 @@ public class CallDetailActivity extends Activity implements ProximitySensorAware mainActionIntent = null; mainActionIcon = R.drawable.ic_add_contact_holo_dark; mainActionDescription = getString(R.string.description_add_contact); + skipBind = true; } else if (isVoicemailNumber) { mainActionIntent = null; mainActionIcon = 0; @@ -536,7 +539,10 @@ public class CallDetailActivity extends Activity implements ProximitySensorAware mainActionDescription = null; } - bindContactPhotoAction(mainActionIntent, mainActionIcon, mainActionDescription); + if (!skipBind) { + bindContactPhotoAction(mainActionIntent, mainActionIcon, + mainActionDescription); + } // This action allows to call the number that places the call. if (canPlaceCallsTo) { -- cgit v1.2.3