diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-03-03 00:36:39 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-03-03 00:36:39 +0000 |
commit | 8b1491d22c4dc8226e192a9997b5200ca517c1c1 (patch) | |
tree | 4008e50d81df0c20c2791f6d414775e65af62f13 | |
parent | ed022b519350fad09509252d52cce71b18ff4c0c (diff) | |
parent | d2e5d0be467cf8b200feeab73691e08d02f7da2e (diff) |
Merge "Move assisted dialing out of P."
5 files changed, 5 insertions, 47 deletions
diff --git a/java/com/android/dialer/assisteddialing/ConcreteCreator.java b/java/com/android/dialer/assisteddialing/ConcreteCreator.java index 2561e28cd..dfd28a661 100644 --- a/java/com/android/dialer/assisteddialing/ConcreteCreator.java +++ b/java/com/android/dialer/assisteddialing/ConcreteCreator.java @@ -23,7 +23,6 @@ import android.os.Build.VERSION_CODES; import android.preference.PreferenceManager; import android.support.annotation.NonNull; import android.support.annotation.VisibleForTesting; -import android.support.v4.os.BuildCompat; import android.support.v4.os.UserManagerCompat; import android.telephony.TelephonyManager; import com.android.dialer.common.LogUtil; @@ -42,8 +41,8 @@ public final class ConcreteCreator { // Floor set at N due to use of Optional. @VisibleForTesting public static final int BUILD_CODE_FLOOR = Build.VERSION_CODES.N; - // Ceiling set at O_MR1 because this feature will ship as part of the framework in P. - @VisibleForTesting public static final int BUILD_CODE_CEILING = Build.VERSION_CODES.O_MR1; + // Ceiling set at P because this feature will ship as part of the framework in Q. + @VisibleForTesting public static final int BUILD_CODE_CEILING = 28; /** * Creates a new AssistedDialingMediator @@ -107,8 +106,7 @@ public final class ConcreteCreator { } return (Build.VERSION.SDK_INT >= BUILD_CODE_FLOOR - && Build.VERSION.SDK_INT <= BUILD_CODE_CEILING - && !BuildCompat.isAtLeastP()) + && Build.VERSION.SDK_INT <= BUILD_CODE_CEILING) && configProvider.getBoolean("assisted_dialing_enabled", false); } diff --git a/java/com/android/dialer/calldetails/CallDetailsActivity.java b/java/com/android/dialer/calldetails/CallDetailsActivity.java index 26b38ed82..ec124df9e 100644 --- a/java/com/android/dialer/calldetails/CallDetailsActivity.java +++ b/java/com/android/dialer/calldetails/CallDetailsActivity.java @@ -32,7 +32,6 @@ 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,7 +51,6 @@ 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; @@ -409,14 +407,8 @@ public class CallDetailsActivity extends AppCompatActivity { @Override public void openAssistedDialingSettings(View unused) { - 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 669cba7a9..236f77972 100644 --- a/java/com/android/dialer/compat/telephony/TelephonyManagerCompat.java +++ b/java/com/android/dialer/compat/telephony/TelephonyManagerCompat.java @@ -65,9 +65,6 @@ public class TelephonyManagerCompat { public static final String ASSISTED_DIALING_EXTRAS = "android.telecom.extra.ASSISTED_DIALING_EXTRAS"; - public static final String EXTRA_ASSISTED_DIALING_TRANSFORMATION_INFO = - "android.telecom.extra.ASSISTED_DIALING_TRANSFORMATION_INFO"; - /** Indicates the Connection/Call used assisted dialing. */ public static final int PROPERTY_ASSISTED_DIALING_USED = 1 << 9; @@ -80,10 +77,6 @@ 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) diff --git a/java/com/android/dialer/precall/impl/AssistedDialAction.java b/java/com/android/dialer/precall/impl/AssistedDialAction.java index 15a889e74..9ed37ac8c 100644 --- a/java/com/android/dialer/precall/impl/AssistedDialAction.java +++ b/java/com/android/dialer/precall/impl/AssistedDialAction.java @@ -20,7 +20,6 @@ import android.annotation.TargetApi; import android.content.Context; import android.os.Build; import android.os.Bundle; -import android.support.v4.os.BuildCompat; import android.telecom.PhoneAccount; import android.telephony.SubscriptionInfo; import android.telephony.TelephonyManager; @@ -58,9 +57,7 @@ public class AssistedDialAction implements PreCallAction { AssistedDialingMediator assistedDialingMediator = ConcreteCreator.createNewAssistedDialingMediator( getAssistedDialingTelephonyManager(context, builder), context); - if (BuildCompat.isAtLeastP()) { - builder.getOutgoingCallExtras().putBoolean(TelephonyManagerCompat.USE_ASSISTED_DIALING, true); - } + // Checks the platform is N+ and meets other pre-flight checks. if (!assistedDialingMediator.isPlatformEligible()) { return; diff --git a/java/com/android/incallui/call/DialerCall.java b/java/com/android/incallui/call/DialerCall.java index 50bc691b7..d36b00d91 100644 --- a/java/com/android/incallui/call/DialerCall.java +++ b/java/com/android/incallui/call/DialerCall.java @@ -1136,7 +1136,7 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa */ public boolean isAssistedDialed() { if (getIntentExtras() != null) { - // O_MR1 and below uses the existence of USE_ASSISTED_DIALING to indicate assisted dialing + // P and below uses the existence of USE_ASSISTED_DIALING to indicate assisted dialing // was used. The Dialer client is responsible for performing assisted dialing before // placing the outgoing call. // @@ -1148,13 +1148,6 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa } } - // Starting in P+ USE_ASSISTED_DIALING indicates that the client requested the platform - // perform assisted dialing. PROPERTY_ASSISTED_DIALING_USED indicates assisted dialing took - // place. - if (hasProperty(TelephonyManagerCompat.PROPERTY_ASSISTED_DIALING_USED) - && BuildCompat.isAtLeastP()) { - return true; - } return false; } @@ -1164,21 +1157,6 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa return null; } - if (BuildCompat.isAtLeastP()) { - if (getExtras() == null) { - return null; - } - - if (getExtras() - .getParcelable(TelephonyManagerCompat.EXTRA_ASSISTED_DIALING_TRANSFORMATION_INFO) - == null) { - return null; - } - - // TODO(erfanian): Use the framework transformation info when we can link against it - return null; - } - if (getIntentExtras().getBundle(TelephonyManagerCompat.ASSISTED_DIALING_EXTRAS) == null) { return null; } |