summaryrefslogtreecommitdiffstats
path: root/telephony
diff options
context:
space:
mode:
authorWink Saville <wink@google.com>2010-03-05 13:23:06 -0800
committerWink Saville <wink@google.com>2010-03-05 13:23:06 -0800
commit01b6d244174b4fe5434593fc89189ba94bc76e7d (patch)
tree2fcc986b296a51acc1394e4897395088394ebec7 /telephony
parent6d141b0a9beb71e59ba850b7be13c4f0344ddc77 (diff)
downloadframeworks_base-01b6d244174b4fe5434593fc89189ba94bc76e7d.zip
frameworks_base-01b6d244174b4fe5434593fc89189ba94bc76e7d.tar.gz
frameworks_base-01b6d244174b4fe5434593fc89189ba94bc76e7d.tar.bz2
Allow the configuration string to have quotes.
This makes properties easier to read so from: ro.cdma.data_retry_config=default_randomization=2000,0,0,120000,180000 to this: ro.cdma.data_retry_config="default_randomization=2000,0,0,120000,180000" Change-Id: Ied2a7be0102512cd2ce528d566c19ed3a8e2f480
Diffstat (limited to 'telephony')
-rw-r--r--telephony/java/com/android/internal/telephony/RetryManager.java8
-rw-r--r--telephony/tests/telephonytests/src/com/android/internal/telephony/TelephonyUtilsTest.java6
2 files changed, 9 insertions, 5 deletions
diff --git a/telephony/java/com/android/internal/telephony/RetryManager.java b/telephony/java/com/android/internal/telephony/RetryManager.java
index 385b191..779f358 100644
--- a/telephony/java/com/android/internal/telephony/RetryManager.java
+++ b/telephony/java/com/android/internal/telephony/RetryManager.java
@@ -153,13 +153,17 @@ public class RetryManager {
}
/**
- * Configure for using string which allow arbitary
+ * Configure for using string which allow arbitrary
* sequences of times. See class comments for the
* string format.
*
- * @return true if successfull
+ * @return true if successful
*/
public boolean configure(String configStr) {
+ // Strip quotes if present.
+ if ((configStr.startsWith("\"") && configStr.endsWith("\""))) {
+ configStr = configStr.substring(1, configStr.length()-1);
+ }
if (DBG) log("configure: '" + configStr + "'");
if (!TextUtils.isEmpty(configStr)) {
diff --git a/telephony/tests/telephonytests/src/com/android/internal/telephony/TelephonyUtilsTest.java b/telephony/tests/telephonytests/src/com/android/internal/telephony/TelephonyUtilsTest.java
index bf0c88b..3757017 100644
--- a/telephony/tests/telephonytests/src/com/android/internal/telephony/TelephonyUtilsTest.java
+++ b/telephony/tests/telephonytests/src/com/android/internal/telephony/TelephonyUtilsTest.java
@@ -146,15 +146,15 @@ public class TelephonyUtilsTest extends TestCase {
}
/**
- * Test string configuration using all options.
+ * Test string configuration using all options and with quotes.
*/
@SmallTest
public void testRetryManageString() throws Exception {
RetryManager rm = new RetryManager();
int time;
- assertTrue(rm.configure("max_retries=4,"
- + "default_randomization=100,1000, 2000 :200 , 3000"));
+ assertTrue(rm.configure(
+ "\"max_retries=4, default_randomization=100,1000, 2000 :200 , 3000\""));
assertTrue(rm.isRetryNeeded());
time = rm.getRetryTimer();
assertTrue((time >= 1000) && (time < 1100));