Handle voice GCM intents in AsyncTask.
// FREEBIE
This commit is contained in:
parent
c041495834
commit
ccbe856ffb
1 changed files with 28 additions and 20 deletions
|
@ -2,6 +2,7 @@ package org.thoughtcrime.securesms.gcm;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.os.AsyncTask;
|
||||||
import android.support.v4.content.WakefulBroadcastReceiver;
|
import android.support.v4.content.WakefulBroadcastReceiver;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
@ -62,7 +63,10 @@ public class GcmBroadcastReceiver extends WakefulBroadcastReceiver {
|
||||||
.add(new PushNotificationReceiveJob(context));
|
.add(new PushNotificationReceiveJob(context));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleReceivedCall(Context context, String data) {
|
private void handleReceivedCall(final Context context, final String data) {
|
||||||
|
new AsyncTask<Void, Void, Void>() {
|
||||||
|
@Override
|
||||||
|
protected Void doInBackground(Void... params) {
|
||||||
try {
|
try {
|
||||||
String signalingKey = TextSecurePreferences.getSignalingKey(context);
|
String signalingKey = TextSecurePreferences.getSignalingKey(context);
|
||||||
EncryptedSignalMessage encryptedSignalMessage = new EncryptedSignalMessage(data, signalingKey);
|
EncryptedSignalMessage encryptedSignalMessage = new EncryptedSignalMessage(data, signalingKey);
|
||||||
|
@ -84,5 +88,9 @@ public class GcmBroadcastReceiver extends WakefulBroadcastReceiver {
|
||||||
} catch (InvalidEncryptedSignalException | IOException e) {
|
} catch (InvalidEncryptedSignalException | IOException e) {
|
||||||
Log.w(TAG, e);
|
Log.w(TAG, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}.execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue