Android Question Android 13 : Ssaid settings not accessible

prajinpraveen

Active Member
Licensed User
Longtime User
Hello All,

Phone upgraded to Android 13. I am using B4A 12.20

the code fails at

B4X:
Dim phone As Phone  
Log(phone.GetSettings("android_id"))  ' << FAILS


B4X:
java.lang.IllegalStateException: Ssaid settings not accessible
java.lang.IllegalStateException: Ssaid settings not accessible
    at android.os.Parcel.createExceptionOrNull(Parcel.java:3031)
    at android.os.Parcel.createException(Parcel.java:3007)
    at android.os.Parcel.readException(Parcel.java:2990)
    at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:190)
    at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:142)
    at android.content.ContentProviderProxy.call(ContentProviderNative.java:732)
    at android.provider.Settings$NameValueCache.getStringForUser(Settings.java:3421)
    at android.provider.Settings$Secure.getStringForUser(Settings.java:9299)
    at android.provider.Settings$Secure.getString(Settings.java:9255)
    at anywheresoftware.b4a.phone.Phone.GetSettings(Phone.java:189)
    at za.co.sa.live.main._doactivitycreate(main.java:2649)
    at za.co.sa.live.main$ResumableSub_Activity_Create.resume(main.java:554)
    at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:275)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:215)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:201)
    at anywheresoftware.b4a.keywords.Common$15.run(Common.java:1804)
    at android.os.Handler.handleCallback(Handler.java:942)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:226)
    at android.os.Looper.loop(Looper.java:313)
    at android.app.ActivityThread.main(ActivityThread.java:8741)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
Caused by: android.os.RemoteException: Remote stack trace:
    at com.android.providers.settings.SettingsProvider$SettingsRegistry.generateSsaidLocked(SettingsProvider.java:3487)
    at com.android.providers.settings.SettingsProvider.getSsaidSettingLocked(SettingsProvider.java:2222)
    at com.android.providers.settings.SettingsProvider.getSecureSetting(SettingsProvider.java:2159)
    at com.android.providers.settings.SettingsProvider.call(SettingsProvider.java:584)
    at android.content.ContentProvider.call(ContentProvider.java:2582)


I also notice that the permissions fails
Status: false : android.permission.CALL_PHONE


B4X:
Sub Activity_Resume
    
    If Not(Starter.RT.Check(Starter.RT.PERMISSION_READ_PHONE_STATE)) Then
        CheckRT(Starter.RT.PERMISSION_READ_PHONE_STATE)
    End If
    
    If Not(Starter.RT.Check(Starter.RT.PERMISSION_CAMERA)) Then
        CheckRT(Starter.RT.PERMISSION_CAMERA)
    End If

    If Not(Starter.RT.Check(Starter.RT.PERMISSION_WRITE_EXTERNAL_STORAGE)) Then
        CheckRT(Starter.RT.PERMISSION_WRITE_EXTERNAL_STORAGE)
    End If

    If Not(Starter.RT.Check(Starter.RT.PERMISSION_CALL_PHONE)) Then
        CheckRT(Starter.RT.PERMISSION_CALL_PHONE)
    End If
    
    If Not(Starter.RT.Check(Starter.RT.PERMISSION_READ_EXTERNAL_STORAGE)) Then
        CheckRT(Starter.RT.PERMISSION_READ_EXTERNAL_STORAGE)
    End If
    
End Sub

B4X:
Sub CheckRT(permissionstring As String)
    Starter.RT.CheckAndRequest(permissionstring)
    Wait For Activity_PermissionResult (permission As String, Result As Boolean)
    Log($"Status: ${Starter.RT.Check(permissionstring)} :  ${permissionstring}"$)
   
    If Result = False Then
        log('permission failed')
        Return
    Else
        Dim pid As PhoneId
        Log("phone id: " & pid)
    End If
End Sub
 
Last edited:

prajinpraveen

Active Member
Licensed User
Longtime User
Found out that when i install the app through B4A, two copies gets installed as the phone supports dual app.

The above issue happens when the second instance of the app is executed


dual.png
 
Upvote 0
Top