How to write to SMS Content Provider in Android KitKat WITHOUT being default SMS app - Java for Android App Development

Hello,
we know that Google made huge changes on SMS management with the release of Android 4.4 KitKat.
In summary:
1) the user can choose a default SMS application and only this app can write to SMS content provider.
2) now there are two broadcast SMS_RECEIVED_ACTION (for all apps) and SMS_DELIVER_ACTION (only for the default app). You will get notified about an incoming SMS with both, but you cannot abort the broadcast anymore
If you want to delete (or to restore) an SMS, you have to become default app temporarily, annoying the user with two mandatory prompts.
Looking in Android sources we can find out that the default SMS app gets a special permission to write SMS with App Ops:
Code:
// Allow OP_WRITE_SMS for the newly configured default SMS app.
appOps.setMode(AppOpsManager.OP_WRITE_SMS, applicationData.mUid,
applicationData.mPackageName, AppOpsManager.MODE_ALLOWED);
and we also know that there is still a way to access App Ops in Android 4.4 KitKat:
From shell:
Code:
adb shell am start -a android.settings.SETTINGS -e ":android:show_fragment" "com.android.settings.applications.AppOpsSummary"
From your app:
Code:
Intent intent = new Intent(Intent.ACTION_MAIN);
ComponentName cn = new ComponentName("com.android.settings", "com.android.settings.Settings");
intent.setComponent(cn);
intent.putExtra(":android:show_fragment", "com.android.settings.applications.AppOpsSummary");
startActivity(intent);
If you go to Messaging tab and look into permissions, you will find out that your non-default SMS app has WRITE SMS OFF. But you can also turn that ON because it isn't mutually exclusive with the default app.
You still require user interaction (but not root) or root access to write this secure setting.
I hope that some developer can benefit of this before Google lock down definitively App Ops access. Sorry, but it doesn't solve abort broadcast issue.
I found this issue on AOSP: https://code.google.com/p/android/issues/detail?id=61684
I also think that Google should change something with SMS. Why not let the user choose not one but more apps as "default" (like notification listener for example) and restore the ability to abort broadcast?
Best regards!

This has stopped working in 4.4.2.
Do anyone have an work around?

Bump - need a way to fix the problem with SMS filtering. Numbers I've blocked with another app still get into my inbox defeating the purpose.
Sent from my i337 on Roids using xda premium

Goliath27 said:
Bump - need a way to fix the problem with SMS filtering. Numbers I've blocked with another app still get into my inbox defeating the purpose.
Sent from my i337 on Roids using xda premium
Click to expand...
Click to collapse
+1
Sent from my EVO using Tapatalk

Edit : Answer Deleted

How update this settings in my app if I have root privileges?
Thanks

Related

