mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-23 11:15:44 +00:00
Fix crash when encountering SMS calculate length security exception.
This commit is contained in:
committed by
Cody Henthorne
parent
49334ffd42
commit
0c6fe8bea3
@@ -41,6 +41,15 @@ public class SmsCharacterCalculator extends CharacterCalculator {
|
||||
messagesSpent = 1;
|
||||
charactersSpent = messageBody.length();
|
||||
charactersRemaining = 1000;
|
||||
} catch (RuntimeException e) {
|
||||
if (e.getCause() instanceof SecurityException) {
|
||||
Log.e(TAG, "Security Exception", e);
|
||||
messagesSpent = 1;
|
||||
charactersSpent = messageBody.length();
|
||||
charactersRemaining = 1000;
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
int maxMessageSize;
|
||||
@@ -54,4 +63,3 @@ public class SmsCharacterCalculator extends CharacterCalculator {
|
||||
return new CharacterState(messagesSpent, charactersRemaining, maxMessageSize, maxMessageSize);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user