diff options
author | maxwelb <maxwelb@google.com> | 2017-07-25 14:48:04 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-07-25 15:55:45 -0700 |
commit | 4442990e9e8f1220616a074df693668b5b82d331 (patch) | |
tree | 19b5a7556427c0829ed3d63fe6328661b7dec1ec /java/com/android/dialer/app | |
parent | 56026e3065b2450b9f1ffa6c5f75ef5c0f67e3c1 (diff) |
Refresh capabilities when temporarily unavailable
See go/ec-temp-unavailable. This CL fixes the issues when we get
enriched call capabilities for users who are temporarily unavailable.
Bugle sends an indication that this is the case through the
ACTION_CALL_CAPABILITIES_UPDATE intent, which is saved as part of the
capabilities. When users click on a call log row, we check if the
capabilities were temporarily unavailable and if that's the case, we
request the capabilities again. This ensures that we don't cache the
temporarily unavailable capabilities forever.
manual
Bug: 62609419,37726219
Test: EnrichedCallManagerImplTest, EnrichedCallBroadcastReceiverTest,
PiperOrigin-RevId: 163126355
Change-Id: I45be6f883d9c6596d20382250c220a90fbf5e996
Diffstat (limited to 'java/com/android/dialer/app')
-rw-r--r-- | java/com/android/dialer/app/calllog/CallLogAdapter.java | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/java/com/android/dialer/app/calllog/CallLogAdapter.java b/java/com/android/dialer/app/calllog/CallLogAdapter.java index 0e8112caa..bd7cf7715 100644 --- a/java/com/android/dialer/app/calllog/CallLogAdapter.java +++ b/java/com/android/dialer/app/calllog/CallLogAdapter.java @@ -346,8 +346,25 @@ public class CallLogAdapter extends GroupingListAdapter // as a last attempt at getting them before showing the expanded view to the user EnrichedCallCapabilities capabilities = getEnrichedCallManager().getCapabilities(viewHolder.number); - viewHolder.isCallComposerCapable = - capabilities != null && capabilities.isCallComposerCapable(); + + if (capabilities == null) { + capabilities = EnrichedCallCapabilities.NO_CAPABILITIES; + } + + viewHolder.isCallComposerCapable = capabilities.isCallComposerCapable(); + + if (capabilities.isTemporarilyUnavailable()) { + LogUtil.i( + "mExpandCollapseListener.onClick", + "%s is temporarily unavailable, requesting capabilities", + LogUtil.sanitizePhoneNumber(viewHolder.number)); + // Refresh the capabilities when temporarily unavailable, see go/ec-temp-unavailable. + // Similarly to when we request capabilities the first time, the 'Share and call' button + // won't pop in with the new capabilities. Instead the row needs to be collapsed and + // expanded again. + getEnrichedCallManager().requestCapabilities(viewHolder.number); + } + generateAndMapNewCallDetailsEntriesHistoryResults( viewHolder.number, viewHolder.getDetailedPhoneDetails(), |