Messages in call logs !!!:-[

Can someone please make a flashable zip to disable this feature in froyo ! I hate having my messages history in the call log feature ! Very annoying ! I don't know why on earth samsung thought this would be usefull!.. and they don't even give u a option to disable it and only have calls in and out show !! Smh
Sent from my SPH-D700 using Tapatalk
kgdadon said:
Can someone please make a flashable zip to disable this feature in froyo ! I hate having my messages history in the call log feature ! Very annoying ! I don't know why on earth samsung thought this would be usefull!.. and they don't even give u a option to disable it and only have calls in and out show !! Smh
Sent from my SPH-D700 using Tapatalk
Click to expand...
Click to collapse
As you know, the app currently allows viewing by missed OR dialed OR received calls, but we can't view ONLY our incoming and outgoing calls without also seeing the logs of text messages (i.e. we can't view only our calls!).
Adding a "see all calls" option to the existing list would solve this issue by excluding the messages from the list. (Duh, Samsung!)
I'd prefer adapting the existing phone logging function to a new app because a) this would hopefully be an easier mod than creating a new app, and b) this would allow the user to continue to keep a log of messaging but not have to look at it if they don't want to.
And by the way, c) you Developers ROCK!
+1
This new functionality is very ANNOYING!!!!
In the meantime. See if this meets your needs. Although it's not exactly what we need and someone still needs to fix this.
Instead of going to "Logs", go to "Favorites"
(Optional) Menu > Frequent first
(Optional) Menu > Grid View
UNFORTUNATELY this is only based on out-going calls.
bilestoad said:
As you know, the app currently allows viewing by missed OR dialed OR received calls, but to view ONLY our calls, in AND out, we also have to see the messages (i.e. we can't view only our calls!).
Adding a "see all calls" option to the existing list would solve this issue by excluding the messages from the list. (Duh, Samsung!)
I'd prefer adapting the existing phone logging function to a new app because a) this would hopefully be an easier mod than creating a new app, and b) this would allow the user to continue to keep a log of messaging but not have to look at it if they don't want to.
And by the way, c) you Developers ROCK!
Click to expand...
Click to collapse
There's a free app in the market called Advanced Call Log by NickyCho which does what I'm looking for -- anyone know a way I can have the phone app open this program instead of the stock log (when I open phone, and press the Logs button at the top of the app)?
http://forum.xda-developers.com/showthread.php?t=853177
http://forum.xda-developers.com/showpost.php?p=9493891&postcount=13
This is a link to the post in the same thread as the previous post in this thread but it has a flashable zip file attached
epic_image said:
http://forum.xda-developers.com/showthread.php?t=853177
Click to expand...
Click to collapse
Awesome, thanks! This works (so far) for me - I'm on dk17 currently using viperROM 2.6.
I downloaded the .apk from the thread, and then used root explorer to rename the existing LogsProvider.apk (found in /system/app) to Logsprovider.apk.bak. Then I pasted Mammon88's into the /system/app directory and rebooted. Voila! Only calls now. Thanks Mammon88! And posters who found it and posted it here!

[Q] Disable deleting messages from inbox

Is there any way to disable the "Delete" option for my messages in inbox?
That is no one should be able to delete the messages.
Not aware of any such system, but, you can use one of the various "App Lockers" which will lock the messaging app with a password. Or, alternatively, take backups of your messages regularly using any SMS backup app.
userwf said:
Is there any way to disable the "Delete" option for my messages in inbox?
That is no one should be able to delete the messages.
Click to expand...
Click to collapse
Very intresting.. u might be facing some serious accidental deletes / unauthorized deletes. But u might not find a messaging application like that.
---U can lock any apps with "App Protector" preventing the unauthorized usage. I guess u also need individual msg locking, but I don't know whether it is available presently.
---And there are full fledged sms backup applications (say "Sms Backup & Restore"). U can set automatic scheduled hourly backups to memory card. And u can restore and even can access the backed up content from pc.
---And if u still need an option to disable the deleting, maybe u should ask the devs. Or maybe u should write ur own source (if u r a programmer) without the delete option and compile it. Don't know how far it works, but definitely it is a tough one.
Sent from my HTC Wildfire using XDA App

SMS received on my N7 ?

