From 8825e5c21880be66a3f1938fd6e93ce43bf7a1b5 Mon Sep 17 00:00:00 2001 From: Suresh Kumar Sugguna Date: Thu, 28 Aug 2014 01:55:14 -0700 Subject: Deflect call test using answer call button 1. Provide hooks to deflect call through answer button in the UI for testing deflect call scenarios. 2. Use system property "persist.radio.deflect.number" to set the number to which call should be delfected. Change-Id: I1b3d039a587f6769939743a2fb307cdc6c650837 CRs-Fixed: 713856 --- src/com/android/incallui/AnswerPresenter.java | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/com/android/incallui/AnswerPresenter.java') diff --git a/src/com/android/incallui/AnswerPresenter.java b/src/com/android/incallui/AnswerPresenter.java index 619e75f3..a5db13ef 100644 --- a/src/com/android/incallui/AnswerPresenter.java +++ b/src/com/android/incallui/AnswerPresenter.java @@ -19,6 +19,7 @@ package com.android.incallui; import android.telecom.PhoneCapabilities; import android.app.KeyguardManager; import android.content.Context; +import android.os.SystemProperties; import java.util.List; @@ -181,6 +182,29 @@ public class AnswerPresenter extends Presenter return; } + /** + * To test call deflection this property has to be set with the + * number to which the call should be deflected. If this property is + * set to a number, on pressing the UI answer button, call deflect + * request will be sent. This is done to provide hooks to test call + * deflection through the UI answer button. For commercialization UI + * should be customized to call this API through the Call deflect UI + * button By default this property is not set and Answer button will + * work as expected. + * Example: + * To deflect call to number 12345 + * adb shell setprop persist.radio.deflect.number 12345 + * + * Toggle above property and to invoke answerCallWithCallType + * adb shell setprop persist.radio.deflect.number "" + */ + String deflectcall = SystemProperties.get("persist.radio.deflect.number"); + if (deflectcall != null && !deflectcall.isEmpty()) { + Log.i(this, "deflectCall " + mCallId + "to" + deflectcall); + TelecommAdapter.getInstance().deflectCall(mCall[phoneId].getId(), deflectcall); + return; + } + if (mCall[phoneId].getSessionModificationState() == Call.SessionModificationState.RECEIVED_UPGRADE_TO_VIDEO_REQUEST) { InCallPresenter.getInstance().acceptUpgradeRequest(context); -- cgit v1.2.3