Compare commits

..

13 Commits

Author SHA1 Message Date
Cody Henthorne
c3e9f98273 Bump version to 6.22.8 2023-06-09 15:00:23 -04:00
Cody Henthorne
9a3faae731 Update SQLCipher to 4.5.4-S2 2023-06-09 14:59:33 -04:00
Cody Henthorne
82e8cb87c1 Fix bug when processing duplicate text messages within the same batch. 2023-06-09 14:30:06 -04:00
Cody Henthorne
9bdcc9e3d8 Bump version to 6.22.7 2023-06-08 12:07:14 -04:00
Cody Henthorne
daee747338 Bump version to 6.22.6
Previous bump only incremented the version code.
2023-06-08 11:47:14 -04:00
Cody Henthorne
535a163f00 Bump version to 6.22.6 2023-06-08 10:58:12 -04:00
Clark
bd61b91722 Drop failed processed incoming messages. 2023-06-08 10:48:01 -04:00
Alex Hart
a0c1b072b6 Bump version to 6.22.5 2023-06-01 17:16:39 -03:00
Alex Hart
fe806cc4eb Updated baseline profile. 2023-06-01 16:52:55 -03:00
Nicholas Tinsley
aacad78cdb Delete redundant Bluetooth voice note codepath.
Added some additional logging, as well.
2023-06-01 16:40:33 -03:00
Cody Henthorne
b89f2dd862 Fix message notifier plural. 2023-06-01 16:40:33 -03:00
Alex Hart
36d01477cc Fix incoming call notifications. 2023-06-01 16:40:33 -03:00
Nicholas
e4090d00c9 Increase logging around image compression failures. 2023-05-31 16:59:54 -04:00
12 changed files with 1123 additions and 938 deletions

View File

@@ -46,15 +46,15 @@ ktlint {
version = "0.47.1"
}
def canonicalVersionCode = 1271
def canonicalVersionName = "6.22.4"
def canonicalVersionCode = 1272
def canonicalVersionName = "6.22.8"
def postFixSize = 100
def abiPostFix = ['universal' : 0,
'armeabi-v7a' : 1,
'arm64-v8a' : 2,
'x86' : 3,
'x86_64' : 4]
def abiPostFix = ['universal' : 15,
'armeabi-v7a' : 16,
'arm64-v8a' : 17,
'x86' : 18,
'x86_64' : 19]
def keystores = [ 'debug' : loadKeystoreProperties('keystore.debug.properties') ]

File diff suppressed because it is too large Load Diff

View File

