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,7 +109,8 @@ public class StreamingFederatedTimelineService extends IntentService {
|
|||
httpsURLConnection.setRequestProperty("Connection", "Keep-Alive");
|
||||
httpsURLConnection.setRequestProperty("Keep-Alive", "header");
|
||||
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.setConnectTimeout(70000);
|
||||
httpsURLConnection.setReadTimeout(70000);
|
||||
|
|
|
@ -108,7 +108,8 @@ public class StreamingLocalTimelineService extends IntentService {
|
|||
httpsURLConnection.setRequestProperty("Connection", "Keep-Alive");
|
||||
httpsURLConnection.setRequestProperty("Keep-Alive", "header");
|
||||
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.setConnectTimeout(70000);
|
||||
httpsURLConnection.setReadTimeout(70000);
|
||||
|
|
|
@ -106,7 +106,8 @@ public class StreamingService extends IntentService {
|
|||
httpsURLConnection.setRequestProperty("Connection", "Keep-Alive");
|
||||
httpsURLConnection.setRequestProperty("Keep-Alive", "header");
|
||||
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.setConnectTimeout(70000);
|
||||
httpsURLConnection.setReadTimeout(70000);
|
||||
|
|
Loading…
Reference in New Issue