summaryrefslogtreecommitdiffstats
path: root/src/com/android/dialer/calllog/TelecomCallLogCache.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/dialer/calllog/TelecomCallLogCache.java')
-rw-r--r--src/com/android/dialer/calllog/TelecomCallLogCache.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/com/android/dialer/calllog/TelecomCallLogCache.java b/src/com/android/dialer/calllog/TelecomCallLogCache.java
index ec1d24191..7071669e5 100644
--- a/src/com/android/dialer/calllog/TelecomCallLogCache.java
+++ b/src/com/android/dialer/calllog/TelecomCallLogCache.java
@@ -52,6 +52,7 @@ public class TelecomCallLogCache {
new HashMap<>();
private final Map<PhoneAccountHandle, String> mPhoneAccountLabelCache = new HashMap<>();
private final Map<PhoneAccountHandle, Integer> mPhoneAccountColorCache = new HashMap<>();
+ private final Map<PhoneAccountHandle, Boolean> mPhoneAccountCallWithNoteCache = new HashMap<>();
private boolean mHasCheckedForVideoEnabled;
private boolean mIsVideoEnabled;
@@ -64,6 +65,7 @@ public class TelecomCallLogCache {
mVoicemailQueryCache.clear();
mPhoneAccountLabelCache.clear();
mPhoneAccountColorCache.clear();
+ mPhoneAccountCallWithNoteCache.clear();
mHasCheckedForVideoEnabled = false;
mIsVideoEnabled = false;
@@ -121,4 +123,22 @@ public class TelecomCallLogCache {
}
return mIsVideoEnabled;
}
+
+ /**
+ * Determines if the PhoneAccount supports specifying a call subject (i.e. calling with a note)
+ * for outgoing calls.
+ *
+ * @param accountHandle The PhoneAccount handle.
+ * @return {@code true} if calling with a note is supported, {@code false} otherwise.
+ */
+ public boolean doesAccountSupportCallSubject(PhoneAccountHandle accountHandle) {
+ if (mPhoneAccountCallWithNoteCache.containsKey(accountHandle)) {
+ return mPhoneAccountCallWithNoteCache.get(accountHandle);
+ } else {
+ Boolean supportsCallWithNote =
+ PhoneAccountUtils.getAccountSupportsCallSubject(mContext, accountHandle);
+ mPhoneAccountCallWithNoteCache.put(accountHandle, supportsCallWithNote);
+ return supportsCallWithNote;
+ }
+ }
}