Android Tutorial SMS and CALL_LOG permissions are no longer available

Status
Not open for further replies.
Google has changed their policy regarding the following permissions:
READ_SMS, SEND_SMS, WRITE_SMS, RECEIVE_SMS
READ_CALL_LOG, WRITE_CALL_LOG, PROCESS_OUTGOING_CALLS

Only the default phone or messaging apps can use these permissions:
https://support.google.com/googleplay/android-developer/answer/9047303?hl=en

This is relevant for Google Play apps.

The following types of objects can no longer be used:

- CallLog
- SmsMessages
- PhoneSms
- SmsInterceptor (and the equivalent static intent filter)

1. Note that you can send sms messages with an intent and without a permission:
B4X:
Dim In As Intent
Dim number = "0123456789" As String
In.Initialize(In.ACTION_VIEW, "sms:" & number)
In.PutExtra("sms_body", "this is the body")
StartActivity(In)

2. Adding a library doesn't add any permission. You can safely use the Phone library as long as you don't declare any of the above objects.

3. Click on the List Permissions button (in the logs tab) to see your apps permissions.
 

DonManfred

Expert
Licensed User
Longtime User
And how to receive an SMS without permission?
Looks like this is no longer possible.
Away from that you should always create a new thread instead of posting to existing threads!
 

mw71

Active Member
Licensed User
Longtime User
This is relevant for Google Play apps.
Hi Erel,

Thanks for Info (and way to send SMS, came to right time)

my App that use SmsInterceptor is not on Play Store (deliver direct to the 2 users), so that this is not relevant for me. Right?
 

petr4ppc

Well-Known Member
Licensed User
Longtime User
Dear friends

I am using
B4X:
Dim myCallLog As CallLog
Dim myList As List
Dim myitem As CallItem
myList = myCallLog.GetAll(0)

with myphone.sdkversion=26, Android 8

I have not this app in google play. I have only my own instalation.
I get error:

java.lang.SecurityException: Permission Denial: opening provider com.android.providers.contacts.CallLogProvider from ProcessRecord{3d87bd0 8097:mm2.app.mobile/u0a202} (pid=8097, uid=10202) requires android.permission.READ_CALL_LOG or android.permission.WRITE_CALL_LOG

I am using this permission:
B4X:
                             rp.CheckAndRequest(rp.PERMISSION_READ_CALL_LOG)
                                        wait for Activity_PermissionResult(permission As String, result As Boolean)
                                        If result=True Then
                                            '-----------CALL LOG
                                                Dim myCallLog As CallLog
                                                Dim myList As List
                                                Dim myitem As CallItem
                                                myList = myCallLog.GetAll(0)
                                        End If

In Manifesteditor i have:
B4X:
AddPermission(android.permission.READ_CALL_LOG)

The trouble is Google, my Phone or my code, please?
Thank you
p4ppc
 
Status
Not open for further replies.
Top