|
|
@ -215,6 +215,16 @@ public class SendReceiveService extends Service {
|
|
|
|
CanonicalSessionMigrator.migrateSessions(this);
|
|
|
|
CanonicalSessionMigrator.migrateSessions(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private MasterSecret getPlaceholderSecret() {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
return MasterSecretUtil.getMasterSecret(SendReceiveService.this,
|
|
|
|
|
|
|
|
MasterSecretUtil.UNENCRYPTED_PASSPHRASE);
|
|
|
|
|
|
|
|
} catch (InvalidPassphraseException e) {
|
|
|
|
|
|
|
|
Log.w("SendReceiveService", e);
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void scheduleIntent(int what, Intent intent) {
|
|
|
|
private void scheduleIntent(int what, Intent intent) {
|
|
|
|
Runnable work = new SendReceiveWorkItem(intent, what);
|
|
|
|
Runnable work = new SendReceiveWorkItem(intent, what);
|
|
|
|
|
|
|
|
|
|
|
@ -228,6 +238,10 @@ public class SendReceiveService extends Service {
|
|
|
|
Runnable work = new SendReceiveWorkItem(intent, what);
|
|
|
|
Runnable work = new SendReceiveWorkItem(intent, what);
|
|
|
|
|
|
|
|
|
|
|
|
synchronized (workQueue) {
|
|
|
|
synchronized (workQueue) {
|
|
|
|
|
|
|
|
if (!hasSecret && TextSecurePreferences.isPasswordDisabled(SendReceiveService.this)) {
|
|
|
|
|
|
|
|
initializeWithMasterSecret(getPlaceholderSecret());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (hasSecret) {
|
|
|
|
if (hasSecret) {
|
|
|
|
workQueue.add(work);
|
|
|
|
workQueue.add(work);
|
|
|
|
workQueue.notifyAll();
|
|
|
|
workQueue.notifyAll();
|
|
|
@ -266,16 +280,6 @@ public class SendReceiveService extends Service {
|
|
|
|
case DOWNLOAD_AVATAR: avatarDownloader.process(masterSecret, intent); return;
|
|
|
|
case DOWNLOAD_AVATAR: avatarDownloader.process(masterSecret, intent); return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private MasterSecret getPlaceholderSecret() {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
return MasterSecretUtil.getMasterSecret(SendReceiveService.this,
|
|
|
|
|
|
|
|
MasterSecretUtil.UNENCRYPTED_PASSPHRASE);
|
|
|
|
|
|
|
|
} catch (InvalidPassphraseException e) {
|
|
|
|
|
|
|
|
Log.w("SendReceiveService", e);
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class ToastHandler extends Handler {
|
|
|
|
public class ToastHandler extends Handler {
|
|
|
|