Merge "Added support for writing Calls.FEATURES_WIFI and Calls.FEATURES_HD_CALL to the Call Log." am: 8ec18eb98c
am: 56e9e90762
Change-Id: Id0fdeb4aa8b79f4e6012746f7f065634f9ffb7bc
diff --git a/src/com/android/server/telecom/Call.java b/src/com/android/server/telecom/Call.java
index e5b9de9..b507758 100644
--- a/src/com/android/server/telecom/Call.java
+++ b/src/com/android/server/telecom/Call.java
@@ -439,6 +439,7 @@
private boolean mWasConferencePreviouslyMerged = false;
private boolean mWasHighDefAudio = false;
+ private boolean mWasWifi = false;
// For conferences which support merge/swap at their level, we retain a notion of an active
// call. This is used for BluetoothPhoneService. In order to support hold/merge, it must have
@@ -1598,6 +1599,7 @@
}
mWasHighDefAudio = (connectionProperties & Connection.PROPERTY_HIGH_DEF_AUDIO) ==
Connection.PROPERTY_HIGH_DEF_AUDIO;
+ mWasWifi = (connectionProperties & Connection.PROPERTY_WIFI) > 0;
for (Listener l : mListeners) {
l.onConnectionPropertiesChanged(this, didRttChange);
}
@@ -3232,6 +3234,15 @@
return mWasHighDefAudio;
}
+ /**
+ * Returns wether or not Wifi call was used.
+ *
+ * @return true if wifi call was used during this call.
+ */
+ boolean wasWifi() {
+ return mWasWifi;
+ }
+
public void setIsUsingCallFiltering(boolean isUsingCallFiltering) {
mIsUsingCallFiltering = isUsingCallFiltering;
}
diff --git a/src/com/android/server/telecom/CallLogManager.java b/src/com/android/server/telecom/CallLogManager.java
index 7e2b572..51df1d2 100755
--- a/src/com/android/server/telecom/CallLogManager.java
+++ b/src/com/android/server/telecom/CallLogManager.java
@@ -325,7 +325,7 @@
int callFeatures = getCallFeatures(call.getVideoStateHistory(),
call.getDisconnectCause().getCode() == DisconnectCause.CALL_PULLED,
- shouldSaveHdInfo(call, accountHandle),
+ call.wasHighDefAudio(), call.wasWifi(),
(call.getConnectionProperties() & Connection.PROPERTY_ASSISTED_DIALING_USED) ==
Connection.PROPERTY_ASSISTED_DIALING_USED,
call.wasEverRttCall());
@@ -448,11 +448,12 @@
* @param videoState The video state.
* @param isPulledCall {@code true} if this call was pulled to another device.
* @param isStoreHd {@code true} if this call was used HD.
+ * @param isWifi {@code true} if this call was used wifi.
* @param isUsingAssistedDialing {@code true} if this call used assisted dialing.
* @return The call features.
*/
private static int getCallFeatures(int videoState, boolean isPulledCall, boolean isStoreHd,
- boolean isUsingAssistedDialing, boolean isRtt) {
+ boolean isWifi, boolean isUsingAssistedDialing, boolean isRtt) {
int features = 0;
if (VideoProfile.isVideo(videoState)) {
features |= Calls.FEATURES_VIDEO;
@@ -463,6 +464,9 @@
if (isStoreHd) {
features |= Calls.FEATURES_HD_CALL;
}
+ if (isWifi) {
+ features |= Calls.FEATURES_WIFI;
+ }
if (isUsingAssistedDialing) {
features |= Calls.FEATURES_ASSISTED_DIALING_USED;
}
@@ -472,22 +476,6 @@
return features;
}
- private boolean shouldSaveHdInfo(Call call, PhoneAccountHandle accountHandle) {
- CarrierConfigManager configManager = (CarrierConfigManager) mContext.getSystemService(
- Context.CARRIER_CONFIG_SERVICE);
- PersistableBundle configBundle = null;
- if (configManager != null) {
- configBundle = configManager.getConfigForSubId(
- mPhoneAccountRegistrar.getSubscriptionIdForPhoneAccount(accountHandle));
- }
- if (configBundle != null && configBundle.getBoolean(
- CarrierConfigManager.KEY_IDENTIFY_HIGH_DEFINITION_CALLS_IN_CALL_LOG_BOOL)
- && call.wasHighDefAudio()) {
- return true;
- }
- return false;
- }
-
/**
* Retrieve the phone number from the call, and then process it before returning the
* actual number that is to be logged.