mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-25 05:29:04 +00:00
Beginning of libtextsecure refactor.
1) Break out appropriate components. 2) Switch the incoming pipeline from SendReceiveService to the JobManager.
This commit is contained in:
@@ -31,7 +31,7 @@ import android.os.IBinder;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
import android.util.Log;
|
||||
|
||||
import org.whispersystems.textsecure.crypto.MasterSecret;
|
||||
import org.thoughtcrime.securesms.crypto.MasterSecret;
|
||||
import org.thoughtcrime.securesms.database.DatabaseFactory;
|
||||
import org.thoughtcrime.securesms.service.KeyCachingService;
|
||||
|
||||
@@ -144,23 +144,9 @@ public class PartProvider extends ContentProvider {
|
||||
IntentFilter filter = new IntentFilter(KeyCachingService.NEW_KEY_EVENT);
|
||||
getContext().registerReceiver(receiver, filter, KeyCachingService.KEY_PERMISSION, null);
|
||||
|
||||
Intent bindIntent = new Intent(getContext(), KeyCachingService.class);
|
||||
getContext().bindService(bindIntent, serviceConnection, Context.BIND_AUTO_CREATE);
|
||||
initializeWithMasterSecret(KeyCachingService.getMasterSecret(getContext()));
|
||||
}
|
||||
|
||||
private ServiceConnection serviceConnection = new ServiceConnection() {
|
||||
public void onServiceConnected(ComponentName className, IBinder service) {
|
||||
KeyCachingService keyCachingService = ((KeyCachingService.KeyCachingBinder)service).getService();
|
||||
MasterSecret masterSecret = keyCachingService.getMasterSecret();
|
||||
|
||||
initializeWithMasterSecret(masterSecret);
|
||||
|
||||
PartProvider.this.getContext().unbindService(this);
|
||||
}
|
||||
|
||||
public void onServiceDisconnected(ComponentName name) {}
|
||||
};
|
||||
|
||||
private class NewKeyReceiver extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
|
||||
Reference in New Issue
Block a user