Closed naveensingh closed 1 year ago
make activity binding consistent with Calculator please, like
private val binding by lazy(LazyThreadSafetyMode.NONE) { ActivityMainBinding.inflate(layoutInflater) }
make activity binding consistent with Calculator please, like
private val binding by lazy(LazyThreadSafetyMode.NONE) { ActivityMainBinding.inflate(layoutInflater) }
nevermind, forgot viewBinding is a helper extension, so its ok...
applied suggested changes, check again, please.
looks good, thanks :)
Are you not getting any crashes when receiving MMS on Android 14 without including https://github.com/tibbi/android-smsmms/pull/15?
Are you not getting any crashes when receiving MMS on Android 14 without including tibbi/android-smsmms#15?
right, havent tested that one, will do it now
got a crash at trying to add another person into a conversation Process: com.simplemobiletools.smsmessenger.debug, PID: 17089 java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread. Make sure your adapter calls notifyDataSetChanged() when its content changes. [in ListView(-1, class android.widget.DropDownListView) with Adapter(class com.simplemobiletools.smsmessenger.adapters.AutoCompleteTextViewAdapter)] at android.widget.ListView.layoutChildren(ListView.java:1715) at android.widget.AbsListView.onLayout(AbsListView.java:2263) at android.view.View.layout(View.java:24421) at android.view.ViewGroup.layout(ViewGroup.java:6440) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332) at android.widget.FrameLayout.onLayout(FrameLayout.java:270) at android.view.View.layout(View.java:24421) at android.view.ViewGroup.layout(ViewGroup.java:6440) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332) at android.widget.FrameLayout.onLayout(FrameLayout.java:270) at android.view.View.layout(View.java:24421) at android.view.ViewGroup.layout(ViewGroup.java:6440) at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:4258) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3583) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2465) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:9305) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1339) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1348) at android.view.Choreographer.doCallbacks(Choreographer.java:952) at android.view.Choreographer.doFrame(Choreographer.java:882) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1322) at android.os.Handler.handleCallback(Handler.java:958) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:205) at android.os.Looper.loop(Looper.java:294)
receiving mms on Android 14 doesnt work, not even onMessageReceived triggers in MmsReceiver.
sending works. Both sending a file and group message. Checked device settings, I dont think it is an issue in the system itself, allowed everything I could.
guess someone else should also check this app to be able to work with MMS directly. Maybe @fatihergin, can you send MMS and do you have 2 SIM cards?
got a crash at trying to add another person into a conversation
https://github.com/SimpleMobileTools/Simple-SMS-Messenger/pull/729 fixes this. Not sure why no one noticed it before, it should be there in the play console crash reports.
Since I can't test the MMS issue without messing around working up a dummy PDU, here are some pointers:
Before MmsReceiver.onMessageReceived()
is called, PushReceiver.onReceive()
is called which parses the MMS pdu and calls DownloadManager.downloadMultimediaMessage()
.
DownloadManager.downloadMultimediaMessage()
then calls SmsManager.downloadMultimediaMessage()
with a pending intent that will call MmsReceiver.onMessageReceived()
once the MMS message is downloaded.
Adding a few breakpoints in PushReceiver
and DownloadManager
should help figure out the problem.
receiving mms on Android 14 doesnt work
@tibbi does receiving MMS still work on Android 13 and below? (with https://github.com/tibbi/android-smsmms/pull/15 applied)
nope, it is actually quite broken on Android 13 too
if I try attaching an image, I get "An unknown error occurred" and while it is seemingly sent well, the receiving side gets an error like File cannot be opened. Receiving on Android 13 doesnt work either
maybe try reverting to targetSDK 33 if it worked well there, until rewritten properly.. There are already many changes in this app update, like viewbinding rewrite, recycle bin and archive.
guess someone else should also check this app to be able to work with MMS directly. Maybe @fatihergin, can you send MMS and do you have 2 SIM cards?
i can just send mms with an android 12 device. unfortunately don't have 2 sim card, but i was able to test receiving mms once, and it worked on my android 12 device. sending mms also worked on the same device. i did my tests with current master 166998f
how about @esensar , do you have an Android 14, can you send MMS and maybe have 2 SIM cards?
if I try attaching an image, I get "An unknown error occurred" and while it is seemingly sent well, the receiving side gets an error like File cannot be opened
@tibbi that is conflicting. An unknown error occurred is shown only if contentResolver.getType(uri)
returns null or if glide fails to load the image. In both these cases, the attachment is immediately removed and it's not possible to send it. I double-checked this with a defective image (on Android 13). Did you get 'An unknown error occurred' after you hit send?
I got the error right after selecting the wanted image at the file picker, but it still showed the image and I could send it as MMS too. Everything is shown correctly on the senders side, like it succeeded.
how about @esensar , do you have an Android 14, can you send MMS and maybe have 2 SIM cards?
I don't have Android 14 on a physical device yet unfortunately. I will see if I can get a hold of one.
Ok guys, for future reference, here's a method to trigger a fake MMS push on any Android version (android 14 emulator too):
private fun triggerFakeMmsPush() {
val pushData = byteArrayOf(-116, -126, -104, 84, 49, 56, 97, 50, 49, 55, 49, 100, 99, 54, 98, 0, -115, -110, -120, 5, -127, 3, 9, 58, -128, -118, -128, -114, 2, 4, 0, -125, 104, 116, 116, 112, 58, 47, 47, 54, 57, 46, 55, 56, 46, 55, 48, 46, 55, 48, 47, 115, 101, 114, 118, 108, 101, 116, 115, 47, 109, 109, 115, 63, 109, 101, 115, 115, 97, 103, 101, 45, 105, 100, 61, 84, 49, 56, 97, 50, 49, 55, 49, 100, 99, 54, 98, 0)
val result = PduParser(pushData).parse()
val transactionId = String((result as NotificationInd).transactionId)
val selection = Telephony.Mms.TRANSACTION_ID + " = ?"
val selectionArgs = arrayOf(transactionId)
val deleted = contentResolver.delete(
Telephony.Mms.CONTENT_URI, selection, selectionArgs
)
Log.d("MmsTest", "deleted previous notification: $deleted")
Log.d("MmsTest", "Triggering fake MMS push...")
PushReceiver().onReceive(this, Intent().apply {
type = ContentType.MMS_MESSAGE
action = Telephony.Sms.Intents.WAP_PUSH_RECEIVED_ACTION
putExtras(bundleOf("data" to pushData))
})
}
If everything is working properly, android-smsmms will try to download the mms and fail with a FileNotFoundException
which you can spot in the logcat.
If anyone is interested in providing a sample pdu.dat file (this may contain your personal info e.g. phone number), I'll be able to completely test receiving MMS messages:
adb shell
run-as com.simplemobiletools.smsmessenger.debug
while true; do cp cache/download.*.dat /sdcard/ || true; done
download.RANDOM_NUMBER.dat
file should be there in the root sdcard folder after a few minutes.@tibbi
receiving mms on Android 14 doesnt work, not even onMessageReceived triggers in MmsReceiver.
Side note: If you have a recent device with an unlocked bootloader, you might be able to boot an Android 14 GSI
I pulled the latest code from master and installed it on my Android 14 device with dual SIM (one of them MMS enabled). Sending MMS worked for me, but receiving seems to have some issues.
It seems that some receiver is missing the exported
attribute, which is mandatory starting with Android 14. I will open a PR for android-smsmms
@esensar could you please try again with https://github.com/tibbi/android-smsmms/pull/16 included? I added the missing RECEIVER_EXPORTED
flag there.
@esensar could you please try again with tibbi/android-smsmms#16 included? I added the missing
RECEIVER_EXPORTED
flag there.
Yeah, that was the spot where it crashed. It should work, I will let you know.
Yeah, it is working now :tada:
Major changes:
READ_MEDIA_IMAGES
orREAD_MEDIA_VIDEOS
permission, no changes are required.Minor changes:
item_sent_message.xml
anditem_received_message.xml
into oneitem_message.xml
view to avoid setup code duplication with view binding.Testing:
I tested most of the features on an Android 14 emulator and no issues were found. Since I can not test MMS messages, please test the following cases: