Beginning of libtextsecure refactor.

1) Break out appropriate components.

2) Switch the incoming pipeline from SendReceiveService to
   the JobManager.
This commit is contained in:
Moxie Marlinspike
2014-11-03 15:16:04 -08:00
parent 4cab657ebe
commit a3f1d9cdfd
152 changed files with 3521 additions and 3280 deletions

View File

@@ -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) {