From 5bbc60d489937af554e7b0ff56ff37b6fd06804b Mon Sep 17 00:00:00 2001 From: Pavan Kumar Tatavarthi Date: Wed, 5 Feb 2014 13:08:49 -0800 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. Define system property to set the number to which call should be delfected. 3. Define property to deflect call as "persist.radio.deflect.number" Change-Id: Iee3c845bdcd5e5a7bb488a05b89758fa0fa6a6ba CRs-Fixed: 609140 --- src/com/android/incallui/CallCommandClient.java | 26 +++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/com/android/incallui/CallCommandClient.java b/src/com/android/incallui/CallCommandClient.java index c6b1910d..92cf6d67 100644 --- a/src/com/android/incallui/CallCommandClient.java +++ b/src/com/android/incallui/CallCommandClient.java @@ -17,6 +17,7 @@ package com.android.incallui; import android.os.RemoteException; +import android.os.SystemProperties; import com.android.internal.telephony.MSimConstants; @@ -252,8 +253,29 @@ public class CallCommandClient { return; } try { - Log.v(this, "acceptCall() " ); - mCommandService.answerCallWithCallType(callId,callType); + /* + * 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()) { + mCommandService.deflectCall(callId, deflectcall); + } else { + Log.v(this, "acceptCall() "); + mCommandService.answerCallWithCallType(callId, callType); + } } catch (RemoteException e) { Log.e(this, "Error on acceptCall().", e); } -- cgit v1.2.3