Android Question How to find what's causing android.permission.READ_LOGS

Misterbates

Active Member
Licensed User
After a few adjustments today, all of a sudden the permission android.permission.READ_LOGS is being added to my App's manifest. I don't recall updating any of the libraries or adding any functionality compared to yesterday's build.

I did adjust the code in my Starter service to comment out doing anything in Application_Error except return true:
B4X:
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
    'wait for 500ms to allow the logs to be updated.
'    Dim jo As JavaObject
'    Dim l As Long = 500
'    jo.InitializeStatic("java.lang.Thread").RunMethod("sleep", Array(l))
'    logcat.LogCatStop
'    logs.Append(StackTrace)
'    Dim email As Email
'    email.To.Add(emailAddress)
'    email.Subject = "Error report: " & Application.LabelName & " (" & Application.VersionName & ", build " & Main.glAutoVersion & ")"
'    email.Body = logs
'    StartActivity(email.GetIntent)
    Return True ' Will prevent the "continue" dialog and log the error to Google Play
End Sub

And I adjusted the way that ULV is initialized to use phone.sdkversion:
B4X:
    Dim ph As Phone
    If ph.SdkVersion < 21 Then
        ' Android version < 5.0 Lollipop
        lstULV.SetStyle(lstULV.STYLE_HOLO_LIGHT2)
    Else
        lstULV.SetStyle(lstULV.STYLE_MATERIAL_LIGHT)
    End If

Could either of these changes be causing the new permission?
 

Misterbates

Active Member
Licensed User
Turns out it *is* the phone.sdkversion that's causing the permission to be added.

Is there any way to check the android version without that permission?
 
Upvote 0

Misterbates

Active Member
Licensed User
Click on Logs - Show Permissions. This will list all the permissions and their sources.
Thanks - very useful.

No. Phone type doesn't add any permission.
Weird! I compiled it three times yesterday, once with all of the if/then logic uncommented, once with the if commented and the HOLO_LIGHT uncommented and once with the if commented and the MATERIAL_LIGHT uncommented. The only time the permission was added was with all of the if/then uncommented. Compiling it today, with the if/then uncommented, the permission doesn't get added!

Apologies all to call the Phone object into doubt.
 
Upvote 0
Top