@@ -81,46 +81,31 @@ private class BluetoothVoiceNoteUtilLegacy(val context: Context, val listener: (
private var hasWarnedAboutBluetooth = false
init {
if (Build.VERSION.SDK_INT < 31) {
audioHandler.post {
signalBluetoothManager.start()
Log.d(TAG, "Bluetooth manager started.")
}
audioHandler.post {
signalBluetoothManager.start()
Log.d(TAG, "Bluetooth manager started.")
}
}
override fun connectBluetoothScoConnection() {
if (Build.VERSION.SDK_INT >= 31) {
val audioManager = ApplicationDependencies.getAndroidCallAudioManager()
val device: AudioDeviceInfo? = audioManager.connectedBluetoothDevice
if (device != null) {
val result: Boolean = audioManager.setCommunicationDevice(device)
if (result) {
Log.d(TAG, "Successfully set Bluetooth device as active communication device.")
} else {
Log.d(TAG, "Found Bluetooth device but failed to set it as active communication device.")
}
} else {
Log.d(TAG, "Could not find Bluetooth device in list of communications devices, falling back to current input.")
audioHandler.post {
if (signalBluetoothManager.state.shouldUpdate()) {
Log.d(TAG, "Bluetooth manager updating devices.")
signalBluetoothManager.updateDevice()
}
listener()
} else {
audioHandler.post {
if (signalBluetoothManager.state.shouldUpdate()) {
signalBluetoothManager.updateDevice()
}
val currentState = signalBluetoothManager.state
if (currentState == SignalBluetoothManager.State.AVAILABLE) {
signalBluetoothManager.startScoAudio()
} else {
Log.d(TAG, "Recording from phone mic because bluetooth state was " + currentState + ", not " + SignalBluetoothManager.State.AVAILABLE)
uiThreadHandler.post {
if (currentState == SignalBluetoothManager.State.PERMISSION_DENIED && !hasWarnedAboutBluetooth) {
bluetoothPermissionDeniedHandler()
hasWarnedAboutBluetooth = true
}
listener()
val currentState = signalBluetoothManager.state
if (currentState == SignalBluetoothManager.State.AVAILABLE) {
Log.d(TAG, "Bluetooth manager state is AVAILABLE. Starting SCO connection.")
signalBluetoothManager.startScoAudio()
} else {
Log.d(TAG, "Recording from phone mic because bluetooth state was " + currentState + ", not " + SignalBluetoothManager.State.AVAILABLE)
uiThreadHandler.post {
if (currentState == SignalBluetoothManager.State.PERMISSION_DENIED && !hasWarnedAboutBluetooth) {
Log.d(TAG, "Warning about Bluetooth permissions.")
bluetoothPermissionDeniedHandler()
hasWarnedAboutBluetooth = true
}
listener()
}
}
}

View File

@@ -1075,25 +1075,26 @@ open class MessageTable(context: Context?, databaseHelper: SignalDatabase) : Dat
values.putNull(ORIGINAL_MESSAGE_ID)
}
writableDatabase.beginTransaction()
val messageId: Long
try {
messageId = writableDatabase.insert(TABLE_NAME, null, values)
if (messageId < 0) {
val messageId: Long = writableDatabase.withinTransaction {
val id = writableDatabase.insert(TABLE_NAME, null, values)
if (id < 0) {
Log.w(TAG, "Failed to insert text message (${message.sentTimestampMillis}, ${message.authorId}, ThreadId::$threadId)! Likely a duplicate.")
return Optional.empty()
} else {
if (unread && editedMessage == null) {
threads.incrementUnread(threadId, 1, 0)
}
if (message.subscriptionId != -1) {
recipients.setDefaultSubscriptionId(message.authorId, message.subscriptionId)
}
}
if (unread && editedMessage == null) {
threads.incrementUnread(threadId, 1, 0)
}
id
}
if (message.subscriptionId != -1) {
recipients.setDefaultSubscriptionId(message.authorId, message.subscriptionId)
}
writableDatabase.setTransactionSuccessful()
} finally {
writableDatabase.endTransaction()
if (messageId < 0) {
return Optional.empty()
}
if (!silent) {

View File

@@ -145,7 +145,11 @@ class PushProcessMessageJobV2 private constructor(
}
PushProcessMessageJobV2(builder.build(), result.envelope.toBuilder().clearContent().build(), result.content, result.metadata, result.serverDeliveredTimestamp)
} else {
messageProcessor.process(result.envelope, result.content, result.metadata, result.serverDeliveredTimestamp)
try {
messageProcessor.process(result.envelope, result.content, result.metadata, result.serverDeliveredTimestamp)
} catch (e: Exception) {
Log.e(TAG, "Failed to process message with timestamp ${result.envelope.timestamp}. Dropping.")
}
null
}
}

View File

@@ -52,7 +52,7 @@ public final class IncomingGroupCallActionProcessor extends DeviceAwareActionPro
@NonNull UUID sender,
@NonNull CallManager.RingUpdate ringUpdate)
{
Log.i(TAG, "handleGroupCallRingUpdate(): recipient: " + remotePeerGroup.getId() + " ring: " + ringId + " update: " + ringUpdate);
Log.i(TAG, "handleGroupCallRingUpdate(): recipient: " + remotePeerGroup.getId() + " ring: " + Long.toHexString(ringId) + " update: " + ringUpdate);
Recipient recipient = remotePeerGroup.getRecipient();
boolean updateForCurrentRingId = ringId == currentState.getCallSetupState(RemotePeer.GROUP_CALL_ID).getRingId();
@@ -60,10 +60,10 @@ public final class IncomingGroupCallActionProcessor extends DeviceAwareActionPro
if (SignalDatabase.calls().isRingCancelled(ringId, remotePeerGroup.getId())) {
try {
Log.i(TAG, "Ignoring incoming ring request for already cancelled ring: " + ringId);
Log.i(TAG, "Ignoring incoming ring request for already cancelled ring: " + Long.toHexString(ringId));
webRtcInteractor.getCallManager().cancelGroupRing(groupId.getDecodedId(), ringId, null);
} catch (CallException e) {
Log.w(TAG, "Error while trying to cancel ring: " + ringId, e);
Log.w(TAG, "Error while trying to cancel ring: " + Long.toHexString(ringId), e);
}
return currentState;
}
@@ -76,7 +76,7 @@ public final class IncomingGroupCallActionProcessor extends DeviceAwareActionPro
ringUpdate);
if (updateForCurrentRingId && isCurrentlyRinging) {
Log.i(TAG, "Cancelling current ring: " + ringId);
Log.i(TAG, "Cancelling current ring: " + Long.toHexString(ringId));
currentState = currentState.builder()
.changeCallInfoState()
@@ -93,20 +93,20 @@ public final class IncomingGroupCallActionProcessor extends DeviceAwareActionPro
if (!updateForCurrentRingId && isCurrentlyRinging) {
try {
Log.i(TAG, "Already ringing so reply busy for new ring: " + ringId);
Log.i(TAG, "Already ringing so reply busy for new ring: " + Long.toHexString(ringId));
webRtcInteractor.getCallManager().cancelGroupRing(groupId.getDecodedId(), ringId, CallManager.RingCancelReason.Busy);
} catch (CallException e) {
Log.w(TAG, "Error while trying to cancel ring: " + ringId, e);
Log.w(TAG, "Error while trying to cancel ring: " + Long.toHexString(ringId), e);
}
return currentState;
}
if (updateForCurrentRingId) {
Log.i(TAG, "Already ringing for ring: " + ringId);
Log.i(TAG, "Already ringing for ring: " + Long.toHexString(ringId));
return currentState;
}
Log.i(TAG, "Requesting new ring: " + ringId);
Log.i(TAG, "Requesting new ring: " + Long.toHexString(ringId));
Recipient ringerRecipient = Recipient.externalPush(ServiceId.from(sender));
SignalDatabase.calls().insertOrUpdateGroupCallFromRingState(

View File

@@ -231,6 +231,12 @@ public final class WebRtcCallService extends Service implements SignalAudioManag
}
public void setCallInProgressNotification(int type, @NonNull RecipientId id) {
if (lastNotificationId == INVALID_NOTIFICATION_ID) {
lastNotificationId = CallNotificationBuilder.getStartingStoppingNotificationId();
lastNotification = CallNotificationBuilder.getStartingNotification(this);
startForegroundCompat(lastNotificationId, lastNotification);
}
notificationDisposable.dispose();
notificationDisposable = CallNotificationBuilder.getCallInProgressNotification(this, type, Recipient.resolved(id))
.subscribe(notification -> {

View File

@@ -8,18 +8,41 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.WorkerThread;
import com.bumptech.glide.load.DataSource;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.load.engine.GlideException;
import com.bumptech.glide.request.RequestListener;
import com.bumptech.glide.request.target.Target;
import org.signal.core.util.logging.Log;
import org.thoughtcrime.securesms.mms.GlideApp;
import java.io.ByteArrayOutputStream;
import java.util.List;
import java.util.concurrent.ExecutionException;
public final class ImageCompressionUtil {
private static final String TAG = Log.tag(ImageCompressionUtil.class);
private static final String TAG = Log.tag(ImageCompressionUtil.class);
private static final RequestListener<Bitmap> bitmapRequestListener = new RequestListener<>() {
@Override
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Bitmap> target, boolean isFirstResource) {
if (e != null) {
List<Throwable> causes = e.getRootCauses();
for (int i = 0, size = causes.size(); i < size; i++) {
Log.i(TAG, "Root cause (" + (i + 1) + " of " + size + ")", causes.get(i));
}
} else {
Log.e(TAG, "Loading failed: " + model);
}
return false;
}
@Override
public boolean onResourceReady(Bitmap resource, Object model, Target<Bitmap> target, DataSource dataSource, boolean isFirstResource) {
return false;
}
};
private ImageCompressionUtil () {}
@@ -60,6 +83,7 @@ public final class ImageCompressionUtil {
try {
scaledBitmap = GlideApp.with(context.getApplicationContext())
.asBitmap()
.addListener(bitmapRequestListener)
.load(glideModel)
.skipMemoryCache(true)
.diskCacheStrategy(DiskCacheStrategy.NONE)

View File

@@ -122,6 +122,15 @@ public class CallNotificationBuilder {
}
}
public static @NonNull Notification getStartingNotification(@NonNull Context context) {
return new NotificationCompat.Builder(context, NotificationChannels.getInstance().CALL_STATUS)
.setSmallIcon(R.drawable.ic_call_secure_white_24dp)
.setOngoing(true)
.setContentTitle(context.getString(R.string.NotificationBarManager__starting_signal_call_service))
.setPriority(NotificationCompat.PRIORITY_MIN)
.build();
}
public static @NonNull Notification getStoppingNotification(@NonNull Context context) {
Intent contentIntent = new Intent(context, MainActivity.class);
contentIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);

View File

@@ -2187,7 +2187,7 @@
</plurals>
<!-- Text shown in a system notification that is used to summary how many chats have new messages. -->
<plurals name="MessageNotifier_d_chats">
<item quantity="one">%1$d chats</item>
<item quantity="one">%1$d chat</item>
<item quantity="other">%1$d chats</item>
</plurals>
<string name="MessageNotifier_d_new_messages_in_d_conversations">%1$d new messages in %2$d chats</string>

View File

@@ -112,7 +112,7 @@ dependencyResolutionManagement {
alias('libsignal-android').to('org.signal', 'libsignal-android').versionRef('libsignal-client')
alias('signal-aesgcmprovider').to('org.signal:aesgcmprovider:0.0.3')
alias('signal-ringrtc').to('org.signal:ringrtc-android:2.27.0')
alias('signal-android-database-sqlcipher').to('org.signal:sqlcipher-android:4.5.4-S1')
alias('signal-android-database-sqlcipher').to('org.signal:sqlcipher-android:4.5.4-S2')
// Third Party
alias('greenrobot-eventbus').to('org.greenrobot:eventbus:3.0.0')

View File

@@ -5896,19 +5896,9 @@ https://docs.gradle.org/current/userguide/dependency_verification.html
<sha256 value="5133a1cf4f3fbf43dc3ab0dd536602bb3d89bb9a1e71b0c86adc034becc11d1f" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.signal" name="sqlcipher-android" version="4.5.3-FTS-S2">
<artifact name="sqlcipher-android-4.5.3-FTS-S2.aar">
<sha256 value="c7c90d6cb382dc7e599c0c5f515018b820c5a037d9a1655adc72adc04074fc5e" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.signal" name="sqlcipher-android" version="4.5.3-FTS-S3">
<artifact name="sqlcipher-android-4.5.3-FTS-S3.aar">
<sha256 value="5551f0bfc413f0d56fca2e6fdddaaae0547b6d35a8c438bb2f66e8e0a1144f10" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.signal" name="sqlcipher-android" version="4.5.4-S1">
<artifact name="sqlcipher-android-4.5.4-S1.aar">
<sha256 value="99b60cc1df0606a3672ce9b87b8b1a43823f45ae027a6fd2167612f1ede080d5" origin="Generated by Gradle"/>
<component group="org.signal" name="sqlcipher-android" version="4.5.4-S2">
<artifact name="sqlcipher-android-4.5.4-S2.aar">
<sha256 value="6f423eb00997e28dd116efa1c1511b78cce0e39e8753026cdc9820fb17140e99" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.slf4j" name="slf4j-api" version="1.6.4">