Merge "Fix provider lookup when coming back from notification." into klp-dev
diff --git a/InCallUI/src/com/android/incallui/AnswerFragment.java b/InCallUI/src/com/android/incallui/AnswerFragment.java
index 40462ce..e105289 100644
--- a/InCallUI/src/com/android/incallui/AnswerFragment.java
+++ b/InCallUI/src/com/android/incallui/AnswerFragment.java
@@ -72,12 +72,6 @@
}
@Override
- public void onDestroyView() {
- super.onDestroyView();
- getPresenter().onUiUnready(this);
- }
-
- @Override
public void showAnswerUi(boolean show) {
getView().setVisibility(show ? View.VISIBLE : View.GONE);
}
diff --git a/InCallUI/src/com/android/incallui/BaseFragment.java b/InCallUI/src/com/android/incallui/BaseFragment.java
index a348ce4..ae207f3 100644
--- a/InCallUI/src/com/android/incallui/BaseFragment.java
+++ b/InCallUI/src/com/android/incallui/BaseFragment.java
@@ -18,12 +18,9 @@
import android.app.Fragment;
import android.os.Bundle;
-import android.view.View;
-
-import com.android.internal.util.Preconditions;
/**
- *
+ * Parent for all fragments that use Presenters and Ui design.
*/
public abstract class BaseFragment<T extends Presenter<U>, U extends Ui> extends Fragment {
@@ -51,4 +48,10 @@
super.onActivityCreated(savedInstanceState);
mPresenter.onUiReady(getUi());
}
+
+ @Override
+ public void onDestroyView() {
+ super.onDestroyView();
+ mPresenter.onUiUnready(getUi());
+ }
}
diff --git a/InCallUI/src/com/android/incallui/CallButtonFragment.java b/InCallUI/src/com/android/incallui/CallButtonFragment.java
index bd19381..1c3e737 100644
--- a/InCallUI/src/com/android/incallui/CallButtonFragment.java
+++ b/InCallUI/src/com/android/incallui/CallButtonFragment.java
@@ -127,12 +127,6 @@
}
@Override
- public void onDestroyView() {
- super.onDestroyView();
- getPresenter().onUiUnready(this);
- }
-
- @Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
}
diff --git a/InCallUI/src/com/android/incallui/CallCardFragment.java b/InCallUI/src/com/android/incallui/CallCardFragment.java
index d880b97..6009036 100644
--- a/InCallUI/src/com/android/incallui/CallCardFragment.java
+++ b/InCallUI/src/com/android/incallui/CallCardFragment.java
@@ -111,12 +111,6 @@
}
@Override
- public void onDestroyView() {
- super.onDestroyView();
- getPresenter().onUiUnready(this);
- }
-
- @Override
public void setVisible(boolean on) {
if (on) {
getView().setVisibility(View.VISIBLE);
diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java
index 59e846b..a0ad3ce 100644
--- a/InCallUI/src/com/android/incallui/CallCardPresenter.java
+++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java
@@ -74,6 +74,8 @@
// Call may be null if disconnect happened already.
if (call != null) {
+ mPrimary = call;
+
final CallIdentification identification = call.getIdentification();
// TODO(klp): Logic to determine which ui field get what data resides in
@@ -241,7 +243,7 @@
// 1) a lookup occurred but failed to find a local contact.
// 2) a lookup has not occurred.
// We need to track it so we can avoid an un-necessary lookup here.
- Log.d(TAG, "Local contact cache does not contain the contact. Searching provider.");
+ Log.d(TAG, "Contact lookup. In memory cache miss. Searching provider.");
cache.findInfo(identification, isIncoming, new ContactInfoCacheCallback() {
@Override
public void onContactInfoComplete(int callId, ContactCacheEntry entry) {
@@ -250,16 +252,16 @@
// Need to do massaging outside of contactinfocache.
if (entry.label == null) {
// Name not found. Try lookup.
- Log.d(TAG, "Local contact not found, performing reverse lookup.");
+ Log.d(TAG, "Contact lookup. Contact provider miss. Searching people api.");
lookupPhoneNumber(identification.getNumber());
} else {
- Log.d(TAG, "Found contact in provider: " + entry);
+ Log.d(TAG, "Contact lookup. Found in contact provider: " + entry);
updateContactEntry(entry, isPrimary, isConference);
}
}
});
} else {
- Log.d(TAG, "Found contact in cache: " + entry);
+ Log.d(TAG, "Contact lookup. Found in memory cache: " + entry);
updateContactEntry(entry, isPrimary, isConference);
}
}