Snap for 4726689 from 47a82ba91ff281a8afe975f03eba2acb9b1bb74c to oreo-mr1-cts-release

Change-Id: I423f73b774117d3c90784aac33e2d7d06933af7f
diff --git a/src/com/android/services/telephony/TelephonyConnection.java b/src/com/android/services/telephony/TelephonyConnection.java
index d41a8f0..f63ac4c 100644
--- a/src/com/android/services/telephony/TelephonyConnection.java
+++ b/src/com/android/services/telephony/TelephonyConnection.java
@@ -501,6 +501,11 @@
     protected final boolean mIsOutgoing;
 
     /**
+     * Indicates whether this call is using assisted dialing.
+     */
+    private boolean mIsUsingAssistedDialing;
+
+    /**
      * Listeners to our TelephonyConnection specific callbacks
      */
     private final Set<TelephonyConnectionListener> mTelephonyListeners = Collections.newSetFromMap(
@@ -802,6 +807,8 @@
                 isExternalConnection());
         newProperties = changeBitmask(newProperties, PROPERTY_HAS_CDMA_VOICE_PRIVACY,
                 mIsCdmaVoicePrivacyEnabled);
+        newProperties = changeBitmask(newProperties, PROPERTY_ASSISTED_DIALING_USED,
+                mIsUsingAssistedDialing);
 
         if (getConnectionProperties() != newProperties) {
             setConnectionProperties(newProperties);
@@ -1642,6 +1649,15 @@
         return mWasImsConnection;
     }
 
+    boolean getIsUsingAssistedDialing() {
+        return mIsUsingAssistedDialing;
+    }
+
+    void setIsUsingAssistedDialing(Boolean isUsingAssistedDialing) {
+        mIsUsingAssistedDialing = isUsingAssistedDialing;
+        updateConnectionProperties();
+    }
+
     private static Uri getAddressFromNumber(String number) {
         // Address can be null for blocked calls.
         if (number == null) {
diff --git a/src/com/android/services/telephony/TelephonyConnectionService.java b/src/com/android/services/telephony/TelephonyConnectionService.java
index ac3e50a..464b836 100644
--- a/src/com/android/services/telephony/TelephonyConnectionService.java
+++ b/src/com/android/services/telephony/TelephonyConnectionService.java
@@ -440,7 +440,11 @@
                     isEmergencyNumber, handle, phone);
             // If there was a failure, the resulting connection will not be a TelephonyConnection,
             // so don't place the call!
-            if(resultConnection instanceof TelephonyConnection) {
+            if (resultConnection instanceof TelephonyConnection) {
+                if (request.getExtras() != null && request.getExtras().getBoolean(
+                        TelecomManager.EXTRA_USE_ASSISTED_DIALING, false)) {
+                    ((TelephonyConnection) resultConnection).setIsUsingAssistedDialing(true);
+                }
                 placeOutgoingConnection((TelephonyConnection) resultConnection, phone, request);
             }
             return resultConnection;