Loading common/build.gradle +2 −2 Original line number Original line Diff line number Diff line Loading @@ -20,11 +20,11 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android' android { android { compileSdkVersion 28 compileSdkVersion 29 defaultConfig { defaultConfig { minSdkVersion 21 minSdkVersion 21 targetSdkVersion 28 targetSdkVersion 29 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } } Loading data/build.gradle +2 −2 Original line number Original line Diff line number Diff line Loading @@ -21,7 +21,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-kapt' android { android { compileSdkVersion 28 compileSdkVersion 29 publishNonDefault true publishNonDefault true flavorDimensions "analytics" flavorDimensions "analytics" Loading @@ -32,7 +32,7 @@ android { defaultConfig { defaultConfig { minSdkVersion 21 minSdkVersion 21 targetSdkVersion 28 targetSdkVersion 29 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" buildConfigField "String", "AMPLITUDE_API_KEY", "\"${System.getenv("AMPLITUDE_API_KEY")}\"" buildConfigField "String", "AMPLITUDE_API_KEY", "\"${System.getenv("AMPLITUDE_API_KEY")}\"" Loading data/src/main/java/com/moez/QKSMS/repository/ImageRepostoryImpl.kt +2 −3 Original line number Original line Diff line number Diff line Loading @@ -29,10 +29,9 @@ import javax.inject.Inject class ImageRepostoryImpl @Inject constructor(private val context: Context) : ImageRepository { class ImageRepostoryImpl @Inject constructor(private val context: Context) : ImageRepository { override fun loadImage(uri: Uri): Bitmap? { override fun loadImage(uri: Uri): Bitmap? { val exif = ExifInterface(context.contentResolver.openInputStream(uri)) val exif = context.contentResolver.openInputStream(uri)?.let(::ExifInterface) val bitmap = BitmapFactory.decodeStream(context.contentResolver.openInputStream(uri)) val bitmap = BitmapFactory.decodeStream(context.contentResolver.openInputStream(uri)) val orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL) val orientation = exif?.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL) return when (orientation) { return when (orientation) { ExifInterface.ORIENTATION_ROTATE_90 -> rotateBitmap(bitmap, 90f) ExifInterface.ORIENTATION_ROTATE_90 -> rotateBitmap(bitmap, 90f) Loading data/src/main/java/com/moez/QKSMS/repository/MessageRepositoryImpl.kt +5 −3 Original line number Original line Diff line number Diff line Loading @@ -415,7 +415,9 @@ class MessageRepositoryImpl @Inject constructor( // // // We do this after inserting the message because it might be slow, and we want the message // We do this after inserting the message because it might be slow, and we want the message // to be inserted into Realm immediately. We don't need to do this after receiving one // to be inserted into Realm immediately. We don't need to do this after receiving one realm.executeTransaction { managedMessage?.takeIf { it.isValid }?.contentId = uri.lastPathSegment.toLong() } uri?.lastPathSegment?.toLong()?.let { id -> realm.executeTransaction { managedMessage?.takeIf { it.isValid }?.contentId = id } } realm.close() realm.close() // On some devices, we can't obtain a threadId until after the first message is sent in a // On some devices, we can't obtain a threadId until after the first message is sent in a Loading Loading @@ -459,9 +461,9 @@ class MessageRepositoryImpl @Inject constructor( values.put(Telephony.Sms.SUBSCRIPTION_ID, message.subId) values.put(Telephony.Sms.SUBSCRIPTION_ID, message.subId) } } context.contentResolver.insert(Telephony.Sms.Inbox.CONTENT_URI, values)?.let { uri -> context.contentResolver.insert(Telephony.Sms.Inbox.CONTENT_URI, values)?.lastPathSegment?.toLong()?.let { id -> // Update the contentId after the message has been inserted to the content provider // Update the contentId after the message has been inserted to the content provider realm.executeTransaction { managedMessage?.contentId = uri.lastPathSegment.toLong() } realm.executeTransaction { managedMessage?.contentId = id } } } realm.close() realm.close() Loading data/src/main/java/com/moez/QKSMS/service/HeadlessSmsSendService.kt +1 −1 Original line number Original line Diff line number Diff line Loading @@ -38,7 +38,7 @@ class HeadlessSmsSendService : IntentService("HeadlessSmsSendService") { AndroidInjection.inject(this) AndroidInjection.inject(this) intent.extras?.getString(Intent.EXTRA_TEXT)?.takeIf { it.isNotBlank() }?.let { body -> intent.extras?.getString(Intent.EXTRA_TEXT)?.takeIf { it.isNotBlank() }?.let { body -> val intentUri = intent.data val intentUri = intent.data val recipients = getRecipients(intentUri).split(";") val recipients = intentUri?.let(::getRecipients)?.split(";") ?: return@let val threadId = conversationRepo.getOrCreateConversation(recipients)?.id ?: 0L val threadId = conversationRepo.getOrCreateConversation(recipients)?.id ?: 0L sendMessage.execute(SendMessage.Params(-1, threadId, recipients, body)) sendMessage.execute(SendMessage.Params(-1, threadId, recipients, body)) } } Loading Loading
common/build.gradle +2 −2 Original line number Original line Diff line number Diff line Loading @@ -20,11 +20,11 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android' android { android { compileSdkVersion 28 compileSdkVersion 29 defaultConfig { defaultConfig { minSdkVersion 21 minSdkVersion 21 targetSdkVersion 28 targetSdkVersion 29 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } } Loading
data/build.gradle +2 −2 Original line number Original line Diff line number Diff line Loading @@ -21,7 +21,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-kapt' android { android { compileSdkVersion 28 compileSdkVersion 29 publishNonDefault true publishNonDefault true flavorDimensions "analytics" flavorDimensions "analytics" Loading @@ -32,7 +32,7 @@ android { defaultConfig { defaultConfig { minSdkVersion 21 minSdkVersion 21 targetSdkVersion 28 targetSdkVersion 29 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" buildConfigField "String", "AMPLITUDE_API_KEY", "\"${System.getenv("AMPLITUDE_API_KEY")}\"" buildConfigField "String", "AMPLITUDE_API_KEY", "\"${System.getenv("AMPLITUDE_API_KEY")}\"" Loading
data/src/main/java/com/moez/QKSMS/repository/ImageRepostoryImpl.kt +2 −3 Original line number Original line Diff line number Diff line Loading @@ -29,10 +29,9 @@ import javax.inject.Inject class ImageRepostoryImpl @Inject constructor(private val context: Context) : ImageRepository { class ImageRepostoryImpl @Inject constructor(private val context: Context) : ImageRepository { override fun loadImage(uri: Uri): Bitmap? { override fun loadImage(uri: Uri): Bitmap? { val exif = ExifInterface(context.contentResolver.openInputStream(uri)) val exif = context.contentResolver.openInputStream(uri)?.let(::ExifInterface) val bitmap = BitmapFactory.decodeStream(context.contentResolver.openInputStream(uri)) val bitmap = BitmapFactory.decodeStream(context.contentResolver.openInputStream(uri)) val orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL) val orientation = exif?.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL) return when (orientation) { return when (orientation) { ExifInterface.ORIENTATION_ROTATE_90 -> rotateBitmap(bitmap, 90f) ExifInterface.ORIENTATION_ROTATE_90 -> rotateBitmap(bitmap, 90f) Loading
data/src/main/java/com/moez/QKSMS/repository/MessageRepositoryImpl.kt +5 −3 Original line number Original line Diff line number Diff line Loading @@ -415,7 +415,9 @@ class MessageRepositoryImpl @Inject constructor( // // // We do this after inserting the message because it might be slow, and we want the message // We do this after inserting the message because it might be slow, and we want the message // to be inserted into Realm immediately. We don't need to do this after receiving one // to be inserted into Realm immediately. We don't need to do this after receiving one realm.executeTransaction { managedMessage?.takeIf { it.isValid }?.contentId = uri.lastPathSegment.toLong() } uri?.lastPathSegment?.toLong()?.let { id -> realm.executeTransaction { managedMessage?.takeIf { it.isValid }?.contentId = id } } realm.close() realm.close() // On some devices, we can't obtain a threadId until after the first message is sent in a // On some devices, we can't obtain a threadId until after the first message is sent in a Loading Loading @@ -459,9 +461,9 @@ class MessageRepositoryImpl @Inject constructor( values.put(Telephony.Sms.SUBSCRIPTION_ID, message.subId) values.put(Telephony.Sms.SUBSCRIPTION_ID, message.subId) } } context.contentResolver.insert(Telephony.Sms.Inbox.CONTENT_URI, values)?.let { uri -> context.contentResolver.insert(Telephony.Sms.Inbox.CONTENT_URI, values)?.lastPathSegment?.toLong()?.let { id -> // Update the contentId after the message has been inserted to the content provider // Update the contentId after the message has been inserted to the content provider realm.executeTransaction { managedMessage?.contentId = uri.lastPathSegment.toLong() } realm.executeTransaction { managedMessage?.contentId = id } } } realm.close() realm.close() Loading
data/src/main/java/com/moez/QKSMS/service/HeadlessSmsSendService.kt +1 −1 Original line number Original line Diff line number Diff line Loading @@ -38,7 +38,7 @@ class HeadlessSmsSendService : IntentService("HeadlessSmsSendService") { AndroidInjection.inject(this) AndroidInjection.inject(this) intent.extras?.getString(Intent.EXTRA_TEXT)?.takeIf { it.isNotBlank() }?.let { body -> intent.extras?.getString(Intent.EXTRA_TEXT)?.takeIf { it.isNotBlank() }?.let { body -> val intentUri = intent.data val intentUri = intent.data val recipients = getRecipients(intentUri).split(";") val recipients = intentUri?.let(::getRecipients)?.split(";") ?: return@let val threadId = conversationRepo.getOrCreateConversation(recipients)?.id ?: 0L val threadId = conversationRepo.getOrCreateConversation(recipients)?.id ?: 0L sendMessage.execute(SendMessage.Params(-1, threadId, recipients, body)) sendMessage.execute(SendMessage.Params(-1, threadId, recipients, body)) } } Loading