[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [snowflake-mobile/master] Added broker endpoint in Global Application



commit e4ec977d104e1a31522b6bdc93b27d2a09736701
Author: Hashik Donthineni <HashikDonthineni@xxxxxxxxx>
Date:   Tue Jun 9 15:13:38 2020 +0530

    Added broker endpoint in Global Application
---
 .../main/java/org/torproject/snowflake/GlobalApplication.java | 11 +++++++++++
 .../java/org/torproject/snowflake/MyPersistentService.java    |  3 +--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/app/src/main/java/org/torproject/snowflake/GlobalApplication.java b/app/src/main/java/org/torproject/snowflake/GlobalApplication.java
new file mode 100644
index 0000000..288733d
--- /dev/null
+++ b/app/src/main/java/org/torproject/snowflake/GlobalApplication.java
@@ -0,0 +1,11 @@
+package org.torproject.snowflake;
+
+import android.app.Application;
+
+public class GlobalApplication extends Application {
+    private final static String BROKER_URL = "http://10.0.2.2:8080";; //10.0.2.2 is used to access computer's local host from Android Emulator.
+
+    public static String getBrokerUrl() {
+        return BROKER_URL;
+    }
+}
diff --git a/app/src/main/java/org/torproject/snowflake/MyPersistentService.java b/app/src/main/java/org/torproject/snowflake/MyPersistentService.java
index ecb39ee..ddb418f 100644
--- a/app/src/main/java/org/torproject/snowflake/MyPersistentService.java
+++ b/app/src/main/java/org/torproject/snowflake/MyPersistentService.java
@@ -195,7 +195,7 @@ public class MyPersistentService extends Service {
     private void startWebRTCConnection() {
         initializePeerConnectionFactory(); //Android Specific, you can Ignore.
         mainPeerConnection = createPeerConnection(factory); //Creating New Peer Connection.
-        //TODO: Fetch offer from broker
+        fetchOffer();
     }
 
     /**
@@ -312,7 +312,6 @@ public class MyPersistentService extends Service {
      */
     public void offerRequestFailure(Throwable t) {
         Log.d(TAG, "requestFailure: " + t.getMessage());
-        createPersistentNotification(true, "Failed getting offer. Retrying.");
         //TODO:Set a time out to resending offer.
         if (isServiceStarted)
             fetchOffer(); //Sending request for offer again.



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits