summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerfanian <erfanian@google.com>2018-01-24 13:47:08 -0800
committerCopybara-Service <copybara-piper@google.com>2018-01-24 15:25:19 -0800
commit988044789fb70eca91c6a6e1f2526131f376b751 (patch)
tree1cf38b5dee2efd343542aa47766dedfaf4a9d3d1
parent571a2b4b21116b85b7ce3198ed9ff438a80b380c (diff)
Link to the correct Assisted Dialing settings depending on platform version.
Bug: 72162646 Test: unit tests PiperOrigin-RevId: 183134859 Change-Id: I73d3349f0ff33188cfe0a121b7737a57155683c7
-rw-r--r--java/com/android/dialer/calldetails/CallDetailsActivity.java12
-rw-r--r--java/com/android/dialer/compat/telephony/TelephonyManagerCompat.java4
2 files changed, 14 insertions, 2 deletions
diff --git a/java/com/android/dialer/calldetails/CallDetailsActivity.java b/java/com/android/dialer/calldetails/CallDetailsActivity.java
index b15dc456d..bf978ecf3 100644
--- a/java/com/android/dialer/calldetails/CallDetailsActivity.java
+++ b/java/com/android/dialer/calldetails/CallDetailsActivity.java
@@ -32,6 +32,7 @@ import android.provider.CallLog.Calls;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.RequiresPermission;
+import android.support.v4.os.BuildCompat;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
@@ -52,6 +53,7 @@ import com.android.dialer.common.concurrent.DialerExecutor.FailureListener;
import com.android.dialer.common.concurrent.DialerExecutor.SuccessListener;
import com.android.dialer.common.concurrent.DialerExecutor.Worker;
import com.android.dialer.common.concurrent.DialerExecutorComponent;
+import com.android.dialer.compat.telephony.TelephonyManagerCompat;
import com.android.dialer.constants.ActivityRequestCodes;
import com.android.dialer.dialercontact.DialerContact;
import com.android.dialer.duo.Duo;
@@ -407,8 +409,14 @@ public class CallDetailsActivity extends AppCompatActivity {
@Override
public void openAssistedDialingSettings(View unused) {
- Intent intent = new Intent(getActivity(), AssistedDialingSettingActivity.class);
- getActivity().startActivity(intent);
+ if (BuildCompat.isAtLeastP()) {
+ Intent callSettingsIntent =
+ new Intent(TelephonyManagerCompat.ACTION_SHOW_ASSISTED_DIALING_SETTINGS);
+ getActivity().startActivity(callSettingsIntent);
+ } else {
+ Intent intent = new Intent(getActivity(), AssistedDialingSettingActivity.class);
+ getActivity().startActivity(intent);
+ }
}
@Override
diff --git a/java/com/android/dialer/compat/telephony/TelephonyManagerCompat.java b/java/com/android/dialer/compat/telephony/TelephonyManagerCompat.java
index 86f344f4e..669cba7a9 100644
--- a/java/com/android/dialer/compat/telephony/TelephonyManagerCompat.java
+++ b/java/com/android/dialer/compat/telephony/TelephonyManagerCompat.java
@@ -80,6 +80,10 @@ public class TelephonyManagerCompat {
*/
public static final Integer FEATURES_ASSISTED_DIALING = 1 << 4;
+ /** The {@link android.content.Intent} action used to show the assisted dialing settings. */
+ public static final String ACTION_SHOW_ASSISTED_DIALING_SETTINGS =
+ "android.telecom.action.SHOW_ASSISTED_DIALING_SETTINGS";
+
/**
* Returns the number of phones available. Returns 1 for Single standby mode (Single SIM
* functionality) Returns 2 for Dual standby mode.(Dual SIM functionality)