summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaniel oeh <daniel.oeh@gmail.com>2014-06-15 21:22:36 +0200
committerdaniel oeh <daniel.oeh@gmail.com>2014-06-15 21:22:36 +0200
commit859eabb7a302d79948ca9da4ceb886908932482a (patch)
tree7e5f10705a94b63f630d58de687086105d71fba7
parenta2757866402f01c6683d0ba17cf19e3e7d158fbe (diff)
downloadAntennaPod-859eabb7a302d79948ca9da4ceb886908932482a.zip
Added support for itpc-protocol. closes #333
-rw-r--r--AndroidManifest.xml1
-rw-r--r--src/de/danoeh/antennapod/util/URLChecker.java3
-rw-r--r--src/instrumentationTest/de/test/antennapod/util/URLCheckerTest.java6
3 files changed, 10 insertions, 0 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index b06a9b5c7..71a5dc492 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -294,6 +294,7 @@
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
+ <data android:scheme="itpc"/>
<data android:scheme="pcast"/>
<data android:scheme="feed"/>
</intent-filter>
diff --git a/src/de/danoeh/antennapod/util/URLChecker.java b/src/de/danoeh/antennapod/util/URLChecker.java
index eb522ffa8..af0226ce0 100644
--- a/src/de/danoeh/antennapod/util/URLChecker.java
+++ b/src/de/danoeh/antennapod/util/URLChecker.java
@@ -33,6 +33,9 @@ public final class URLChecker {
} else if (url.startsWith("pcast://")) {
if (BuildConfig.DEBUG) Log.d(TAG, "Replacing pcast:// with http://");
url = url.replaceFirst("pcast://", "http://");
+ } else if (url.startsWith("itpc")) {
+ if (BuildConfig.DEBUG) Log.d(TAG, "Replacing itpc:// with http://");
+ url = url.replaceFirst("itpc://", "http://");
} else if (!(url.startsWith("http://") || url.startsWith("https://"))) {
if (BuildConfig.DEBUG) Log.d(TAG, "Adding http:// at the beginning of the URL");
builder.append("http://");
diff --git a/src/instrumentationTest/de/test/antennapod/util/URLCheckerTest.java b/src/instrumentationTest/de/test/antennapod/util/URLCheckerTest.java
index 64d45dc60..18e8bf007 100644
--- a/src/instrumentationTest/de/test/antennapod/util/URLCheckerTest.java
+++ b/src/instrumentationTest/de/test/antennapod/util/URLCheckerTest.java
@@ -37,4 +37,10 @@ public class URLCheckerTest extends AndroidTestCase {
final String out = URLChecker.prepareURL(in);
assertEquals("http://example.com", out);
}
+
+ public void testItcpProtocol() {
+ final String in = "itpc://example.com";
+ final String out = URLChecker.prepareURL(in);
+ assertEquals("http://example.com", out);
+ }
}