mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-25 02:55:23 +00:00
Sanity check for system service restarts.
This commit is contained in:
parent
2f6642a234
commit
8520cb558a
@ -34,6 +34,8 @@ public class ApplicationMigrationService extends Service
|
||||
|
||||
@Override
|
||||
public void onStart(Intent intent, int startId) {
|
||||
if (intent == null) return;
|
||||
|
||||
if (intent.getAction() != null && intent.getAction().equals(MIGRATE_DATABASE)) {
|
||||
handleDatabaseMigration((MasterSecret)intent.getParcelableExtra("master_secret"));
|
||||
}
|
||||
|
@ -75,6 +75,8 @@ public class KeyCachingService extends Service {
|
||||
|
||||
@Override
|
||||
public void onStart(Intent intent, int startId) {
|
||||
if (intent == null) return;
|
||||
|
||||
if (intent.getAction() != null && intent.getAction().equals(CLEAR_KEY_ACTION))
|
||||
handleClearKey();
|
||||
else if (intent.getAction() != null && intent.getAction().equals(ACTIVITY_START_EVENT))
|
||||
|
@ -16,14 +16,6 @@
|
||||
*/
|
||||
package org.thoughtcrime.securesms.service;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.thoughtcrime.securesms.crypto.MasterSecret;
|
||||
import org.thoughtcrime.securesms.database.CanonicalSessionMigrator;
|
||||
import org.thoughtcrime.securesms.util.WorkerThread;
|
||||
|
||||
import android.app.Service;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.ComponentName;
|
||||
@ -33,11 +25,18 @@ import android.content.IntentFilter;
|
||||
import android.content.ServiceConnection;
|
||||
import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import org.thoughtcrime.securesms.crypto.MasterSecret;
|
||||
import org.thoughtcrime.securesms.database.CanonicalSessionMigrator;
|
||||
import org.thoughtcrime.securesms.util.WorkerThread;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Services that handles sending/receiving of SMS/MMS.
|
||||
*
|
||||
@ -86,6 +85,8 @@ public class SendReceiveService extends Service {
|
||||
|
||||
@Override
|
||||
public void onStart(Intent intent, int startId) {
|
||||
if (intent == null) return;
|
||||
|
||||
if (intent.getAction().equals(SEND_SMS_ACTION))
|
||||
scheduleSecretRequiredIntent(SEND_SMS, intent);
|
||||
else if (intent.getAction().equals(RECEIVE_SMS_ACTION))
|
||||
|
Loading…
Reference in New Issue
Block a user