Hello,
I have an 3G N7 and know that it can not receive / send SMS. OK, that is what was told of.
But today I got a notification that I have a message in notification bar, opened it and it looked like a regular SMS message.
Then I tested myself, I sent a normal SMS to my tablet gsm number and received it instantly. I'm on Vodafone if that makes any sense.
Build number is JDQ39 - baseband 1231_0.17.0_1205, Kernel 3.1.10-g05b777c.
Obviously this is some app inside that handles the received message, what's the app name ? location ? at least is interesting to know that at least SMS I can receive. How can I access it ?
Best regards,
Radu
Hi, i also have the same question. Anybody knows?
Sent from my Nexus 7 using xda premium
Download Go sms from store.
Google Voice works great on the N7 for sending and receiving sms, also. Sms works over wifi or data.
I maybe not beein too explicit.
I have received two SMS, regular kind, sent through my gsm carrier.
As i received them, means there is some app that recognise it and can handle the sms.
Question is, what is the app, how can i acces the messages received.
I'm aware of various solutions for sms that require to have an online account, in order to handle sms, do not want to use this kind of service.
Also, there is hack to install sms/mms apk by rooting, but, again this is not the object of my question.
I just want to check my incoming sms's for now.
Best regards,
Radu
Like mentioned above, if you install gosms or any other third party app it should allow you to view that text message that came through the carrier
Sent from my Nexus 7 using xda premium
tzoller said:
Obviously this is some app inside that handles the received message, what's the app name ? location ? at least is interesting to know that at least SMS I can receive. How can I access it ?
Click to expand...
Click to collapse
Long press the notification and press "App Info" and that will tell you the name of the app.
Hello again,
Here is screenshot and detaild of the app.
As it says it receives SMS, but also can write SMS- see last line, in theory.
Question is, where can find this app. Looks to be hidden..
Sent from my Nexus 7
How to do so with stock mms.apk has already been covered here http://forum.xda-developers.com/showthread.php?p=34282107
Right in the N7 3G dev section. XDA search function is highly recommended
Sent from my Nexus 7 using xda premium
Hello Rebel,
I know the MMS.APK, saw it, thank you for heads up.
My specific question is, why should I use that, if I have an app already installed. I do get SMSs from any regular gsm phone, without being necessary to create an online account for GOSMSPRO or whatever similar. The screen shot says that I might be able to send also, on my cost SMSs. No probIem, just want to find that app that handles the SMS received. Can I do that ? can I send using same app that is ALREADY installed?
thank you for patience
radu
So it seems the 'Simple message receiver' is an app that comes with the 3g N7. Mine is just wi-fi, so I can't check, but does your app drawer have that app? If you check Settings > Apps > All, is it listed there? I have no idea how to open it if it is not in the app drawer or if you would be able to send using it anyway. Interesting that it is included in the 3G version.
tzoller said:
Hello Rebel,
I know the MMS.APK, saw it, thank you for heads up.
My specific question is, why should I use that, if I have an app already installed. I do get SMSs from any regular gsm phone, without being necessary to create an online account for GOSMSPRO or whatever similar. The screen shot says that I might be able to send also, on my cost SMSs. No probIem, just want to find that app that handles the SMS received. Can I do that ? can I send using same app that is ALREADY installed?
thank you for patience
radu
Click to expand...
Click to collapse
Yes. As thw thread states, they are successfully receiving and sending sms from the same app over gsm, just as you would on a phone. The only difference i forsee is doing so with a dedicated data sim, or using the sim from your existing phone.
Many are using the latter, and using other apps to forward thier phone calls to the data side, and using sms normally.
Sent from my SAMSUNG-SGH-I727 using xda premium

[NEW SMS API 4.4] Feature:SMS_WRITE_ACTION for more that just one app,user selectable

You all know that new 4.4 SMS_API is allowing only one app write access to SMS Content Provider.
I have just started that feature request on AOSP that we can select more apps to allow write access to SMS Content Provider all allow no app write access if some one does not use sms at all.
You can back it up with your words here. Thanks.
I just can not imagine myself only one app doing all usefull things you can do with sms.Can you?

Multiple SMS Applications

Hello,
i own an OnePlus 2 which is rooted with the Exodus ROM with android 6.0 also the xposed Framework is installed.
At the Moment I try to use two SMS apps because i like some stuff in both but they both have disadvantages.
Is there any possibility to send SMS via both apps? Because everytime I try it I have to change the default messenger app.
I also try to change the permissions of the apps but it didn't help
have a nice day
Sir Hamburger
Hi, what you are hoping to do cannot be possible since the system accepts one sms app at a time, it's deeply coded and works with the sms push and the network provider. so you can't have both sms apps corresponding to the same network, system or device. the option is just not available yet. you have to choice either way.
First of all thank you steps parku for the answer.
I solved it now with a tasker profile with the secure settings extension
If you start an other sms app tasker sets it on default.
Kind regards
Sir Hamburger

Categories

Resources