Wink Saville | ff4e317 | 2013-03-22 11:10:25 -0700 | [diff] [blame] | 1 | This package contains classes used to manage a DataConnection. |
| 2 | |
| 3 | A criticial aspect of this class is that most objects in this |
| 4 | package run on the same thread except DataConnectionTracker |
| 5 | This makes processing efficient as it minimizes context |
| 6 | switching and it eliminates issues with multi-threading. |
| 7 | |
| 8 | This can be done because all actions are either asynchronous |
| 9 | or are known to be non-blocking and fast. At this time only |
| 10 | DcTesterDeactivateAll takes specific advantage of this |
| 11 | single threading knowledge by using Dcc#mDcListAll so be |
| 12 | very careful when making changes that break this assumption. |
| 13 | |
| 14 | A related change was in DataConnectionAc I added code that |
| 15 | checks to see if the caller is on a different thread. If |
| 16 | it is then the AsyncChannel#sendMessageSynchronously is |
| 17 | used. If the caller is on the same thread then a getter |
| 18 | is used. This allows the DCAC to be used from any thread |
| 19 | and was required to fix a bug when Dcc called |
| 20 | PhoneBase#notifyDataConnection which calls DCT#getLinkProperties |
| 21 | and DCT#getLinkCapabilities which call Dcc all on the same |
| 22 | thread. Without this change there was a dead lock when |
| 23 | sendMessageSynchronously blocks. |
| 24 | |
| 25 | |
Jeff Sharkey | 60ced16 | 2013-03-25 14:22:39 -0700 | [diff] [blame] | 26 | == Testing == |
Wink Saville | ff4e317 | 2013-03-22 11:10:25 -0700 | [diff] [blame] | 27 | |
Wink Saville | 281fc7b | 2013-05-02 10:09:01 -0700 | [diff] [blame] | 28 | The following are Intents that can be sent for testing pruproses on |
| 29 | DEBUGGABLE builds (userdebug, eng) |
Wink Saville | ff4e317 | 2013-03-22 11:10:25 -0700 | [diff] [blame] | 30 | |
Wink Saville | 281fc7b | 2013-05-02 10:09:01 -0700 | [diff] [blame] | 31 | *) Causes bringUp and retry requests to fail for all DC's |
Wink Saville | ff4e317 | 2013-03-22 11:10:25 -0700 | [diff] [blame] | 32 | |
| 33 | adb shell am broadcast -a com.android.internal.telephony.dataconnection.action_fail_bringup --ei counter 2 --ei fail_cause -3 |
Wink Saville | ff4e317 | 2013-03-22 11:10:25 -0700 | [diff] [blame] | 34 | |
Wink Saville | 281fc7b | 2013-05-02 10:09:01 -0700 | [diff] [blame] | 35 | *) Causes all DC's to get torn down, simulating a temporary network outage: |
Wink Saville | ff4e317 | 2013-03-22 11:10:25 -0700 | [diff] [blame] | 36 | |
| 37 | adb shell am broadcast -a com.android.internal.telephony.dataconnection.action_deactivate_all |
| 38 | |
Wink Saville | 281fc7b | 2013-05-02 10:09:01 -0700 | [diff] [blame] | 39 | *) To simplify testing we also have detach and attach simulations below where {x} is gsm, cdma or sip |
Wink Saville | ff4e317 | 2013-03-22 11:10:25 -0700 | [diff] [blame] | 40 | |
| 41 | adb shell am broadcast -a com.android.internal.telephony.{x}.action_detached |
| 42 | adb shell am broadcast -a com.android.internal.telephony.{x}.action_attached |
| 43 | |
| 44 | |
Wink Saville | 281fc7b | 2013-05-02 10:09:01 -0700 | [diff] [blame] | 45 | == System properties for Testing == |
Wink Saville | ff4e317 | 2013-03-22 11:10:25 -0700 | [diff] [blame] | 46 | |
Jeff Sharkey | 60ced16 | 2013-03-25 14:22:39 -0700 | [diff] [blame] | 47 | On debuggable builds (userdebug, eng) you can change additional |
| 48 | settings through system properties. These properties can be set with |
| 49 | "setprop" for the current boot, or added to local.prop to persist |
| 50 | across boots. |
Wink Saville | ff4e317 | 2013-03-22 11:10:25 -0700 | [diff] [blame] | 51 | |
Jeff Sharkey | 60ced16 | 2013-03-25 14:22:39 -0700 | [diff] [blame] | 52 | device# setprop key value |
Wink Saville | ff4e317 | 2013-03-22 11:10:25 -0700 | [diff] [blame] | 53 | |
Jeff Sharkey | 60ced16 | 2013-03-25 14:22:39 -0700 | [diff] [blame] | 54 | device# echo "key=value" >> /data/local.prop |
| 55 | device# chmod 644 /data/local.prop |
| 56 | |
| 57 | |
| 58 | -- Retry configuration -- |
| 59 | |
| 60 | You can replace the connection retry configuration. For example, you |
| 61 | could change it to perform 4 retries at 5 second intervals: |
| 62 | |
| 63 | device# setprop test.data_retry_config "5000,5000,5000" |
| 64 | |
| 65 | |
| 66 | -- Roaming -- |
| 67 | |
| 68 | You can force the telephony stack to always assume that it's roaming |
| 69 | to verify higher-level framework functionality: |
| 70 | |
| 71 | device# setprop telephony.test.forceRoaming true |