Fixes an issue with services
This commit is contained in:
parent
3f71a78c2e
commit
4dc40d3ee4
|
@ -50,7 +50,7 @@
|
||||||
<receiver android:name=".services.RestartLiveNotificationReceiver"
|
<receiver android:name=".services.RestartLiveNotificationReceiver"
|
||||||
android:exported="false">
|
android:exported="false">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="RestartStreamingService" />
|
<action android:name="RestartLiveNotificationService" />
|
||||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
|
@ -208,7 +208,7 @@ public class LiveNotificationService extends Service {
|
||||||
if( !restartCalled ) {
|
if( !restartCalled ) {
|
||||||
restartCalled = true;
|
restartCalled = true;
|
||||||
SystemClock.sleep(60000);
|
SystemClock.sleep(60000);
|
||||||
sendBroadcast(new Intent("RestartStreamingService"));
|
sendBroadcast(new Intent("RestartLiveNotificationService"));
|
||||||
stopSelf();
|
stopSelf();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -230,8 +230,8 @@ public class LiveNotificationService extends Service {
|
||||||
httpsURLConnection.disconnect();
|
httpsURLConnection.disconnect();
|
||||||
if( !restartCalled ) {
|
if( !restartCalled ) {
|
||||||
restartCalled = true;
|
restartCalled = true;
|
||||||
SystemClock.sleep(10000);
|
SystemClock.sleep(5000);
|
||||||
sendBroadcast(new Intent("RestartStreamingService"));
|
sendBroadcast(new Intent("RestartLiveNotificationService"));
|
||||||
stopSelf();
|
stopSelf();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,7 +109,8 @@ public class StreamingFederatedTimelineService extends IntentService {
|
||||||
httpsURLConnection.setRequestProperty("Connection", "Keep-Alive");
|
httpsURLConnection.setRequestProperty("Connection", "Keep-Alive");
|
||||||
httpsURLConnection.setRequestProperty("Keep-Alive", "header");
|
httpsURLConnection.setRequestProperty("Keep-Alive", "header");
|
||||||
httpsURLConnection.setRequestProperty("Connection", "close");
|
httpsURLConnection.setRequestProperty("Connection", "close");
|
||||||
httpsURLConnection.setSSLSocketFactory(new TLSSocketFactory());
|
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.LOLLIPOP)
|
||||||
|
httpsURLConnection.setSSLSocketFactory(new TLSSocketFactory());
|
||||||
httpsURLConnection.setRequestMethod("GET");
|
httpsURLConnection.setRequestMethod("GET");
|
||||||
httpsURLConnection.setConnectTimeout(70000);
|
httpsURLConnection.setConnectTimeout(70000);
|
||||||
httpsURLConnection.setReadTimeout(70000);
|
httpsURLConnection.setReadTimeout(70000);
|
||||||
|
|
|
@ -108,7 +108,8 @@ public class StreamingLocalTimelineService extends IntentService {
|
||||||
httpsURLConnection.setRequestProperty("Connection", "Keep-Alive");
|
httpsURLConnection.setRequestProperty("Connection", "Keep-Alive");
|
||||||
httpsURLConnection.setRequestProperty("Keep-Alive", "header");
|
httpsURLConnection.setRequestProperty("Keep-Alive", "header");
|
||||||
httpsURLConnection.setRequestProperty("Connection", "close");
|
httpsURLConnection.setRequestProperty("Connection", "close");
|
||||||
httpsURLConnection.setSSLSocketFactory(new TLSSocketFactory());
|
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.LOLLIPOP)
|
||||||
|
httpsURLConnection.setSSLSocketFactory(new TLSSocketFactory());
|
||||||
httpsURLConnection.setRequestMethod("GET");
|
httpsURLConnection.setRequestMethod("GET");
|
||||||
httpsURLConnection.setConnectTimeout(70000);
|
httpsURLConnection.setConnectTimeout(70000);
|
||||||
httpsURLConnection.setReadTimeout(70000);
|
httpsURLConnection.setReadTimeout(70000);
|
||||||
|
|
|
@ -106,7 +106,8 @@ public class StreamingService extends IntentService {
|
||||||
httpsURLConnection.setRequestProperty("Connection", "Keep-Alive");
|
httpsURLConnection.setRequestProperty("Connection", "Keep-Alive");
|
||||||
httpsURLConnection.setRequestProperty("Keep-Alive", "header");
|
httpsURLConnection.setRequestProperty("Keep-Alive", "header");
|
||||||
httpsURLConnection.setRequestProperty("Connection", "close");
|
httpsURLConnection.setRequestProperty("Connection", "close");
|
||||||
httpsURLConnection.setSSLSocketFactory(new TLSSocketFactory());
|
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.LOLLIPOP)
|
||||||
|
httpsURLConnection.setSSLSocketFactory(new TLSSocketFactory());
|
||||||
httpsURLConnection.setRequestMethod("GET");
|
httpsURLConnection.setRequestMethod("GET");
|
||||||
httpsURLConnection.setConnectTimeout(70000);
|
httpsURLConnection.setConnectTimeout(70000);
|
||||||
httpsURLConnection.setReadTimeout(70000);
|
httpsURLConnection.setReadTimeout(70000);
|
||||||
|
|
Loading…
Reference in New Issue