Android Question Running ADB Command in B4A

potman100

Active Member
Licensed User
Longtime User
Hi

I'm trying to implement the following command under B4A :

adb shell settings put global multi_sim_data_call 1

It's to set the Data connection in a dual sim phone, but I get the following error when run

B4X:
ava.lang.SecurityException: Permission Denial: Do not have permission in call getContentProviderExternal() from pid=27245, uid=10277 requires android.permission.ACCESS_CONTENT_PROVIDERS_EXTERNALLY
    at android.os.Parcel.readException(Parcel.java:1704)
    at android.os.Parcel.readException(Parcel.java:1654)
    at android.app.ActivityManagerProxy.getContentProviderExternal(ActivityManagerNative.java:4957)
    at com.android.commands.settings.SettingsCmd.run(SettingsCmd.java:148)
    at com.android.commands.settings.SettingsCmd.main(SettingsCmd.java:63)
    at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
    at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:315)


There are lots of posts on the web for this error, but I can't seem to find one the helps.

Thanks

Potman100
 

potman100

Active Member
Licensed User
Longtime User
Thanks Erel, I tried changing the target version, but I get a different error

B4X:
Installing file to device.    Error
adb: failed to install SimTest_DEBUG.apk: Failure [-26: Package sim.test new target SDK 14 doesn't support runtime permissions but the old target SDK 26 does.]
 
Upvote 0

DavideV

Active Member
Licensed User
Longtime User


Hi,probably your device must be rooted in order to change this setting via shell
 
Upvote 0

potman100

Active Member
Licensed User
Longtime User
Ye, that would seem the case, I had it working a while ago with a Doogee phone, but I have a Samsung Galaxy Note 8 and
I bought it from Samsung on a upgrade program, so rooting it will reset the knox flag and will invalidate the warranty.

The Command above is so fast, were I had to jump through hoops to switch on the doogee, and it took up to a minute to switch.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…