aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorWink Saville <wink@google.com>2012-10-19 13:07:53 -0700
committerWink Saville <wink@google.com>2012-10-19 13:07:53 -0700
commit1de1d3c6da7aa16d1a1b4a3f85484803788d2f8b (patch)
tree86d74cf1b32cd5c5756be8760d07bf138f7edd7d /tools
parentb9f33f437348b38a1c0422cd844b267894661d9f (diff)
downloadandroid_frameworks_opt_telephony-1de1d3c6da7aa16d1a1b4a3f85484803788d2f8b.tar.gz
android_frameworks_opt_telephony-1de1d3c6da7aa16d1a1b4a3f85484803788d2f8b.tar.bz2
android_frameworks_opt_telephony-1de1d3c6da7aa16d1a1b4a3f85484803788d2f8b.zip
Fake errors in DataConnection.
Errors can be faked for all DC's or just a particular DC, use tools/tdi to issue the broadcast intent. Change-Id: I4ba661e765d32931421bb62bc5e740c9652370a5
Diffstat (limited to 'tools')
-rwxr-xr-xtools/tdi48
1 files changed, 48 insertions, 0 deletions
diff --git a/tools/tdi b/tools/tdi
new file mode 100755
index 000000000..940a83bcc
--- /dev/null
+++ b/tools/tdi
@@ -0,0 +1,48 @@
+#!/bin/bash
+# Telephony Debug Intents
+#set -x
+
+file_name='tdi'
+
+# Get the command as the first parameter
+cmd=$1
+shift
+
+function dc_errors()
+{
+ if [ "$1" == "" ]; then
+ echo "Usage: $file_name $cmd <dc> <count> <cause> <retry-time>"
+ echo " <dc> must specifiy the DataConnection such as DC or GsmDC-1"
+ echo " <count> := number of times to retry"
+ echo " <cause> := From DataConnection.FailCause; such as -3 for SIGNAL_LOST"
+ echo " <retry-time> := suggested retry time in milli-seconds"
+ exit
+ fi
+ the_DC=$1
+ echo "the_DC=$the_DC"
+
+ if [ "$2" != "" ]; then
+ counter="--ei counter $2";
+ fi
+ echo "counter=$counter"
+
+ if [ "$3" != "" ]; then
+ fail_cause="--ei fail_cause $3";
+ fi
+ echo "fail_cause=$fail_cause"
+
+ if [ "$4" != "" ]; then
+ suggested_retry_time="--ei suggested_retry_time $4";
+ fi
+ echo "suggested_retry_time=$suggested_retry_time"
+
+
+ adb shell am broadcast -a com.android.internal.telephony.$the_DC.action_fail_bringup $counter $fail_cause $suggested_retry_time
+}
+
+
+case ${cmd} in
+ dce) dc_errors "$@";;
+ # Add more commands in the future
+ *) echo 'Broadcast telephony debug intents'; echo 'usage: tdi [dce]'; echo ' dce=DC errors';;
+esac