mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-30 13:35:18 +00:00
parent
fcbcffe9ba
commit
39b95ca4ed
@ -514,6 +514,13 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
|
<receiver android:name=".service.BootReceiver">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.BOOT_COMPLETED"/>
|
||||||
|
<action android:name="org.thoughtcrime.securesms.RESTART"/>
|
||||||
|
</intent-filter>
|
||||||
|
</receiver>
|
||||||
|
|
||||||
<receiver android:name=".service.DirectoryRefreshListener">
|
<receiver android:name=".service.DirectoryRefreshListener">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||||
|
15
src/org/thoughtcrime/securesms/service/BootReceiver.java
Normal file
15
src/org/thoughtcrime/securesms/service/BootReceiver.java
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
package org.thoughtcrime.securesms.service;
|
||||||
|
|
||||||
|
import android.content.BroadcastReceiver;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
|
||||||
|
public class BootReceiver extends BroadcastReceiver {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onReceive(Context context, Intent intent) {
|
||||||
|
Intent messageRetrievalService = new Intent(context, MessageRetrievalService.class);
|
||||||
|
context.startService(messageRetrievalService);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -87,6 +87,8 @@ public class MessageRetrievalService extends Service implements InjectableType,
|
|||||||
if (retrievalThread != null) {
|
if (retrievalThread != null) {
|
||||||
retrievalThread.stopThread();
|
retrievalThread.stopThread();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sendBroadcast(new Intent("org.thoughtcrime.securesms.RESTART"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -236,7 +238,7 @@ public class MessageRetrievalService extends Service implements InjectableType,
|
|||||||
Log.w(TAG, "Exiting...");
|
Log.w(TAG, "Exiting...");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void stopThread() {
|
private void stopThread() {
|
||||||
stopThread.set(true);
|
stopThread.set(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user