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